Skip to content

Commit

Permalink
could be wrong part 3
Browse files Browse the repository at this point in the history
  • Loading branch information
lialan committed Jan 15, 2025
1 parent 3d083eb commit 6f232c9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -1517,7 +1513,9 @@ LogicalResult TensorCloneOp::verify() {
// information.
auto sourceEncoding = llvm::cast<RankedTensorType>(op.getSourceEncoding());
auto resultEncoding = llvm::cast<RankedTensorType>(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";
Expand Down

0 comments on commit 6f232c9

Please sign in to comment.