[Mlir-commits] [mlir] [mlir][memref] Add terminator check to prevent a crash (PR #141972)

Longsheng Mou llvmlistbot at llvm.org
Fri May 30 19:41:25 PDT 2025


================
@@ -855,6 +865,31 @@ func.func @scopeInline(%arg : memref<index>) {
 
 // -----
 
+// Ensure this case not crash.
+
+// CHECK-LABEL:   func.func @scope_merge_without_terminator() {
+// CHECK:           "test.region"() ({
+// CHECK:             memref.alloca_scope  {
+// CHECK:               %[[cnt:.*]] = "test.count"() : () -> index
+// CHECK:               %[[alloc:.*]] = memref.alloca(%[[cnt]]) : memref<?xi64>
+// CHECK:               "test.use"(%[[alloc]]) : (memref<?xi64>) -> ()
+// CHECK:             }
+// CHECK:           }) : () -> ()
+// CHECK:           return
+// CHECK:         }
----------------
CoTinker wrote:

done

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


More information about the Mlir-commits mailing list