[SystemZ] Match more shift and displacement patterns for LXA/LLXA
Add TableGen selection patterns for LXA/LLXA instructions to support:
- Add + shift of an extended value with scaled 20-bit displacement (with base)
- Shift of an extended value with scaled 20-bit displacement (without base)
- Add of an extended value with unscaled 20-bit displacement (LXAB/LLXAB)
Update test cases in lxa-*.ll and llxa-*.ll to cover the new patterns.
Assisted by: IBM Bob
[CIR] Lower va_arg for AMDGPU in CallConvLowering (#244116)
Summary:
AMDGPU classifier rejected every `cir.va_arg` as NYI.
This PR expands `cir.va_arg` the same way classic
`AMDGPUABIInfo::EmitVAArg` does.
The `va_list` is a single pointer into one buffer of 4-byte slots, so
each fetch:
- loads the cursor,
- moves it by the type's alloc size rounded up to 4,
- reads the value at the old cursor with align 4.
Relates to : https://github.com/llvm/llvm-project/issues/220471
Assisted by: claude opus 5.5
[CIR] Canonicalize data layoutin to llvm tranlation
MLIR spell data layout in their own ways. It causes two compatibly
layout string not the same order become mismatch. Add a canonicalize
function to tranlate to llvm one if two are the same layout.
[MC] Allocate ELFUniquingMap entries from the MCContext allocator. NFC (#244796)
Each ELF section's uniquing key, which embeds the group signature for
COMDAT sections, is otherwise malloc'ed and freed separately.
[RISCV] Fix RVV callee-saves in realigned frames
The prologue saves RVV callee-saved registers before it realigns SP
and sets up BP, but their slots were addressed from the realigned SP
or BP. The epilogue reloaded them from the wrong address, BP frames
stored them through the caller's s1, and their CFI was wrong.
Address these slots from FP, which does not move, and derive their
CFI from getFrameIndexReference so the two cannot diverge.
Fixes #244792
[SystemZ] Support ISD::AVGCEILS and ISD::AVGCEILU
Mark ISD::AVGCEILS and ISD::AVGCEILU as legal for vector types on z13+
and for i128 on z17 (VectorEnhancements3). Match them to VAVG* and VAVGL*
instructions while preserving mappings for existing s390 intrinsics.
Assisted by: IBM Bob
[SystemZ] Add TableGen patterns for z17 VEVAL ternary logic
Add SelectionDAG patterns to BitwiseVectorOps for canonical 3-input
bitwise boolean operations on z17 (VEVAL), including:
- Majority and Full Adder carry variants (immediate 23)
- InstCombine canonical and commuted Choose/multiplexer forms
(immediates 83, 53)
- 3-way bitwise difference and AND-NOT/XOR combinations (immediates 6,
16, 96, 112, 120, 135)
- Inverted/negated forms (immediates 172, 225, 232, 241, 246, 247)
This collapses previously unhandled 3-way boolean expressions from
multiple vector instructions into a single VEVAL instruction.
Update and add test coverage in vec-eval.ll.
Assisted by: IBM Bob
[SandboxIR] Fix GCC warning (NFC) (#244379)
GCC was complaining about LLVM_TEMPLATE_ABI in:
`extern template class LLVM_TEMPLATE_ABI
SwitchInst::CaseHandleImpl<llvm::SwitchInst::CaseIt, BasicBlock,
ConstantInt>`
```
warning: type attributes ignored after type is already defined [-Wattributes]
```
This patch gets rid of the warning.
[SanitizerCoverage] Give calls inserted into funclets their funclet bundle (#226762)
With scoped EH (MSVC C++), `WinEHPrepare` requires calls inside a catch
or cleanup funclet to carry a `"funclet"` operand bundle naming the
funclet's pad. Because `SanitizerCoverage` inserted its runtime calls
without one, `WinEHPrepare` treated them as implausible and replaced the
call and the rest of its basic block with `unreachable`, dropping catch
handler bodies that contain comparisons or indirect calls under
`-fsanitize=fuzzer`.
Color the function's EH funclets after instrumentation and attach the
enclosing pad's `"funclet"` bundle to inserted runtime calls, similar to
`AddressSanitizer`.
Fixes #212404
Assisted-by: Claude Code (Claude Opus 5.5)
[RISCV] Remove unused RISCVAsmBackend::getTargetOptions (NFC) (#244651)
The last caller was removed on September 23, 2026 in commit
674fd8d37e9b5806bc1a7ff31dc56bf3a0839c6b. This patch also removes the
now-unused TargetOptions member variable.
Assisted-by: Antigravity
[Mips] Remove unused MipsSubtarget::MIPS1WarningPrinted (NFC) (#244650)
The definition and last uses were removed on September 19, 2026 in
commit 73641283fc038d819b5a0d3e5fd1315d501ff9e1.
Assisted-by: Antigravity
[RISCV] Specially handle multiply by negative power-of-two cases (#244731)
Prior to this change, for power-of-two negative values in
`expandMulToAddOrSubOfShl()`, the `Shift1` was calculated as a `SHL` by
`32`, which for `i32` overflows, so is considered `undef`. In addition,
for the `i64` negative power-of-two case, `MulAmt + MulAmtLowBit`
overflowed in `uint64_t` causing a missed optimization.
Fixes #244328
Based on discussions with @lenary.
AI Usage: Reviewed by Codex.
[SystemZ][z/OS] Fix unsued variable error (#244755)
Missed a variable only used in assert. Fix is to move the call inside
the assert, and remove the variable.
[RISCV] Rewrite scratch register search in LowerKCFI_CHECK to avoid incrementing past X31. (#240941)
We don't know where X31 is in the register list, we really shouldn't
look at values after it.
Use a list of scratch registers instead of incrementing the register id.
This allows us to check when we we've reached the end of the array.
While there change unsigned to MCRegister and MCPhysReg.
Assisted-by: Claude
[MC] Emit line table rows for subsections in layout order (#242138)
Line table entries are recorded per section in emission order, but
subsections are laid out after subsection 0 in increasing order of their
numbers. For example, assembling the following with -g:
```
.text
nop # 0x0
.subsection 1
nop # 0x2
.subsection 0
nop # 0x1
```
produces rows for 0x0, 0x2 and 0x1, in that order. The negative address
delta of the last row is encoded as a wrapped-around unsigned
DW_LNS_advance_pc operand. DWARF requires addresses to only increase
within a sequence: llvm-dwarfdump --verify reports "decreases in address
from previous row", and consumers using checked arithmetic, such as
gimli, reject the whole line program. The Linux kernel hits this on
[21 lines not shown]
[dsymutil] Warn when the relocations of an object file were all lost (#241515)
A valid relocation is against a symbol of the binary, whose DIE is kept
along with the relocation.
An object file with valid relocations that saves none of them to the
relocation map has lost them, and merging the library would drop its
debug info.
That is how the relocation maps came out empty without notice. dsymutil
now warns about it.
Depends on #241512, only the last commit is new.