[flang-commits] [flang] [Flang][OpenACC][OpenMP] Always add extent to acc/omp.BoundsOp (PR #73790)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Wed Nov 29 08:39:07 PST 2023


================
@@ -57,11 +61,12 @@ end subroutine assumed_shape_array
 
 !ALL-LABEL:   func.func @_QMassumed_array_routinesPassumed_size_array(
 !ALL-SAME: %[[ARG0:.*]]: !fir.ref<!fir.array<?xi32>> {fir.bindc_name = "arr_read_write"})
+!ALL: %[[UNDEF:.*]] = fir.undefined index
 !ALL: %[[ALLOCA:.*]] = fir.alloca i32 {bindc_name = "i", uniq_name = "_QMassumed_array_routinesFassumed_size_arrayEi"}
 !ALL: %[[C0:.*]] = arith.constant 1 : index
 !ALL: %[[C1:.*]] = arith.constant 1 : index
 !ALL: %[[C2:.*]] = arith.constant 4 : index
-!ALL: %[[BOUNDS:.*]]  = omp.bounds   lower_bound(%[[C1]] : index) upper_bound(%[[C2]] : index) stride(%[[C0]] : index) start_idx(%[[C0]] : index)
+!ALL: %[[BOUNDS:.*]]  = omp.bounds   lower_bound(%[[C1]] : index) upper_bound(%[[C2]] : index) extent(%[[UNDEF]] : index) stride(%[[C0]] : index) start_idx(%[[C0]] : index)
----------------
clementval wrote:

This seems risky to have undef in the extent. Wouldn't it be better to not generate the extent if it is coming from a `fir.undefined`?

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


More information about the flang-commits mailing list