[Mlir-commits] [mlir] 1742882 - [mlir][bufferize] Fix typo in EmptyTensorElimination

Matthias Springer llvmlistbot at llvm.org
Mon Dec 12 05:31:45 PST 2022


Author: Matthias Springer
Date: 2022-12-12T14:31:38+01:00
New Revision: 1742882a3496f5a96eb67f665d9c622633f3ae3c

URL: https://github.com/llvm/llvm-project/commit/1742882a3496f5a96eb67f665d9c622633f3ae3c
DIFF: https://github.com/llvm/llvm-project/commit/1742882a3496f5a96eb67f665d9c622633f3ae3c.diff

LOG: [mlir][bufferize] Fix typo in EmptyTensorElimination

The structure of the code has changed a while ago and the code was not updated properly.

There is no test case for this because we do currently not have an op
that could trigger this bug.

Reviewed By: nicolasvasilache

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

Added: 
    

Modified: 
    mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp b/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
index 7914ba2b0484..76dfa2079dbd 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
@@ -127,7 +127,7 @@ LogicalResult mlir::bufferization::eliminateEmptyTensors(
       // tensor::EmptyOp.
       if (maybeEmptyTensor.size() != 1 ||
           !maybeEmptyTensor.front().getDefiningOp<tensor::EmptyOp>())
-        return WalkResult::skip();
+        continue;
       Value emptyTensor = maybeEmptyTensor.front();
 
       // Replace only if the types match.
@@ -137,7 +137,7 @@ LogicalResult mlir::bufferization::eliminateEmptyTensors(
       // %2 = tensor.expand_shape %1 ...
       // %3 = tensor.insert_slice %2 into ...
       if (emptyTensor.getType() != operand.get().getType())
-        return WalkResult::skip();
+        continue;
 
       // Find a suitable insertion point.
       Operation *insertionPoint =


        


More information about the Mlir-commits mailing list