summaryrefslogtreecommitdiff
path: root/flang/lib/Lower/Support/ReductionProcessor.cpp
AgeCommit message (Collapse)Author
2025-07-23[flang][OpenMP] Restore reduction processor behavior broken by #145837 (#150178)Kareem Ergawy
Fixes #149089 and #149700. Before #145837, when processing a reduction symbol not yet supported by OpenMP lowering, the reduction processor would simply skip filling in the reduction symbols and variables. With #145837, this behvaior was slightly changed because the reduction symbols are populated before invoking the reduction processor (this is more convenient to shared the code with `do concurrent`). This PR restores the previous behavior.
2025-07-21[mlir][NFC] update `flang/Lower` create APIs (8/n) (#149912)Maksim Levental
See https://github.com/llvm/llvm-project/pull/147168 for more info.
2025-07-14[flang][Lower] fix warning (#148667)Tom Eccles
GCC 9.3.0 ``` .../flang/lib/Lower/Support/ReductionProcessor.cpp:137:1: error: control reaches end of non-void function [-Werror=return-type] ```
2025-07-14[flang] Support `do concurrent ... reduce` for associating names (#148597)Kareem Ergawy
Extends reduction support for `do concurrent`, in particular, for associating names. Consider the following input: ```fortran subroutine dc_associate_reduce integer :: i real, allocatable, dimension(:) :: x associate(x_associate => x) do concurrent (i = 1:10) reduce(+: x_associate) end do end associate end subroutine ``` The declaration of `x_associate` is emitted as follows: ```mlir %13:2 = hlfir.declare %10(%12) {uniq_name = "...."} : (!fir.heap<!fir.array<?xf32>>, !fir.shapeshift<1>) -> (!fir.box<!fir.array<?xf32>>, !fir.heap<!fir.array<?xf32>>) ``` where the HLFIR base type is an array descriptor (i.e. the allocatable/heap attribute is dropped as stipulated by the spec; section 11.1.3.3). The problem here is that `declare_reduction` ops accept only reference types. This restriction is already partially handled for `fir::BaseBoxType`'s by allocating a stack slot for the descriptor and storing the box in that stack allocation. We have to modify this a littble bit for `associate` since the HLFIR and FIR base types are different (unlike most scenarios).
2025-07-11[flang][do concurrent] Extned `getAllocaBlock()` and emit yields correctly ↵Kareem Ergawy
(#146853) Handles some loose ends in `do concurrent` reduction declarations. This PR extends `getAllocaBlock` to handle declare ops, and also emit `fir.yield` in all regions.
2025-07-11[NFC][flang] Move `ReductionProcessor` to `Lower/Support`. (#146025)Kareem Ergawy
With #145837, the `ReductionProcessor` component is now used by both OpenMP and `do concurrent`. Therefore, this PR moves it to a shared location: `flang/Lower/Support`. PR stack: - https://github.com/llvm/llvm-project/pull/145837 - https://github.com/llvm/llvm-project/pull/146025 (this one) - https://github.com/llvm/llvm-project/pull/146028 - https://github.com/llvm/llvm-project/pull/146033