[flang-commits] [flang] [mlir] [flang][OpenMP] Lower target in_reduction for host fallback (PR #199967)
Sairudra More via flang-commits
flang-commits at lists.llvm.org
Wed Jun 24 02:25:58 PDT 2026
================
@@ -436,7 +436,7 @@ module attributes {omp.is_target_device = true} {
omp.target allocate(%ref : !fir.ref<i32> -> %ref : !fir.ref<i32>)
depend(taskdependin -> %ref : !fir.ref<i32>)
device(%int : i32) if(%bool) thread_limit(%int : i32)
- in_reduction(@reduction %ref -> %arg0 : !fir.ref<i32>)
+ in_reduction(@reduction %ref : !fir.ref<i32>)
----------------
Saieiei wrote:
Added a matching `map_entries` entry for the `in_reduction` operand here, so the test now models the valid target shape.
For the verifier part, I kept the same limitation as discussed in the other thread: Flang can emit the `in_reduction` operand from result 0 of an `hlfir.declare`, while the `map.info var_ptr` uses result 1 of the same declare. Those are distinct SSA values at the OpenMP dialect verifier point and only collapse after FIR/LLVM lowering, so a dialect-level value-identity verifier would reject valid Flang IR. The pairing check therefore remains a translation-time diagnostic.
https://github.com/llvm/llvm-project/pull/199967
More information about the flang-commits
mailing list