[flang-commits] [flang] [mlir] [flang][OpenMP] Allow saving first block of an OMP region for allocas (PR #121886)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Tue Jan 7 02:20:47 PST 2025
================
@@ -78,27 +78,31 @@ llvm.func @sectionsreduction_(%arg0: !llvm.ptr {fir.bindc_name = "x"}) attribute
// CHECK-LABEL: define internal void @sectionsreduction_..omp_par
// CHECK: omp.par.entry:
-// CHECK: %[[VAL_6:.*]] = alloca i32, align 4
-// CHECK: %[[VAL_7:.*]] = alloca i32, align 4
-// CHECK: %[[VAL_8:.*]] = alloca i32, align 4
-// CHECK: %[[VAL_9:.*]] = alloca i32, align 4
// CHECK: %[[VAL_10:.*]] = alloca i32, align 4
// CHECK: %[[VAL_11:.*]] = load i32, ptr %[[VAL_12:.*]], align 4
// CHECK: store i32 %[[VAL_11]], ptr %[[VAL_10]], align 4
// CHECK: %[[VAL_13:.*]] = load i32, ptr %[[VAL_10]], align 4
+// CHECK: br label %omp.par.region
+
+// CHECK: omp.par.region:
+// CHECK: %[[VAL_6:.*]] = alloca i32, align 4
+// CHECK: %[[VAL_7:.*]] = alloca i32, align 4
+// CHECK: %[[VAL_8:.*]] = alloca i32, align 4
+// CHECK: %[[VAL_9:.*]] = alloca i32, align 4
+// CHECK: %[[VAL_19:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, i64 1, align 8
----------------
tblah wrote:
It is a very minor thing, but this for me is a bit of a regression. Ideally I would like to see all allocas at the start of the first block of the function. We were already not achieving that so this doesn't matter too much, but it would have been nice if this patch moved us further in the right direction.
https://github.com/llvm/llvm-project/pull/121886
More information about the flang-commits
mailing list