28 lines · plain
1// RUN: mlir-query %s -c "m getUsersByPredicate(anyOf(hasOpName(\"memref.alloc\"),isConstantOp()),anyOf(hasOpName(\"affine.load\"), hasOpName(\"memref.dealloc\")),true)" | FileCheck %s2 3func.func @slice_depth1_loop_nest_with_offsets() {4 %0 = memref.alloc() : memref<100xf32>5 %cst = arith.constant 7.000000e+00 : f326 affine.for %i0 = 0 to 16 {7 %a0 = affine.apply affine_map<(d0) -> (d0 + 2)>(%i0)8 affine.store %cst, %0[%a0] : memref<100xf32>9 }10 affine.for %i1 = 4 to 8 {11 %a1 = affine.apply affine_map<(d0) -> (d0 - 1)>(%i1)12 %1 = affine.load %0[%a1] : memref<100xf32>13 }14 return15}16 17// CHECK: Match #1:18// CHECK: {{.*}}.mlir:4:8: note: "root" binds here19// CHECK: %[[ALLOC:.*]] = memref.alloc() : memref<100xf32>20 21// CHECK: affine.store %cst, %0[%a0] : memref<100xf32>22 23// CHECK: Match #2:24// CHECK: {{.*}}.mlir:5:10: note: "root" binds here25// CHECK: %[[CST:.*]] = arith.constant 7.000000e+00 : f3226 27// CHECK: affine.store %[[CST]], %0[%a0] : memref<100xf32>28