[MLIR][Affine][NFC] affine.store op verifier message fix and check

Fix typo in affine.store op verifier message and test case.

Differential Revision: https://reviews.llvm.org/D113360
This commit is contained in:
Uday Bondhugula 2021-11-07 09:34:27 +05:30
parent 6d09aaecdf
commit 51ae78a6d6
2 changed files with 11 additions and 2 deletions

View File

@ -2384,11 +2384,11 @@ static void print(OpAsmPrinter &p, AffineStoreOp op) {
}
LogicalResult verify(AffineStoreOp op) {
// First operand must have same type as memref element type.
// The value to store must have the same type as memref element type.
auto memrefType = op.getMemRefType();
if (op.getValueToStore().getType() != memrefType.getElementType())
return op.emitOpError(
"first operand must have same type memref element type");
"value to store must have the same type as memref element type");
if (failed(verifyMemoryOpIndexing(
op.getOperation(),

View File

@ -142,6 +142,15 @@ func @affine_store_missing_l_square(%C: memref<4096x4096xf32>) {
// -----
func @affine_store_wrong_value_type(%C: memref<f32>) {
%c0 = arith.constant 0 : i32
// expected-error@+1 {{value to store must have the same type as memref element type}}
"affine.store"(%c0, %C) : (i32, memref<f32>) -> ()
return
}
// -----
func @affine_min(%arg0 : index, %arg1 : index, %arg2 : index) {
// expected-error@+1 {{operand count and affine map dimension and symbol count must match}}
%0 = affine.min affine_map<(d0) -> (d0)> (%arg0, %arg1)