[qt/clang/llvm-project]: Summary of bulk changes made
KDE Git Services - Bulk Change <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git repository change summary for qt/clang/llvm-project
Pushed by mirror-service into branch 'upstream/users/jeanPerier/merge_memory_passes_5'.
Changed from 0000000000000000000000000000000000000000 to 4c16c1bb82d8e99d954944cf613fc0b824250fe0
Acknowledgement was received that this change introduces only existing code that has been pushed to another public open source repository.
This change contains the following new commits:
Git commit baf2adb8b8ed72b25ddd784d25d47b5b1c36e7bd by Jean Perier (on behalf of root) on 21/07/2026 at 10:12..
[flang] Add policy-driven allocation-placement pass
Introduce a new function-level pass, allocation-placement, that unifies the
stack/heap placement decisions currently split between the stack-arrays and
memory-allocation-opt passes. For each array allocation it consults a policy
to decide whether it should live on the stack (fir.alloca) or the heap
(fir.allocmem) and rewrites it accordingly, reusing fir::replaceAllocas for
stack-to-heap and the StackArrays analysis/rewrite for heap-to-stack (so
heap-to-stack only happens where it is provably safe).
The default policy (AllocationPlacementPolicy.h) is threshold-driven:
- small constant-size arrays go on the stack within a per-function stack
budget, otherwise on the heap;
- big constant-size arrays: user variables stay on the stack, temporaries
go on the heap;
- runtime-sized arrays go on the heap;
- an aggressive mode places all arrays on the stack (best effort).
User variables are distinguished from compiler temporaries via the presence
of a uniqued name. A hook lets downstream users override the thresholds per
allocation (e.g. for device routines or parallel regions).
The pass is not wired into any pipeline yet; it is reachable through fir-opt
and covered by isolated tests.
https://invent.kde.org/qt/clang/llvm-project/-/commit/baf2adb8b8ed72b25ddd784d25d47b5b1c36e7bd
Git commit 11640c8923e02979ef511199c620e4a2f748898e by Jean Perier (on behalf of root) on 21/07/2026 at 10:12..
[flang] Wire allocation-placement into the optimizer pipeline (experimental)
Add a hidden -enable-allocation-placement flag that, when set, replaces the
stack-arrays and memory-allocation-opt passes in the default FIR optimizer
pipeline with the unified allocation-placement pass. The flag is off by
default, so the legacy passes remain the default path and behavior is
unchanged.
When enabled, the pass runs with its default byte-size thresholds; the
-fstack-arrays strategy is forwarded through the new stackArrays option.
https://invent.kde.org/qt/clang/llvm-project/-/commit/11640c8923e02979ef511199c620e4a2f748898e
Git commit cbf4a631fdbc5e2e44a8bffeec513065b372f2cc by Jean Perier on 21/07/2026 at 10:12..
[flang] Enable allocation-placement pass by default
Make the unified allocation-placement pass the default in the FIR optimizer
pipeline in place of the legacy stack-arrays and memory-allocation-opt passes,
by defaulting -enable-allocation-placement to true. Passing
-enable-allocation-placement=false restores the legacy passes for comparison.
Add a -disable-allocation-placement switch that skips the pass entirely (wired
through addAllocationPlacement like the other optimizer passes), so codegen
tests can opt out of placement policy independently of the legacy fallback.
Update the pipeline-dump tests to expect AllocationPlacement, and disable the
pass in the alloca/allocmem codegen tests (alloc.fir, coordinateof.fir) so they
keep testing lowering rather than placement policy. Document the unified pass,
its policy, thresholds, and options in fstack-arrays.md.
https://invent.kde.org/qt/clang/llvm-project/-/commit/cbf4a631fdbc5e2e44a8bffeec513065b372f2cc
Git commit 4c16c1bb82d8e99d954944cf613fc0b824250fe0 by Jean Perier (on behalf of root) on 21/07/2026 at 10:12..
[flang] Remove legacy stack-arrays and memory-allocation-opt passes
The unified allocation-placement pass now supersedes both the heap-to-stack
stack-arrays pass and the stack-to-heap memory-allocation-opt pass, and is the
default in the FIR optimizer pipeline. Remove the two legacy passes: their
TableGen definitions, the MemoryAllocation.cpp source, the memory-allocation-opt
command-line options, the enable-allocation-placement fallback switch, and the
addMemoryAllocationOpt pipeline helper. The pass-only portions of
StackArrays.cpp are dropped while its analysis and rewrite pattern, now shared
with allocation-placement, are kept.
The legacy tests are retargeted onto allocation-placement to show it reproduces
both prior behaviors: the stack-arrays tests use "stack-arrays=true", and the
memory-allocation-opt tests use the default policy (runtime-sized and big
constant-size temporaries go on the heap).
https://invent.kde.org/qt/clang/llvm-project/-/commit/4c16c1bb82d8e99d954944cf613fc0b824250fe0