[SLP]Skip FP identity columns in reassoc chains
- Treat -0.0 (fadd), 1.0 (fmul) and +0.0 (subtracted fadd column) as
identities, so identity-only columns are not combined.
- Model a copyable identity by the sign of its column: -0.0 in a
subtracted fadd column turned a -0.0 lane into +0.0 without nsz.
Assisted-by: Cursor
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/239971
[clang-repl] Restore the lookup of out-of-line definitions' predecessors (#229780)
Undoing the out-of-line definition of a member removes it from the
lookup table of its semantic context, its class or namespace, and then
makes its surviving previous declaration visible again. But the previous
declaration was made visible in the lookup table of the lexical context,
the enclosing context of the definition. The member was then not found
in its class or namespace anymore, but in the enclosing context instead:
struct K { static int s; };
int K::s = 4;
%undo
int K::s = 5; // error: no member named 's' in 'K'
Make the previous declaration visible in its own semantic context.
Assisted-by: Claude Opus 5.5
[SCEV] Prove non-strict & not-equal later isBasicBlockEntryGuard (NFCI). (#239818)
isBasicBlockEntryGuardedByCond eagerly tried to prove a strict predicate
as its non-strict half and non-equality, up front and for each guarding
condition, even if a later condition implies the predicate directly.
Trying all conditions directly instead first can speed up compile-time,
because either the predicate holds directly or we can avoid the more
expensive non-equality proofs because the non-strict predicate also does
not hold.
stage1-O3: -0.15%
stage1-ReleaseThinLTO: -0.13%
stage1-ReleaseLTO-g: -0.11%
stage1-aarch64-O3: -0.16%
stage2-O3: -0.14%
stage2-clang: -0.02%
[4 lines not shown]
[AMDGPU] Price misaligned flat and LDS accesses with the LDS misaligned bug
In WGP mode on subtargets with the LDS misaligned bug, a flat access is
split into pieces no wider than its alignment and no narrower than 4
bytes, and an LDS access aligned below 4 bytes uses 8-byte pieces as one
aligned to 4 does.
[AMDGPU] Price buffer fat pointer memory operations
Price buffer fat pointer accesses as global accesses, except that an
aligned load is not widened and a vector of odd width elements is not
split element by element. Without relaxed buffer bounds checking, a
vector of elements that are a multiple of 32 bits wide is accessed in
pieces no wider than its alignment and no narrower than 4 bytes, and a
vector of other byte-sized or power of 2 wide elements in pieces of the
largest power of 2 bytes that divides the element size. The width comes
from buffer fat pointer lowering, which now exposes it. When the pointer
is a buffer resource plus a constant offset, the offset and a constant
number of records give the same bounds facts lowering uses to access it
in wider pieces.
[AMDGPU] Price constant address space memory operations
Price constant address space accesses as global accesses, except for
loads selected to scalar loads of up to 64 bytes. These are loads from
the 32-bit constant address space, and loads from the constant address
space whose pointer is an argument passed in SGPRs or a constant, plus
constant offsets, both aligned to 4 bytes or to their size. A scalar
load is widened as its lowering does. An integer whose size is not a
multiple of 4 bytes is loaded as whole dwords, plus a byte load when its
size is 7 modulo 8, since the last byte of such a remainder is left out
of the scalar load. A type with no legal dword vector equivalent is
split into the largest power of 2 pieces that fit, and once the
remainder fits in the alignment it is widened to a power of 2 piece of
up to the alignment, at most 8 bytes for byte vectors. A 3-dword
remainder of a legal dword vector takes a fourth dword when aligned to 8
on a subtarget without scalar dwordx3 loads.
[LoongArch] Add support for vector add/sub on vNi128 types
Make v1i128 and v2i128 legal types in the LSX/LASX register classes and
lower ADD/SUB on them to VADD.Q/XVADD.Q and VSUB.Q/XVSUB.Q.
The vNi128 types are intentionally kept out of LSXVTs/LASXVTs so that
only a minimal set of operations is legal on them: LOAD, STORE, BITCAST,
UNDEF, ADD, SUB and VSELECT (via [X]VBITSEL.V). VECTOR_SHUFFLE is custom
lowered by performing the shuffle on the equivalent i64 vector type.
Everything else keeps the default Expand action.
Since the widening extend combine can now produce VEXTH/VEXTH_U on
vNi128, also add the [X]VEXTH.Q.D and [X]VEXTH.QU.DU patterns.
[LoongArch][NFC] Add tests for vector add/sub on vNi128
Also add tests for load/store, select and shuffle on vNi128 types to
make sure operations without dedicated support are still legalized
correctly.
Revert "[clang][Sema] Recheck array size once the element type is complete" (#239935)
Reverts llvm/llvm-project#219817
Causes a large compile-time regression.
[clang][Diagnostics] Don't drop "no-" when reporting an unknown -Wno-error= option (#239212)
Fixes #227392
If you pass `-Wno-error=foo` and clang doesn't know the `foo` warning
group, the
message you get back is about `-Werror=foo`. The `no-` is gone, and the
"did you
mean" suggestion drops it as well, so the flag in the message isn't the
one you
actually passed. The reporter hit this with
`-Wno-error=maybe-uninitialized`
from a GCC build and couldn't tell what to remove.
Nothing is lost before this point. `ProcessWarningOptions` pulls off the
`no-`
and stores it in `isPositive`, and the plain `-W` and `-R` paths already
use it
when building the prefix. The `-Werror=` and `-Wfatal-errors=` paths had
[30 lines not shown]
[MC] Remove DWARFCFIChecker (#237681)
The checker (#145633) processes instructions in program order and
attributes each CFI directive to the preceding instruction, so the CFA
reset after a mid-function epilogue is reported as an error. On `clang
-S -O2` output of llvm/lib/Support/{APInt,StringRef,raw_ostream}.cpp
(354 functions), `llvm-mc --validate-cfi` reports 294 errors, all false
positives, plus 3083 warnings. It also ignores .cfi_remember_state and
.cfi_restore_state.
Making it usable requires a CFG with jump tables, landing pads, and
noreturn calls, which is a rewrite. Nothing uses it besides its own
tests, while every new CFI directive has to be handled in
DWARFCFIState::convert.
LLM-aided
Discussion: https://discourse.llvm.org/t/rfc-dwarf-cfi-validation/86936
[MC] Declare the MCTargetOptions command line options in TableGen
Move RegisterMCTargetOptionsFlags options into a private `MCToolOptions`
struct, different from MCCLOptions since `MCToolOptions` requires tool
opt-in. RegisterMCToolOptions, renamed from RegisterMCTargetOptionsFlags
(LLVMOption and clang driver use "flags" for boolean options), registers
the struct, so `clang -mllvm -crel` remains an error.
Remove the getters without outside readers. llc reads `MCRelaxAll`
instead of `getExplicitRelaxAll`, so `-mc-relax-all=false` no longer
warns with a non-object file type.
LLM-aided