[X86] Fold FMADDSUB into VFMULC for fp16 complex multiply (#227698)
We fold fmaddsub using isCFMulFromFMAddSub (formerly isCFMulFromFMSUBADD) into vfmulc.
[AMDGPU] Skip the iterative atomic scan on native LDS atomics (#227222)
The iterative scan runs a serial loop with one iteration per active lane. For an LDS atomic that the target executes natively, this costs more than the hardware serialization it replaces. Leave such atomics alone when the value is divergent.
[IR] Don't fold bitcast pairs through bytes into invalid casts
A pair of bitcasts through a byte can change whether a value is a
pointer, or its address space. Merging such a pair produced an invalid
bitcast and crashed InstCombine, InstSimplify, constant folding and the
IR parser. Give bitcast pairs their own case, and only fold them if
neither end is a pointer, or both are pointers in the same address
space.
Also keep inttoptr and ptrtoint/ptrtoaddr separate from a pointer-byte
bitcast. These pairs used to hit an assertion.
Fixes #207532.
PowerPC/GlobalISel: Stop setting kill flags on selected instructions (#229016)
There is no point in maintaining these before register allocation
anymore.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
VE: Stop setting kill flags on virtual registers before FinalizeISel (#229012)
There is no point in maintaining kill flags before register allocation
anymore.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[LV] Make partial-reduction naming consistent (NFC) (#222377)
The partial-reduction code used "Chain" to refer to two different
concepts:
1. A `VPPartialReductionChain`, which is a collection of recipes that
form a partial reduction.
2. A list of `VPPartialReductionChain` objects that forms a chained
reduction.
This patch renames `VPPartialReductionChain` to
`PartialReductionDescriptor` and updates the terminology as follows: a
`Link` is a single `PartialReductionDescriptor`, a `Chain` is a list of
links, and `Chains` refers to a collection of chains.
VE: Compute live-ins after splitting for EXTEND_STACK expansion (#221553)
expandExtendStackPseudo splits its block but left the new blocks without
live-in lists, so their uses of registers live across the split are rejected by
-verify-machineinstrs.
Co-authored-by: Claude (Claude-Opus-4.8)
[GlobalISel] Translate byte to ptr bitcasts to `G_INTTOPTR`/`G_PTRTOINT` (#226541)
Reverts #209557 and fixes the underlying crash it worked around.
A `bitcast` from a byte type to a pointer is valid IR and preserves
pointer provenance. #209557 replaced it with a `bitcast` to `i64`
followed by `inttoptr`, which drops provenance. That's unsound.
The crash came from the IRTranslator. It lowered scalar byte to pointer
bitcasts to `G_INTTOPTR` and `G_PTRTOINT`, but left vector forms as
`G_BITCAST`. The MachineVerifier rejects that when the pointer side is a
scalar pointer. We now go through an integer matching the pointer size,
and add a `G_BITCAST` first when the shapes differ:
```diff
%r = bitcast <2 x b32> %v to ptr
-%r:_(p0) = G_BITCAST %v(<2 x i32>) ; bitcast cannot convert between pointers and other types
+%i:_(i64) = G_BITCAST %v(<2 x i32>)
+%r:_(p0) = G_INTTOPTR %i(i64)
```
X86: Stop setting kill flags on virtual registers before FinalizeISel
There is no point in maintaining kill flags before register allocation
anymore.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
AArch64: Stop setting kill flags on virtual registers before FinalizeISel
There is no point in maintaining kill flags before register allocation
anymore.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
ARM: Stop setting kill flags on virtual registers before FinalizeISel
There is no point in maintaining kill flags before register allocation
anymore.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
LoongArch: Stop setting kill flags on virtual registers before FinalizeISel
These is no point to maintaining these before register allocation anymore.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Mips: Stop setting kill flags on virtual registers before FinalizeISel
There is no point in maintaining these before register allocation anymore.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[AMDGPU] Extract byte lanes of a split vector from the 32-bit source
After a <4 x i8> is split into i16 halves, a byte lane is extended
from an i16 shift of a truncate. Rewrite it on the 32-bit source as an
and of srl or a sign_extend_inreg of srl, which select to a single bit
field extract.
Uniform zero and any extends are left alone, their i16 shift is already
promoted to i32.
PowerPC/GlobalISel: Stop setting kill flags on selected instructions
There is no point in maintaining these before register allocation
anymore.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RISCV: Stop setting kill flags on virtual registers before FinalizeISel
Kill flags have no remaining use before register allocation and are
stripped by LiveIntervals.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[mlir][tosa] Preserve all-NaN max-pool windows (#225744)
Initialize IGNORE-mode floating-point max pooling with NaN and select
the first finite input. This keeps an all-NaN window NaN instead of
returning the lowest finite value.
Assited-by: Codex