From 51d3f0fc4141690c69836110c1a76da1caf37215 Mon Sep 17 00:00:00 2001 From: Alan Li Date: Fri, 17 Jan 2025 04:17:30 +0000 Subject: [PATCH] Another commit --- .../iree/compiler/Dialect/Encoding/IR/EncodingAttrs.cpp | 7 ++----- .../src/iree/compiler/Dialect/Encoding/IR/EncodingTypes.h | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingAttrs.cpp b/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingAttrs.cpp index 7185f2e85c002..84ea520e2bb17 100644 --- a/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingAttrs.cpp +++ b/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingAttrs.cpp @@ -291,11 +291,8 @@ EncodingAttr getEncodingAttr(RankedTensorType type) { bool hasPackedStorageAttr(Type type) { if (auto tensorType = dyn_cast(type)) { - auto encoding = tensorType.getEncoding(); - if (!encoding) { - return false; - } - return dyn_cast_or_null(encoding) != nullptr; + return dyn_cast_or_null(tensorType.getEncoding()) != + nullptr; } return false; } diff --git a/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingTypes.h b/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingTypes.h index 3f357df16a096..74aeb29a8686f 100644 --- a/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingTypes.h +++ b/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingTypes.h @@ -38,7 +38,8 @@ namespace mlir::iree_compiler::IREE::Encoding { /// Otherwise, returns null. EncodingAttr getEncodingAttr(RankedTensorType type); -/// Returns true if the type contains packed_storage attribute. +/// Returns true if the type is a RankedTensorType type and it contains +/// packed_storage attribute. bool hasPackedStorageAttr(Type type); /// Returns the ContractionDimensions for the encoding user_indexing_maps.