[ARM] Fix instruction sizes for PATCHABLE opcodes (#220949)
Report the size of the xray sled instead of zero.
Part of enabling instruction size verification by default.
[AArch64][GlobalISel] Add support for shuffle(v, undef) -> trn(v, v) transformation (#220914)
Stacked PR: 3/3. Preceded by
https://github.com/llvm/llvm-project/pull/220535.
In SDAG, the aarch64-isel phase checks if vector shuffles can be
expressed as trns. To do this, it checks shuffles of type shuffle(v, v),
and shuffle(v, undefined).
GlobalISel previously only checked shuffles of type shuffle(v, v). Add a
check for the situation where one of the operands is undefined.
Notes:
A trn takes two vectors, places the even-indexed elements in the bottom
half, and the odd-indexed elements in the top half.
e.g: `trn <0, 1, 2, 3>, <4, 5, 6, 7> => <0, 4, 2, 6, 1, 5, 3, 7>`.
A trn1 takes the bottom half of the result (aka. the even-indexed
elements)
e.g: `trn1 <0, 1, 2, 3>, <4, 5, 6, 7> => <0, 4, 2, 6>`.
[8 lines not shown]
[SCEV] Propagate a recurrence's nuw flag to its exit value. (#217378)
A recurrence's exit value is its closed form Start + BTC * Step. The sum
does not wrap, if the recurrence does not wrap: the recurrence reached
iteration BTC, so the value it computes there is the value the recurrence
had, and that did not wrap.
The flags are attached to the returned use, because they only apply to
this specific expression we evaluated for the exit value, no other,
equivalent SCEVs.
Alive2 Proof: https://alive2.llvm.org/ce/z/0vSRq-
This on its own has small impact on real world code (only retained some
additional flags in most cases):
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/962, but is
the first end-to-end use of SCEVUse.
[Mips] Fix instruction size for unfinalized bundles (#220953)
It looks like Mips uses unfinalized bundles (i.e. there is no leading
BUNDLE) for delay slots. While proper delay slots are covered by the
hasDelaySlot() case, things like forbidden slots and load delay slots
are not. Make sure we report the correct size for these.
Part of enabling instruction size verification by default.
[LV] Enable the exit value optimization via SCEV for tail folding. (#210928)
Extend optimizeLatchExitIVUserViaSCEV to also match the tail-folding
live-out extraction pattern. This lets the SCEV-based final-value
computation apply under tail folding as well, avoiding unnecessary
vector widening of induction variables that are only used outside the
loop.
Based on #195059
[RISCV] Remove -tail-folding-policy=dont-fold-tail for partial reduction tests (#221159)
After #205741, partial reductions with EVL tail folding is now
supported.
[ADT] Remove the TempID parameter from FoldingSetTrait::Equals. NFC (#221144)
Let the default implementation declare its own local, so an override
that compares against the node's fields need not accept an unused
FoldingSetNodeID.
Aided by Opus 5
[C++20] [Modules] Identify the tag redecl through Using (#221147)
Close https://github.com/llvm/llvm-project/issues/96423
We've already have some logics to merge the redecls. But if the previous
decls are found through using decl, we can't merge them right now. As
the reproducer shows. The using decl is common in modules as a common
method to wrap headers into a module.
The fix is simple too. If the existing check fails, we'll check if the
found one is a using decl, if yes, we will reuse the existing check with
the target decl for using decl.
[libc] Add getpwnam_r and getpwuid_r entrypoints (#220833)
Added reentrant getpwnam_r and getpwuid_r functions using the
FlatFileDatabase lookup engine.
* Implemented getpwnam_r and getpwuid_r entrypoints
* Added find_by_name and find_by_uid lookups under namespace passwd
* Added function specifications to include/pwd.yaml
* Registered entrypoints in config/linux/*/entrypoints.txt
* Added unit tests in libc/test/src/pwd/getpwnam_r_test.cpp and
libc/test/src/pwd/getpwuid_r_test.cpp
Assisted-by: Automated tooling, human reviewed.
[NFC][LowerTypeTests] Add tests for CFI jump table hotness ordering (#221045)
Add pre-commit test coverage establishing the baseline CFI jump table
layout before implementing hotness-based reordering in
https://github.com/llvm/llvm-project/pull/221046:
- cfi-jumptable-hotness.ll: checks jump table entry layout with IR
function attributes (hot/cold) and entry count profile metadata.
- cfi-jumptable-hotness-summary.ll: checks jump table entry layout
with ThinLTO module summary call edge hotness types (using text
summary IR and split-file).
These tests verify the baseline declaration-order layout where functions
within each strict type are placed without hotness consideration, making
the subsequent reordering diff explicit and easy to review.
PR Stack:
* https://github.com/llvm/llvm-project/pull/220776
* https://github.com/llvm/llvm-project/pull/221043
* https://github.com/llvm/llvm-project/pull/221044
[3 lines not shown]
[clang][docs] Document compile-time sanitizer suppressions and options (#218793)
Document compile-time default suppressions
(`__<sanitizer>_default_suppressions`) and default options
(`__<sanitizer>_default_options`) across AddressSanitizer,
LeakSanitizer, and ThreadSanitizer. Document all supported suppression
types for ASan and TSan, programmatic leak checking interfaces for LSan,
and explain independent options evaluation when ASan runs with
integrated LSan/UBSan.
Fixes https://github.com/google/sanitizers/issues/1628
**AI tool usage:** An AI assistant was used to help research and draft
the documentation updates.
[flang][Semantics] reject COMMON/EQUIVALENCE/derived types whose size does not fit in int64 (#219976)
Semantics was not enforcing the overall byte sizes when of
common block and equivalence storage when building the related symbols
and computing offsets for members. The size and offset silently
overflow, leading to computing inconsistent offsets in lowering and
aborting compilation with internal errors like "error: 'hlfir.declare'
op storage offset exceeds the storage size".
This patch limits the storage of such objects to what can fit a signed
64 bit integer (like gfortran/ifx/classic flang).
Assisted-by: AI
[lldb][test] Disable TestBreakOnLambdaCapture.py on Windows on Arm (#220944)
Something is wrong with the breakpoint handling which makes it flakey on
our bot.
https://github.com/llvm/llvm-project/issues/220942
[CIR] Give the cleanup kind a proper standalone attribute spelling
CleanupKindAttr overrode its assembly format to a bare `$value` so
`cir.cleanup.scope` would print `cleanup all`. The cost was that the
attribute had no readable standalone form, falling back to
`#cir<cleanup_kind all>`.
The `enum($attr)` operation directive removes the tradeoff. The attribute
keeps CIR_EnumAttr's bracketed default and now spells `#cir.cleanup<all>`,
while the operations ask for the bare keyword. The mnemonic drops the `_kind`
suffix the C++ class name carries.
Operation syntax is unchanged. invalid-loop-cleanup.cir now gets one
diagnostic from the enum parser instead of two.