[Mlir-commits] [mlir] [mlir] Fix liveness analysis (PR #88848)

Mehdi Amini llvmlistbot at llvm.org
Mon May 13 08:13:44 PDT 2024


================
@@ -493,3 +493,68 @@ func.func @nested_region3(
   }
   return %1 : i32
 }
+
+// -----
+
+// CHECK-LABEL: Testing : nested_region4
+
+func.func @nested_region4(%arg0: index, %arg1: index, %arg2: index) {
+  // CHECK: Block: 0
+  // CHECK-NEXT: LiveIn:{{ *$}}
+  // CHECK-NEXT: LiveOut:{{ *$}}
+
+  // CHECK-NEXT: BeginLivenessIntervals
+  // CHECK-NEXT: [[VAL3:[a-z0-9_]+]]{{ *:}}
+  // CHECK-NEXT: %{{.*}} = arith.constant 0
+  // CHECK-NEXT: %{{.*}} = arith.constant 1
+  // CHECK-NEXT: %{{.*}} = scf.for
+  // COM:         Skipping the body of the scf.for...
+  // CHECK:      }
+
+  // CHECK-NEXT: [[VAL4:[a-z0-9_]+]]{{ *:}}
+  // CHECK-NEXT: %{{.*}} = arith.constant 1
+  // CHECK-NEXT: %{{.*}} = scf.for
+  // COM:         Skipping the body of the scf.for...
+  // CHECK:      }
+  // CHECK-NEXT: %{{.*}} = arith.addi %{{.*}}, %{{.*}} : {{[a-z0-9]}}
+
+  // CHECK-NEXT: [[VAL5:[a-z0-9_]+]]{{ *:}}
+  // CHECK-NEXT: %{{.*}} = scf.for
+  // COM:         Skipping the body of the scf.for...
+  // CHECK:      }
+  // CHECK-NEXT: EndLivenessIntervals
+
+  // CHECK-NEXT: BeginCurrentlyLive
+  // CHECK-NEXT: %{{.*}} = arith.constant 0
+  // CHECK-SAME: arg0 at 0 arg1 at 0 arg2 at 0 [[VAL3]]
+  // CHECK-NEXT: %{{.*}} = arith.constant 1
+  // CHECK-SAME: arg0 at 0 arg1 at 0 arg2 at 0 [[VAL3]] [[VAL4]]
+  // CHECK-NEXT: %{{.*}} = scf.for
+  // COM:          Skipping the body of the scf.for...
+  // CHECK:      }
+  // CHECK-SAME: arg0 at 0 arg1 at 0 arg2 at 0 [[VAL3]] [[VAL4]] [[VAL5]]
+  // CHECK-NEXT: EndCurrentlyLive
----------------
joker-eph wrote:

Is any of the above needed to show the fix? Wouldn't just the check on the body of the for below be enough?

https://github.com/llvm/llvm-project/pull/88848


More information about the Mlir-commits mailing list