[Mlir-commits] [mlir] 89b2f29 - [mlir][linalg][bufferize] Fix/add missing case to getAliasingOpOperand

Matthias Springer llvmlistbot at llvm.org
Thu Oct 7 22:43:44 PDT 2021


Author: Matthias Springer
Date: 2021-10-08T14:38:47+09:00
New Revision: 89b2f29d624c9a54f3b67e8a10b8754ce92b3112

URL: https://github.com/llvm/llvm-project/commit/89b2f29d624c9a54f3b67e8a10b8754ce92b3112
DIFF: https://github.com/llvm/llvm-project/commit/89b2f29d624c9a54f3b67e8a10b8754ce92b3112.diff

LOG: [mlir][linalg][bufferize] Fix/add missing case to getAliasingOpOperand

Differential Revision: https://reviews.llvm.org/D111377

Added: 
    

Modified: 
    mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
index 685eb51928cc7..ddbc8a74d147d 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
@@ -561,7 +561,7 @@ static Optional<OpOperand *> getAliasingOpOperand(OpResult result) {
     return None;
   return TypeSwitch<Operation *, OpOperand *>(result.getDefiningOp())
       .Case([&](tensor::CastOp op) { return &op->getOpOperand(0); })
-      .Case([&](ConstantOp op) { return &op->getOpOperand(0); })
+      .Case([&](ConstantOp op) { return nullptr; })
       .Case([&](ExtractSliceOp op) { return &op->getOpOperand(0); })
       // In the case of scf::ForOp, this currently assumes the iter_args / yield
       // are 1-1. This may fail and is verified at the end.
@@ -580,6 +580,7 @@ static Optional<OpOperand *> getAliasingOpOperand(OpResult result) {
                                  op.getNumInputs() + result.getResultNumber());
       })
       .Case([&](vector::TransferWriteOp op) { return &op->getOpOperand(1); })
+      .Case([&](CallOpInterface op) { return nullptr; })
       .Default([&](Operation *op) {
         op->dump();
         llvm_unreachable("unexpected defining op");


        


More information about the Mlir-commits mailing list