AMDGPU: Pass MachineRegisterInfo to getImmOrMaterializedImm
The only used the operand to reach the MachineRegisterInfo. Pass it
directly so it no longer depends on MachineOperand::getParent().
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
CodeGen: Pass instruction and operand index to isPCRelRegisterOperandLegal
Replace the MachineOperand argument to the
TargetInstrInfo::isPCRelRegisterOperandLegal hook with the containing
instruction and operand index. The M68k implementation only used the operand
to recover its parent instruction and operand number, so this drops the
dependence on MachineOperand::getParent().
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[SelectionDAG] Preserve CTTZ_ELTS lane count during expansion (#217982)
Fixes #216649
`expandCttzElts` derives `VL` from its legalized auxiliary step vector.
When that helper vector is widened for target legality, its lane count
may differ from the logical lane count of the `CTTZ_ELTS` operand.
On X86 with AVX512F, the step vector for a semantic `<4 x i1>` mask is
widened from `v4i8` to `v16i8`. As a result, an all-zero
`llvm.experimental.cttz.elts` input returns 16 instead of the required
result of 4.
Preserve the `ElementCount` from the `CTTZ_ELTS` operand and use it when
materializing `VL`. Auxiliary step-vector legalization can still widen
its representation without changing the logical lane domain of the
operation.
Add AVX512F regression coverage for the affected `v4i1` and `v8i1`
[3 lines not shown]
[Clang] Fix -Wunused-parameter for implicit coroutine uses (#217518)
Clang's coroutine semantic analysis builds references to coroutine
parameters
while looking up a class-specific allocation function. When overload
resolution
falls back to a size-only `operator new`, these speculative references
currently
suppress `-Wunused-parameter`.
Preserve each parameter's referenced state while collecting placement
arguments, then mark the parameters referenced only when those arguments
are
included in the selected allocation call. Keep this distinction when
placement
arguments are replaced by `std::nothrow`.
Apply the same rule to promise initialization: when initialization using
the
[16 lines not shown]
Revert "Revert "workflows/release-binaries: Disable flang on Darwin (#164667)"" (#218978)
Reverts llvm/llvm-project#216667
This change was ported to the `release/23.x` branch in #217059, and when
we created the first release that included this change (3.1.0), the job
for the MacOS ARM binaries was killed when the job hit the 6 hour mark.
Previous 3.1.0-rc release did not include this change and all completed
well within the 6 hour time out.
To enable the job that builds the release binaries to complete within
the allotted time, I am reverting this change which will essentially
disable flang from building on Darwin.
In the future if we get faster builders, we can explore re-enabling
building flang.
(cherry picked from commit 3d771f477aa026ca41cb3c4e492d7a07fa852cbe)
[X86] LowerAVXCONCAT_VECTORS - fix some clang-format messiness. NFC. (#218504)
Bad indentation and missing braces
Pulled out of #218381 to simplify functional diff
(cherry picked from commit a6eb1e1e75a2d29f8f458c6ee513ae5b030ff9a0)
[X86] LowerAVXCONCAT_VECTORS - collect all subvector operands before ReplaceAllUsesWith call (#218381)
We can end up referencing a node replaced with ISD::DELETED_NODE
Fixes #218379
(cherry picked from commit 7bced7f78781d3bdc179e64c777f50ef46ab1375)
[SLP]Fix narrow-tree gate width and extract miscount
Measure the narrowness of in-loop trees by the actual vectorization
width instead of the feeder-load width, and skip vector-typed scalars
in the instruction count check to match the cost model.
Fixes #216715
Reviewers: efriedma-quic, bababuck, RKSimon, kartcq
Pull Request: https://github.com/llvm/llvm-project/pull/216797
[GlobalISel] Fix inverted libcall status check in createFCMPLibcall (#219242)
BuildLibcall tested `if (!Status)` on the LegalizeResult returned by
createLibcall. Since LegalizeResult is an enum with AlreadyLegal == 0,
that condition is false for both Legalized and UnableToLegalize, so a
failed libcall was never detected. The helper then built an ICMP against
the undefined result register and reported success, so the legalizer
never fell back.
Check `Status != Legalized` instead, so failures propagate and the
caller can bail out.
On arm64ec, GlobalISel call lowering is unimplemented, so this silently
dropped `fp128` compare libcalls at `-O0`. Add a test that checks the
expected `__eqtf2`, `__lttf2` and `__unordtf2` calls are emitted at both
`-O0` and `-O2`.
(cherry picked from commit ded76cf640b9b7c1425f9543c54da402bbda7ca5)
[LoongArch] Fix selection of BRCOND with constant conditions (#216027)
LoongArch DAG instruction selection could fail to select
`LoongArchISD::BRCOND` when its condition was a constant integer. Add
patterns to lower constant zero and one conditions to `BEQZ` and `BNEZ`.
Co-authored-by: wanglei <wanglei at loongson.cn>
Fixes: https://github.com/llvm/llvm-project/issues/215935
(cherry picked from commit 17adf57f977f24685e535d649d2244610b104a13)
[VectorCombine] Fix foldBitcastOfVPLoad reordering loads (#218336)
We were inserting the new vp.load where the bitcast was, which would
reorder loads. This should hopefully fix RISC-V buildbot failures that
were exposed after 93ac788df8ff
(cherry picked from commit 2eda652e5cd7d70de8dd4f33a7cece6b70465163)
[lldb] Add Guarded<T, Mutex> to Locked.h
LLDB's code base has many variables that have an associated mutex that
needs to be locked to safely access that variable from multiple
threads. However, this locking scheme is currently not enforced by the
compiler and code sometimes accesses these variables without aquiring
the respective mutex first.
This patch introduces a `Guarded` class that strictly enforces that
some memory is only accessed after the respective mutex has been
aquired. This class hands out `Locked` objects for every access which
guarentee that the mutex is held as long as the variable is in scope.
X86: Use use_instructions in CompressEVEX cross-block check (#219408)
The loop only checks the using instruction's parent block, so iterate
use_instructions() instead of the operands and checking their parents.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
Hexagon: Use use_instructions in EarlyIfConversion predicate check (#219405)
The loop only checks whether any user is a PHI, so iterate
use_instructions() instead of the operands to query the parents.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[SelectionDAG] Unique VT lists in a DenseSet instead of a FoldingSet (#219364)
Every getVTList call serializes the list's raw bits into a
FoldingSetNodeID and hashes it with xxh3, and every SDVTListNode carries
an interned copy of that profile. The list itself is the key.
Key VTLists on the ArrayRef the returned SDVTList already points at, and
let the two-, three- and four-type overloads share the ArrayRef one.
Aided by Opus 5
[lldb] Add requireSocketPermission decorator for tests that bind sockets (#219208)
We sometimes run tests in sandboxed environments that deny all calls to
`bind`. This breaks a few of our tests that e.g. use a mock GDB server
or any other functionality involving sockets.
This patch adds a requireSocketPermission decorator (and an equivalent
utility for unittests) that check whether we are allowed to call bind.
If we aren't allowed to call bind, we skip the few tests that need this
functionality.
[Hexagon] Add GlobalArrayAlignment pass (#217850)
Add a module pass that raises the alignment of global integer arrays
(char, short, int), including multi-dimensional arrays, to an 8-byte
boundary. This gives their base address a wider alignment, which is
beneficial for the wide (double-word) loads and stores available on
Hexagon.
At -O1/-O2 the pass keeps byte and half-word arrays at their natural
alignment to reduce .rodata size; full 8-byte alignment is applied at
-O3. This size-reduction behavior can be disabled with
-hexagon-disable-align-opt-byte-half.
The pass is enabled by default and can be disabled with
-hexagon-disable-global-array-align.
Co-Authored by: Jyotsna Verma jverma at quicinc.com
PowerPC: Use use_instructions in TLSDynamicCall user collection
The loop only collects the using instructions, so iterate
use_instructions() instead of the operands to get their parents.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[libc++] Use __copy_n in vector::__assign_with_size (#218370)
This was originally part of #214132. However, that patch has some
difficult to track down performance issue. I'm splitting this up to make
the search easier.
X86: Use use_instructions in CompressEVEX cross-block check
The loop only checks the using instruction's parent block, so iterate
use_instructions() instead of the operands and checking their parents.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[MLIR][NVVM] Support tcgen05.mma{.block_scale}.decompress_b Ops (#218354)
This change adds support for `tcgen05.mma.decompress_b` and
`tcgen05.mma.block_scale.decompress_b` MLIR Ops.
Hexagon: Use use_instructions in EarlyIfConversion predicate check
The loop only checks whether any user is a PHI, so iterate
use_instructions() instead of the operands to query the parents.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
AMDGPU: Use use_nodbg_instructions in GCNSchedStrategy MFMA check
The loop only inspects the using instruction, so iterate
use_nodbg_instructions() instead of the operands and their parents.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
RISCV: Pass MachineRegisterInfo to isVLKnownLE
isVLKnownLE and its getEffectiveImm helper used the VL operands to reach
the MachineRegisterInfo. Pass it directly so they no longer depend on
MachineOperand::getParent().
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>