[Mlir-commits] [mlir] e300682 - [mlir][scf][bufferize] Update verifyAnalysis error message

Matthias Springer llvmlistbot at llvm.org
Thu May 5 00:57:32 PDT 2022


Author: Matthias Springer
Date: 2022-05-05T16:56:50+09:00
New Revision: e300682597470ffc88b59a6187cdd763f1595d3a

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

LOG: [mlir][scf][bufferize] Update verifyAnalysis error message

The previous error message was technically incorrect. We do not compare equivalence of YieldOp operands and ForOp operands.

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

Added: 
    

Modified: 
    mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
    mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize-invalid.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
index 7dade29cc32d0..b6d2001403bd1 100644
--- a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
@@ -539,8 +539,7 @@ struct ForOpInterface
       if (bufferRelation(op, opResult, state) != BufferRelation::Equivalent)
         return yieldOp->emitError()
                << "Yield operand #" << opResult.getResultNumber()
-               << " does not bufferize to a buffer that is aliasing the "
-                  "matching enclosing scf::for operand";
+               << " is not equivalent to the corresponding iter bbArg";
     }
 
     return success();

diff  --git a/mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize-invalid.mlir b/mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize-invalid.mlir
index 8c412f728ab07..d92eaff1b2522 100644
--- a/mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize-invalid.mlir
+++ b/mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize-invalid.mlir
@@ -99,7 +99,7 @@ func.func @scf_for(%A : tensor<?xf32>,
     // Throw a wrench in the system by swapping yielded values: this result in a
     // ping-pong of values at each iteration on which we currently want to fail.
 
-    // expected-error @+1 {{Yield operand #0 does not bufferize to a buffer that is aliasing}}
+    // expected-error @+1 {{Yield operand #0 is not equivalent to the corresponding iter bbArg}}
     scf.yield %ttB, %ttA : tensor<?xf32>, tensor<?xf32>
   }
 
@@ -122,7 +122,7 @@ func.func @scf_yield_needs_copy(%A : tensor<?xf32> {bufferization.writable = tru
   %c1 = arith.constant 1 : index
   %res = scf.for %arg0 = %c0 to %iters step %c1 iter_args(%bbarg = %A) -> (tensor<?xf32>) {
     %r = func.call @foo(%A) : (tensor<?xf32>) -> (tensor<?xf32>)
-    // expected-error @+1 {{Yield operand #0 does not bufferize to a buffer that is aliasing}}
+    // expected-error @+1 {{Yield operand #0 is not equivalent to the corresponding iter bbArg}}
     scf.yield %r : tensor<?xf32>
   }
   call @fun_with_side_effects(%res) : (tensor<?xf32>) -> ()


        


More information about the Mlir-commits mailing list