diff --git a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp index 5f938cf2c157..947c0c85ce7b 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp +++ b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp @@ -28,10 +28,6 @@ #include "mlir/Support/LogicalResult.h" #include "mlir/Transforms/RegionUtils.h" -namespace mlir::iree_compiler { -using IREE::Encoding::getEncodingAttr; -} - namespace mlir::iree_compiler::IREE::Stream { //===----------------------------------------------------------------------===// @@ -1517,7 +1513,9 @@ LogicalResult TensorCloneOp::verify() { // information. auto sourceEncoding = llvm::cast(op.getSourceEncoding()); auto resultEncoding = llvm::cast(op.getResultEncoding()); - if (getEncodingAttr(sourceEncoding) != getEncodingAttr(resultEncoding)) { + if (sourceEncoding.getEncoding() != resultEncoding.getEncoding() && + !IREE::Encoding::hasPackedStorageAttr(sourceEncoding) && + !IREE::Encoding::hasPackedStorageAttr(resultEncoding)) { return op.emitOpError() << "clones changing tensor encoding from " << sourceEncoding.getEncoding() << " to " << resultEncoding.getEncoding() << "; not allowed";