[Xtensa] Support 'f' Inline Assembly Constraint (#202345)
This adds the 'f' inline assembly constraint, as supported by GCC. An
'f'-constrained operand is passed in a floating point register.
[Clang] Don't print extra whitespace for comma expression in StmtPrinter (#210920)
For binary expression `1, 2`, StmtPrinter used to print it as `1 , 2`
which doesn't look very pretty.
[X86] Synchronise middle and backend test coverage for ADDSUBPS/PD patterns (#210919)
Use the same test names wherever possible and ensure sse3-avx-addsub.ll
has test coverage for the IR emitted by the middle-end (no matter how
poor it is)
Prep work for #144489 (sse3-avx-addsub-2.ll will be deleted along with
lowerToAddSubOrFMAddSub)
[lldb][docs] Add platform/target support requirements doc (#207166)
This is a very delayed follow up to:
https://discourse.llvm.org/t/rfc-surveying-lldbs-supported-platforms-and-architectures/83978
Where I realised that even for upstream supported targets, the level of
testing and attention they get varies a lot. Which I think is not a bad
thing, because LLDB would be much more chaotic if it were a bad thing.
The problem I see is that no one really knows how to start writing
proposals for new targets, and no one really knows how to properly
assess one.
Me included, but what I can do is write out some starting points for
both parties. Hopefully this makes the process a bit more fair for those
not used to writing RFCs.
(and if we want to make the rules more strict, we will now have a place
[22 lines not shown]
[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).
[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.
[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.
[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
[4 lines not shown]
[SelectionDAG] Merge consecutive loads feeding as shuffle operands (#207303)
Perform the following fold given loadA and loadB can be proven
consecutive:
```
concat(shuffle(loadA, loadB, mask0), shuffle(loadA, loadB, mask1))
-> shuffle(loadAB, poison, concat(mask0, mask1))
```
[DTLTO] Overlap temporary file removal (#209423)
Deleting the temporary files produced by the DTLTO pipeline can be
expensive on Windows hosts. For a Clang link (Debug build with
sanitizers and instrumentation) using an optimized toolchain (PGO
non-LTO, llvmorg-22.1.0) on a Windows 11 Pro (Build 26200), AMD Family
25 @ ~4.5 GHz, 16 cores/32 threads, 64 GB RAM machine, the mean duration
of the "Remove DTLTO temporary files" time trace scope was 1267.789 ms
(measured over 10 runs).
This patch performs the deletions on a background thread, allowing them
to overlap with the tail of the link to hide this cost.
This is a re-implementation of the asynchronous cleanup idea from
https://github.com/llvm/llvm-project/pull/186988, which had to be
reverted in https://github.com/llvm/llvm-project/pull/189043 because
cleanup was not guaranteed to complete before LLD invoked
timeTraceProfilerCleanup(). In certain cases timeTraceProfilerCleanup()
was called before temporary file deletion had completed in LLD, which
[8 lines not shown]
[MLIR] Rerun control for actions in execution context (#209197)
Adds a Rerun control value to ExecutionContext::Control that allows the
re-execution of the current action immediately after it completes,
without restarting the full compilation pipeline. This is analogous to
GDB's ability to restart execution from a breakpoint. When the callback
returns Rerun, the action is executed normally, then re-dispatched
through the full ExecutionContext::operator() pipeline, including
breakpoint matching, so the user gets a fresh opportunity to inspect or
control the re-execution. As a practical usage example, a breakpoint +
an observer can be added, to save and restore IR between runs to check
if each run produces the same IR or something different each time. A
depth-keyed structure is used, so rerun requests survive nested action
dispatch and are consumed by the correct stack frame.
[Clang][Sema] Fix crash on lambda parameter pack with illegal default argument (#210718)
`Sema::ActOnParamDefaultArgument` checked a default-argument expression
for unexpanded parameter packs before checking whether the parameter
itself is a pack. For a lambda parameter pack given a default argument
that is a pack expansion referencing an enclosing function's parameter
pack (e.g. `[](Types... = args...) {}`), the first check runs while
still inside the lambda's scope and sets
`LambdaScopeInfo::ContainsUnexpandedParameterPack` (a mechanism meant
for legitimate outer-pack references). The subsequent
`isParameterPack()` check then correctly diagnoses the real error and
discards the default argument, but the stale flag survives into the
built `LambdaExpr`'s dependence bits. A later unexpanded-pack check on
that `LambdaExpr` finds nothing to report and hits
`assert(!Unexpanded.empty() || LambdaReferencingOuterPacks)`, aborting
instead of just diagnosing the error.
Fix: check `Param->isParameterPack()` first and return immediately after
discarding the default argument, before ever calling
[5 lines not shown]
[RegisterCoalescer] Avoid retrying high-cost joins for live intervals (#207976)
Recently we found a compile time problem in the case that contains much
high-cost live
interval. And normal interference failures still set `Again=true` and
can be retried
(it cost N^2 complexity). We tracks when a join failed only because of
the high-cost
guard, so that avoids putting such copies back into the retry worklist.
This reduce our huge function case from 14.6h to 12.8min in register
coalescer pass.
[OFFLOAD][L0] Fix PatternSize assert in L0QueueTy::memoryFill (#210867)
The message was the opposite of the assert condition.
In addition, when PatternSize == Size the caller wants to fill the
region with exactly one copy of the pattern, which is a valid operation.
The issue was found by AI.
Also check `Size % PatternSize == 0` per L0 spec.
[GVN] Remove unused debug helper (NFC)
The `GVNPass::dump` method is not used anywhere. Moreover, there's
no `GVNPass` state that corresponds to its parameter type. Even if a
`GVNPass::dump` method could be useful, this one wasn't it.
RuntimeLibcalls: Emit all available impls for a libcall, not just one
The intent is RuntimeLibcalls should represent all functions that are
callable from the module, which may have contextually selectable alternatives.
Previously we had this warning since there was no mechanism to select which
one you want, and as a workaround the library call sets avoided adding the
variants which should nto be selected.
Now targets can use initLibcallLoweringInfo, so remove the warning to unblock
more libcall cleanups. Eventually initLibcallLoweringInfo should also be tablegen
driven.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[Clang] Add NormalizedConstraint::dump() (#210498)
This facilitates debugging with concepts, particularly when we need to
check complex parameter mappings.
Since this is mainly for debugging purpose, we don't promise any text
stability and hence no tests provided.
[compiler-rt][test] Skip page-size feature detection under emulators. (#210683)
This avoids adding a page-size-* lit feature when compiler-rt tests are
configured to run through an emulator.
Perviously this used to work because failure to detect the page size
would fall back to 4096. Now after this change
https://github.com/llvm/llvm-project/pull/209175, the code tries to
execute config.python_executable through the emulator. For
emulator-based test configurations, this is inappropriate. The function
now returns None when an emulator is configured, and the lit feature is
only added when a concrete page size is available.
[analyzer] Fix false positive when a lifetimebound method is called during destruction (#210801)
When a `lifetimebound` method is called during destruction the checker
emits warnings which leads to false positives. To avoid this a dangling
stack source is not reported if any frame on the current stack belongs
to a destructor.
PPC: Remove manual run of machine verifier (#208032)
This is redundant with using the standard -verify-machineinstrs.
It's also confusing / worse, since the error is not produced to
stderr.
[CycleInfo] Store entries in the block layout. NFC (#210866)
A reducible loop has a single entry (header), which flatten() places at
BlockLayout[IdxBegin], as its minimum-preorder block. A reducible loop
then needs no storage at all.
For the uncommon irreducible loop case, we append its full entry list
(header first) after the Euler tour, referenced by [EntryBegin,
EntryBegin+EntrySize), making `GenericCycleInfo::Cycle` (named only
because "loop" is occupied by LoopInfo) trivially destructible.
RuntimeLibcalls: Add sqrtf to the Hexagon runtime libcall set
The library definitions go out of the way to avoid adding sqrtf, in favor
of __hexagon_sqrtf. I'm assuming that libm does provide sqrtf, it just
happens that there is a more-preferred function to use. RuntimeLibcallsInfo
should express the full set of functions that do exist, and LibcallLoweringInfo
should express the preference for which calls should be used.
By the current ordering rules, it just so happens __hexagon_sqrtf will win out
for SQRT_F32. Add this to avoid a special case to faciliate future libcall
improvements.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[clang][Parser] Warn when the body of expansion statement is not a compound statement (#209229)
<https://eel.is/c++draft/stmt.expand#nt:expansion-statement>:
_expansion-statement_:
template for ( _init-statement<sub>opt</sub>_ _for-range-declaration_ :
_expansion-initializer_ ) _compound-statement_