diff --git a/compiler/src/iree/compiler/Codegen/Common/EncodingUtils.cpp b/compiler/src/iree/compiler/Codegen/Common/EncodingUtils.cpp index 7f233b2038c3..5bafda7ab2c6 100644 --- a/compiler/src/iree/compiler/Codegen/Common/EncodingUtils.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/EncodingUtils.cpp @@ -29,13 +29,13 @@ MaterializeEncodingTypeConverter::MaterializeEncodingTypeConverter( addConversion([](FloatType floatType) { return floatType; }); addConversion([](MemRefType memrefType) { return memrefType; }); addConversion([=](RankedTensorType type) -> RankedTensorType { - MaterializeEncodingInfo encodingInfo = getEncodingInfo(type); if (IREE::Encoding::hasPackedStorageAttr(type)) { return type; } // For a given tensor type with an encoding, return the materialized // type to use for it. If no encoding is set, then return the tensor type // itself. + MaterializeEncodingInfo encodingInfo = getEncodingInfo(type); if (IREE::Codegen::isIdentityLayout(encodingInfo)) { return dropEncoding(type); } diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Patterns.cpp b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Patterns.cpp index 67eb6240bf03..748483349f98 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Patterns.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Patterns.cpp @@ -6,7 +6,6 @@ #include "iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Patterns.h" -#include "iree/compiler/Codegen/Common/EncodingUtils.h" #include "iree/compiler/Dialect/HAL/Analysis/Captures.h" #include "iree/compiler/Dialect/HAL/Conversion/StreamToHAL/Utils.h" #include "iree/compiler/Dialect/HAL/IR/HALDialect.h" @@ -479,10 +478,7 @@ struct TensorExportBufferViewOpPattern } auto loc = exportOp.getLoc(); - // Drop the encoding of packed_storage here, as it is no longer needed - // afterwards. - auto tensorType = - dropEncoding(llvm::cast(adaptor.getSourceEncoding())); + auto tensorType = llvm::cast(adaptor.getSourceEncoding()); auto dynamicDims = adaptor.getSourceEncodingDims(); // NOTE: we should have verified supported encodings/types at entry into the