Skip to content

Commit e300682

Browse files
[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
1 parent 417e1c7 commit e300682

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,7 @@ struct ForOpInterface
539539
if (bufferRelation(op, opResult, state) != BufferRelation::Equivalent)
540540
return yieldOp->emitError()
541541
<< "Yield operand #" << opResult.getResultNumber()
542-
<< " does not bufferize to a buffer that is aliasing the "
543-
"matching enclosing scf::for operand";
542+
<< " is not equivalent to the corresponding iter bbArg";
544543
}
545544

546545
return success();

mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize-invalid.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func.func @scf_for(%A : tensor<?xf32>,
9999
// Throw a wrench in the system by swapping yielded values: this result in a
100100
// ping-pong of values at each iteration on which we currently want to fail.
101101

102-
// expected-error @+1 {{Yield operand #0 does not bufferize to a buffer that is aliasing}}
102+
// expected-error @+1 {{Yield operand #0 is not equivalent to the corresponding iter bbArg}}
103103
scf.yield %ttB, %ttA : tensor<?xf32>, tensor<?xf32>
104104
}
105105

@@ -122,7 +122,7 @@ func.func @scf_yield_needs_copy(%A : tensor<?xf32> {bufferization.writable = tru
122122
%c1 = arith.constant 1 : index
123123
%res = scf.for %arg0 = %c0 to %iters step %c1 iter_args(%bbarg = %A) -> (tensor<?xf32>) {
124124
%r = func.call @foo(%A) : (tensor<?xf32>) -> (tensor<?xf32>)
125-
// expected-error @+1 {{Yield operand #0 does not bufferize to a buffer that is aliasing}}
125+
// expected-error @+1 {{Yield operand #0 is not equivalent to the corresponding iter bbArg}}
126126
scf.yield %r : tensor<?xf32>
127127
}
128128
call @fun_with_side_effects(%res) : (tensor<?xf32>) -> ()

0 commit comments

Comments
 (0)