forked from OSchip/llvm-project
[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:
parent
6d09aaecdf
commit
51ae78a6d6
|
@ -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(),
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue