summaryrefslogtreecommitdiff
path: root/flang/lib/Optimizer/CodeGen/LowerRepackArrays.cpp
AgeCommit message (Collapse)Author
2025-11-08[flang] Remove unused local variables (NFC) (#167105)Kazu Hirata
Identified with bugprone-unused-local-non-trivial-variable.
2025-07-24[mlir][NFC] update `flang/lib` create APIs (12/n) (#149914)Maksim Levental
See https://github.com/llvm/llvm-project/pull/147168 for more info.
2025-07-16[flang] Handle SEQUENCE derived types for array repacking. (#148777)Slava Zakharin
It is possible that a non-polymorphic dummy argument has a dynamic type that does not match its static type in a valid Fortran program, e.g. when the actual and the dummy arguments have different compatible derived SEQUENCE types: module mod type t sequence integer x end type contains subroutine test(x) type t sequence integer x end type type(t) :: x(:) end subroutine end module 'test' may be called with an actual argument of type 'mod::t', which is the dynamic type of 'x' on entry to 'test'. If we create the repacking temporary based on the static type of 'x' ('test::t'), then the runtime will report the types mismatch as an error. Thus, we have to create the temporary using the dynamic type of 'x'. The fact that the dummy's type has SEQUENCE or BIND attribute is not easily computable at this stage, so we use the dynamic type for all derived type cases. As long as this is done only when the repacking actually happens, the overhead should not be noticeable.
2025-07-14[flang][acc][nfc] Move FIROpenACCSupport to Support subfolder (#148710)Razvan Lupusoru
In order to prepare for adding FIROpenACCTransforms, move the FIR OpenACC support library to its own subfolder.
2025-06-19[flang] Set low probability for array repacking code. (#144830)Slava Zakharin
This allows LLVM to place the most probably cold blocks that do the repacking out of the line of the potentially hot code.
2025-06-06[flang][hlfir] do not propagate polymorphic temporary as allocatables (#142609)jeanPerier
Polymorphic temporary are currently propagated as fir.ref<fir.class<fir.heap<>>> because their allocation may be delayed to the hlfir.assign copy (using realloc). This patch moves away from this and directly allocate the temp and propagate it as a fir.class. The polymorphic temporaries creating is also simplified by avoiding the need to call the runtime to setup the descriptor altogether (the runtime is still call for the allocation currently because alloca/allocmem do not support polymorphism).
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-10[flang] Defined SafeTempArrayCopyAttrInterface for array repacking. (#134346)Slava Zakharin
This patch defines `fir::SafeTempArrayCopyAttrInterface` and the corresponding OpenACC/OpenMP related attributes in FIR dialect. The actual implementations are just placeholders right now, and array repacking becomes a no-op if `-fopenacc/-fopenmp` is used for the compilation.
2025-03-31[flang] Code generation for fir.pack/unpack_array. (#132080)Slava Zakharin
The code generation relies on `ShallowCopyDirect` runtime to copy data between the original and the temporary arrays (both directions). The allocations are done by the compiler generated code. The heap allocations could have been passed to `ShallowCopy` runtime, but I decided to expose the allocations so that the temporary descriptor passed to `ShallowCopyDirect` has `nocapture` - maybe this will be better for LLVM optimizations.