summaryrefslogtreecommitdiff
path: root/flang/lib/Optimizer/Transforms/SimplifyFIROperations.cpp
AgeCommit message (Collapse)Author
2025-08-26[flang][do concurrent] Use values yielded by `local init` regions (#155223)Kareem Ergawy
Similar to what is done for OpenMP `private` clauses, prefer the value yielded from the init region to the allocated private variable in case the region is operating on arguments by-value (e.g. Fortran character boxes). This changes provides the same results as https://github.com/llvm/llvm-project/pull/154303 in both the LLVM and Fujitsu test suites (so no regressions). ``` Testing Time: 7216.26s Passed : 88522 Failed : 160 Executable Missing: 408 ```
2025-07-21[mlir][NFC] update `flang/Optimizer/Transforms` create APIs (11/n) (#149915)Maksim Levental
See https://github.com/llvm/llvm-project/pull/147168 for more info.
2025-07-18[flang] Migrate away from ArrayRef(std::nullopt_t) (#149454)Kazu Hirata
ArrayRef(std::nullopt_t) has been deprecated. This patch replaces std::nullopt with mlir::TypeRange{} or mlir::ValueRange{} as appropriate.
2025-07-11[flang][do concurrent] Re-model `reduce` to match reductions are modelled in ↵Kareem Ergawy
OpenMP and OpenACC (#145837) This PR proposes re-modelling `reduce` specifiers to match OpenMP and OpenACC. In particular, this PR includes the following: * A new `fir` op: `fir.delcare_reduction` which is identical to OpenMP's `omp.declare_reduction` op. * Updating the `reduce` clause on `fir.do_concurrent.loop` to use the new op. * Re-uses the `ReductionProcessor` component to emit reductions for `do concurrent` just like we do for OpenMP. To do this, the `ReductionProcessor` had to be refactored to be more generalized. * Upates mapping `do concurrent` to `fir.loop ... unordered` nests using the new reduction model. Unfortunately, this is a big PR that would be difficult to divide up in smaller parts because the bottom of the changes are the `fir` table-gen changes to `do concurrent`. However, doing these MLIR changes cascades to the other parts that have to be modified to not break things. This PR goes in the same direction we went for `private/local` speicifiers. Now the `do concurrent` and OpenMP (and OpenACC) dialects are modelled in essentially the same way which makes mapping between them more trivial, hopefully. PR stack: - https://github.com/llvm/llvm-project/pull/145837 (this one) - https://github.com/llvm/llvm-project/pull/146025 - https://github.com/llvm/llvm-project/pull/146028 - https://github.com/llvm/llvm-project/pull/146033
2025-06-13[flang][fir] Extend locality specs lowering to support `init` and `dealloc` ↵Kareem Ergawy
regions (#144027) Extending `fir.do_concurrent` to `fir.do_loop ... unordered` lowering by adding support for lowring/inlining non-empty `init` and `dealloc` regions. Resolves https://github.com/llvm/llvm-project/issues/143897 (actually handles the todo).
2025-05-09[flang][fir] Basic lowering `fir.do_concurrent` locality specs to ↵Kareem Ergawy
`fir.do_loop ... unordered` (#138512) Extends lowering `fir.do_concurrent` to `fir.do_loop ... unordered` by adding support for locality specifiers. In particular, for `local` specifiers, a `fir.alloca` op is created using the localizer type. For `local_init` specifiers, the `copy` region is additionally inlined in the `do concurrent` loop's body. PR stack: - https://github.com/llvm/llvm-project/pull/137928 - https://github.com/llvm/llvm-project/pull/138505 - https://github.com/llvm/llvm-project/pull/138506 - https://github.com/llvm/llvm-project/pull/138512 (this PR) - https://github.com/llvm/llvm-project/pull/138534 - https://github.com/llvm/llvm-project/pull/138816
2025-04-24[mlir] add a fluent API to GreedyRewriterConfig (#137122)Oleksandr "Alex" Zinenko
This is similar to other configuration objects used across MLIR. Rename some fields to better reflect that they are no longer booleans. Reland 04d261101b4f229189463136a794e3e362a793af / #132253.
2025-04-18Revert "[mlir] add a fluent API to GreedyRewriterConfig (#132253)"Kazu Hirata
This reverts commit 63b8f1c9482ed0a964980df4aed89bef922b8078. Buildbot failure: https://lab.llvm.org/buildbot/#/builders/172/builds/12083/steps/5/logs/stdio I've reproduced the error with a release build (-DCMAKE_BUILD_TYPE=Release).
2025-04-18[mlir] add a fluent API to GreedyRewriterConfig (#132253)Oleksandr "Alex" Zinenko
This is similar to other configuration objects used across MLIR.
2025-04-01[flang] Inline fir.is_contiguous_box in some cases. (#133812)Slava Zakharin
Added inlining for `rank == 1` and `innermost` cases.
2025-03-24[flang][fir] Add rewrite pattern to convert `fir.do_concurrent` to ↵Kareem Ergawy
`fir.do_loop` (#132207) Rewrites `fir.do_concurrent` ops to a corresponding nest of `fir.do_loop ... unordered` ops.
2025-03-14[flang] Added fir.is_contiguous_box and fir.box_total_elements ops. (#131047)Slava Zakharin
These are helper operations to aid with expanding of fir.pack_array.