[flang-commits] [flang] [flang][debug] Keep the bounds of variables in stack slots at -O0. (PR #229876)
Abid Qadeer via flang-commits
flang-commits at lists.llvm.org
Tue Oct 13 02:36:11 PDT 2026
================
@@ -3,20 +3,19 @@
!CHECK: warning: IF clause is not allowed on DO SIMD directive in OpenMP v4.5, try -fopenmp-version=50
-!CHECK: %[[A:[0-9]+]]:2 = hlfir.declare %{{.*}} uniq_name("_QFcompoundEa")
!CHECK: omp.wsloop {
!CHECK: omp.simd if(%true) linear(%[[V0:[0-9]+]]#0 : !fir.ref<i32> = %c1_i32_0 : i32) linear_var_types([i32]) {
!CHECK: omp.loop_nest (%arg2) : i32 = (%c1_i32) to (%{{[0-9]+}}) inclusive step (%c1_i32_0) {
!CHECK: hlfir.assign %arg2 to %[[V0]]#0 : i32, !fir.ref<i32>
!CHECK: %[[V1:[0-9]+]] = fir.load %[[V0]]#0 : !fir.ref<i32>
!CHECK: %[[V2:[0-9]+]] = fir.convert %[[V1]] : (i32) -> i64
-!CHECK: %[[V3:[0-9]+]] = hlfir.designate %[[A]]#0 (%[[V2]]) : (!fir.box<!fir.array<?xf32>>, i64) -> !fir.ref<f32>
+!CHECK: %[[V3:[0-9]+]] = hlfir.designate %10#0 (%[[V2]]) : (!fir.box<!fir.array<?xf32>>, i64) -> !fir.ref<f32>
----------------
abidh wrote:
The hardcoded %10#0 on that line is what is in main today. it was not added by this PR. Initial revision of this created the slot in lowering, which shifted the SSA numbering and made me renumber it here and in a few other tests. The slot is now created in AddDebugInfo instead, so the current revision does not modify this file, or any existing test. I agree the hardcoding is brittle and I'll clean it up in a separate PR.
https://github.com/llvm/llvm-project/pull/229876
More information about the flang-commits
mailing list