24 lines · plain
1// RUN: mlir-opt %s -pass-pipeline='builtin.module(func.func(affine-loop-fusion{maximal mode=sibling}))' | FileCheck %s2 3// Test cases specifically for sibling fusion. Note that sibling fusion test4// cases also exist in loop-fusion*.mlir.5 6// CHECK-LABEL: func @disjoint_stores7func.func @disjoint_stores(%0: memref<8xf32>) {8 %alloc_1 = memref.alloc() : memref<16xf32>9 // The affine stores below are to different parts of the memrefs. Sibling10 // fusion helps improve reuse and is valid.11 affine.for %arg2 = 0 to 8 {12 %2 = affine.load %0[%arg2] : memref<8xf32>13 affine.store %2, %alloc_1[%arg2] : memref<16xf32>14 }15 affine.for %arg2 = 0 to 8 {16 %2 = affine.load %0[%arg2] : memref<8xf32>17 %3 = arith.negf %2 : f3218 affine.store %3, %alloc_1[%arg2 + 8] : memref<16xf32>19 }20 // CHECK: affine.for21 // CHECK-NOT: affine.for22 return23}24