63217 Commits

Author SHA1 Message Date
Djordje Todorovic
bdfe03bbce
[MIPS][ISel] Fix musttail (#161860)
Properly handle clang::musttail attribute on MIPS backend.

It fixes: https://github.com/llvm/llvm-project/issues/161193
2026-01-27 19:55:22 +01:00
vangthao95
e80de08aa6
[AMDGPU][GlobalISel] Add RegBankLegalize support for G_ATOMIC_CMPXCHG (#178066)
From the legalizer, G_ATOMIC_CMPXCHG is legal with local and region pointers.
Global and flat pointers are converted into G_AMDGPU_ATOMIC_CMPXCHG. Implement
rules for both variants.
2026-01-27 09:02:33 -08:00
David Peixotto
23a0513015
[regalloc][basic] Fix non-deterministic codegen in basic register allocator (#177998)
The basic register allocator's priority queue exhibited
non-deterministic behavior when multiple LiveIntervals had identical
spill weights. This caused different register allocation decisions
between ASAN and non-ASAN builds, leading to spurious test failures on
some internal tests.

Root Cause:
The CompSpillWeight comparator only compared spill weights:
```
  return A->weight() < B->weight();
```

When two LiveIntervals had equal weights, the comparator returned false
for both comp(A,B) and comp(B,A), making them equivalent in the heap
ordering. The C++ standard does not specify the relative order of
equivalent elements in a heap. In practice, the heap's internal
structure for equivalent elements depends on implementation details and
memory layout. ASAN changes memory layout, leading to different valid
heap configurations and thus different dequeue order.

Fix:
Add an explicit stable tie-breaker using virtual register numbers:
```
  return std::tuple(A->weight(), A->reg()) <
         std::tuple(B->weight(), B->reg());
```

Register numbers are stable integers independent of memory layout,
ensuring deterministic behavior across all build configurations. When
spill weights are equal, higher-numbered virtual registers are allocated
first, which is equally valid and deterministic.

Test Updates:
Updated test expectations in
CodeGen/AMDGPU/register-killed-error-after-alloc-failure0.mir to reflect
the new deterministic allocation order. When LiveIntervals have equal
spill weights, the allocator now consistently processes them in register
number order rather than in an implementation-defined order.
2026-01-27 08:37:47 -08:00
Mikhail Gudim
24862c2b60
[RISCV][test] Simplify a test. (#178052) 2026-01-27 08:15:46 -08:00
Craig Topper
3d07cc3c1b
[RISCV] Reorder some check-prefixes in a way that makes the update script work. NFC (#178120)
Prior to this, the update_llc_test_checks script would generate ZVFBFA
and ZVFBFWMA checks that were already included in ZVFHMIN.
2026-01-27 07:07:28 -08:00
Craig Topper
0a53a55770
[RISCV] Remove 'implicit $vl' from PseudoVMV_X_S in emergency-slot.mir. NFC (#178015)
This instruction doesn't use VL and the pseudo doesn't have a VL
operand. According to VSETVLIInserter tests, this instruction only gets
implicit $vtype added to it.
2026-01-27 07:04:26 -08:00
Maryam Moghadas
c41691c8b6
[PowerPC] Fix XXPERMDI peephole and ISEL LiveVariables bugs (#172122)
Fixes https://github.com/llvm/llvm-project/issues/159116
Prevent XXPERMDI splat optimization when the splat output register is
used in other instructions, which caused undefined register references. 
Also track removed ISEL operands in simplifyToLI to prevent 
LiveVariables corruption during ISEL-to-COPY conversion.
2026-01-27 09:44:23 -05:00
Sander de Smalen
0e84f659b8
Support EXTRACT_SUBVECTOR in computeKnownBits for scalable vectors (#177163)
Rather than not supporting this case it would just be more conservative
as it will need to prove known bits for all elements.

Follows on from #176883
2026-01-27 12:53:00 +00:00
Jay Foad
b7c68c3a39
[AMDGPU] Add test for a bug in the early release VGPRs optimization (#178141) 2026-01-27 10:44:54 +00:00
David Green
fcb96d8941 [AArch64][GlobalISel] Remove -global-isel-abort=2 from a number of tests. NFC
This cleans up some -global-isel-abort=2 uses, either removing the unnecessary
flags or cleaning up the tests that use them.
2026-01-27 09:41:07 +00:00
Marcos Maronas
4631208375
[SPIRV] Extend and fix SPV_KHR_bit_instructions testing. (#175825)
On one hand, this patch adds a couple of new testcases related to
SPV_KHR_bit_instructions. On the other hand, it fixes a couple of
testcases that were using `llvm.bitreverse.*`, while they were supposed
to use the SPIRV-friendly equivalent.

---------

Co-authored-by: Marcos Maronas <marcos.maronas@intel.com>
2026-01-27 07:52:15 +00:00
Pengcheng Wang
f4ceddd307
[RISCV] Support select optimization
AArch64 has enabled this in https://reviews.llvm.org/D138990, and
the measurement data still stands for RISCV in some cases.

And, similar optimization like #77284 is added too.

After this patch, the highly predictable branch will be converted
back to branches instead using selects.

This pass is disabled by default now, we can enable it by default
after more detailed investigation.

Reviewers: davemgreen, preames, dtcxzyw, lukel97, topperc, asb

Pull Request: https://github.com/llvm/llvm-project/pull/80124
2026-01-27 15:01:58 +08:00
S. VenkataKeerthy
ddecdcc85c
[IR2Vec] Change MIR2Vec vocab printer to not print non-zero entities (#178117)
This PR relaxes MIR2Vec tests, so that `reference_*_print.txt` files
need not be updated every time the list of MIR opcodes changes
2026-01-27 11:54:29 +05:30
David Green
f5de33dbf5
[ShrinkWrap] Ensure we do not crash on unreachable blocks. (#178009)
Since we started optimizating always-true branches in the AArch64
backend (like cbz wzr), shrink wrap has been exposed to some block
structures that it does not handle correctly, usually with unreachable
blocks. This prevents the call to FindIDom/findNearestCommonDominator
from failing when looking at the predecessors of a loop if one is
unreachable.

Fixes: #177866
2026-01-27 13:42:06 +08:00
Craig Topper
05e2ee9664
[RISCV] Replace riscv.clmul intrinsic with llvm.clmul (#178092)
I did not replace riscv.clmulh/clmulr since those require a multiple
instruction pattern match. I wanted to ensure that -O0 will select the
correct instructions without relying on combines.
2026-01-26 21:12:48 -08:00
Vladimir Vereschaka
acff9fa4db
Revert "[NVPTX] Weak cmpxchg unittests for NVPTX" (#178090)
Reverts llvm/llvm-project#176078

These changes break the NVPTX builders: llvm-nvptx[64]-nvidia-*
2026-01-26 17:52:49 -08:00
Carl Ritson
61f272d5cc
[AMDGPU] Pre-GFX10 does not need added latency for workgroup fences (#177157)
Wait counts will not typically be introduced for workgroup scope fences
in pre-GFX10 ASICs.
Hence avoid adding scheduling latency for these.
2026-01-27 10:24:05 +09:00
Justin Fargnoli
d23cb79ba4
Revert "Reland "[NVPTX] Validate user-specified PTX version against SM version"" (#178046)
Reverts llvm/llvm-project#177459

`mlir-nvidia` and `mlir-nvidia-gcc7` Buildbots are failing. 

The blamelist is small and likely because of my change. Preemptively
reverting.
2026-01-26 12:48:59 -08:00
Matt Arsenault
f430f0f294
R600: Really remove softPromoteHalfType (#178040)
This was the core change in #177420, which somehow got lost
before submitting.
2026-01-26 20:46:37 +00:00
Florian Mayer
d139a31c0d
[HWASan] [MTE] allow lifetimes with multiple starts (#175608) 2026-01-26 19:47:49 +00:00
Justin Fargnoli
487b69ae0a
Reland "[NVPTX] Validate user-specified PTX version against SM version" (#177459)
Original commit message: 

> When users explicitly specify a PTX version via -mattr=+ptxNN that's
insufficient for their target SM, we now emit a fatal error. Previously,
we silently upgraded the PTX version to the minimum required for the
target SM.
>
>When no SM or PTX version is specified, we now use PTX 3.2 (the minimum
for the default SM 3.0) instead of PTX 6.0.

---

The following commits should fix the failures that arose when I
previously tried to land this commit:

- 9fc5fd0ad689eed94f65b1d6d10f9c5642935e68 should address the
`llvm-nvptx*-nvidia-*` build failures:
https://github.com/llvm/llvm-project/pull/174834#issuecomment-3742242651

- 600514a63760c6730e4cd970d2fcead9c5a897b3 should address the MLIR
failures
2026-01-26 19:47:05 +00:00
Jonas Paulsson
c999e9a4fe
[SystemZ] Support fp16 vector ABI and basic codegen. (#171066)
- Make v8f16 a legal type so that arguments can be passed in vector
registers. Handle fp16 vectors so that they have the same ABI as other
fp vectors.

- Set the preferred vector action for fp16 vectors to "split". This will
scalarize all operations, which is not always necessary (like with
memory operations), but it avoids the superfluous operations that result
after first widening and then scalarizing a narrow vector (like v4f16).

Fixes #168992
2026-01-26 13:42:25 -06:00
Matt Arsenault
a25c7d7ade
ValueTracking: Extract isKnownIntegral out of AMDGPU (#177912)
Also do some basic conversions to use SimplifyQuery and add tests to
show assume works in a new context.
2026-01-26 19:55:14 +01:00
Matt Arsenault
6039b47090
Reapply "R600: Remove softPromoteHalfType (#177420)" (#178013)
This reverts commit 38b7176c92f31c274226ff418891545046dcf1f0.
2026-01-26 18:49:26 +00:00
Nemanja Ivanovic
674b020196
[RISC-V] Fix outliner candidate analysis (#177126)
When analyzing outliner candidates, there is no check that the tail-call
expansion register is live across the candidate call site. That can
result in a situation where the original function sets the volatile
register and uses it in the section that gets outlined. This of course
results in the use of the register receiving the incorrect value. Namely
the address of the outlined function since that is what the tail-call
sequence placed in the register.
2026-01-26 19:47:18 +01:00
Matt Arsenault
0ae2043baa
AMDGPU: Disable machine verifier for gfx6 run line in test (#178008)
Hack around expensive checks failures for now.
2026-01-26 18:35:12 +00:00
Mirko Brkušanin
c9e0cf139c
[AMDGPU] Update patterns for v_cvt_flr and v_cvt_rpi (#177962)
Support GlobalISel and switch to checking `nnan` flag on instruction
instead of TargetOptions.
    
Instruction are renamed to v_cvt_floor and v_cvt_nearest on gfx11+
so add gfx11 tests as well.
2026-01-26 19:33:00 +01:00
Florian Mayer
fc6a5ed1a4
[HWASan] [MTE] use precise lifetimes even if they don't cover all exits
Previously, for performance reasons, we would only use precise lifetimes
if they cover all reachable exits. Now, if they do not, we use precise
lifetimes in addition to untagging at every exit that is not dominated
by them.

This is the behavior of ASan.

Reviewers: vitalybuka, pcc

Pull Request: https://github.com/llvm/llvm-project/pull/174875
2026-01-26 10:25:31 -08:00
vangthao95
c327d46d79
[AMDGPU][GlobalISel] Add frexp_mant/fract intrinsic RegBankLegalize r… (#177512)
…ules
2026-01-26 10:23:40 -08:00
vporpo
21dad8e5cc
[AMDGPU] Improve crash message when S_WAITCNT_DEPCTR is missing its operand (#177065)
The code in the test is causing a crash in `SIInstrInfo.cpp`
`fixImplicitOperands()` in `MI.implicit_operands()`:
```
  for (auto &Op : MI.implicit_operands()) {
```
MachineInstr.h:
```
  mop_range implicit_operands() {
=>  return operands_impl().drop_front(getNumExplicitOperands());
  }
```
We are trying to drop 1 operand from the operands of MI which are 0.

By early returning we are no longer crashing at that point and we are
getting a more meaningful error message:

```
*** Bad machine code: Too few operands ***
- function:    missing_operand_crash
- basic block: %bb.0  (0x5a9d30ced988)
- instruction: S_WAITCNT_DEPCTR
1 operands expected, but 0 given.
```

The code is still crashing at a different location, but at least we are
getting an error message.
2026-01-26 08:35:30 -08:00
Aiden Grossman
38b7176c92 Revert "R600: Remove softPromoteHalfType (#177420)"
This reverts commit 99fab0106b428676c37154821d955797fe1786a3.

llc was crashing in kernel-args.ll after this patch:
```
.---command stderr------------
| LLVM ERROR: Cannot select: t3: f32,ch = load<(non-temporal dereferenceable invariant load (s16), align 4, addrspace 7), sext from f16> t0, Constant:i32<36>, undef:i32
| In function: f16_arg
| PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
| Stack dump:
| 0.	Program arguments: /b/ml-opt-devrel-x86-64-b1/build/bin/llc -mtriple=r600 -mcpu=redwood
| 1.	Running pass 'Function Pass Manager' on module '<stdin>'.
| 2.	Running pass 'Unnamed pass: implement Pass::getPassName()' on function '@f16_arg'
|  #0 0x0000561402607438 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x81a7438)
|  #1 0x0000561402604b75 llvm::sys::RunSignalHandlers() (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x81a4b75)
|  #2 0x00005614026081b1 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
|  #3 0x00007f55eb45a050 (/lib/x86_64-linux-gnu/libc.so.6+0x3c050)
|  #4 0x00007f55eb4a8eec (/lib/x86_64-linux-gnu/libc.so.6+0x8aeec)
|  #5 0x00007f55eb459fb2 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3bfb2)
|  #6 0x00007f55eb444472 abort (/lib/x86_64-linux-gnu/libc.so.6+0x26472)
|  #7 0x0000561402567005 llvm::report_fatal_error(llvm::Twine const&, bool) (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x8107005)
|  #8 0x00005614023e7ba7 llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x7f87ba7)
|  #9 0x00005614023e6a7d llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x7f86a7d)
| #10 0x00005614023dae94 llvm::SelectionDAGISel::DoInstructionSelection() (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x7f7ae94)
| #11 0x00005614023d9e6a llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x7f79e6a)
| #12 0x00005614023d7b5e llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x7f77b5e)
| #13 0x00005614023d4c30 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x7f74c30)
| #14 0x00005614023d22e0 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x7f722e0)
| #15 0x0000561401611793 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x71b1793)
| #16 0x0000561401b790e5 llvm::FPPassManager::runOnFunction(llvm::Function&) (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x77190e5)
| #17 0x0000561401b80f72 llvm::FPPassManager::runOnModule(llvm::Module&) (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x7720f72)
| #18 0x0000561401b79b56 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x7719b56)
| #19 0x00005613ff4858f4 compileModule(char**, llvm::SmallVectorImpl<llvm::PassPlugin>&, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
| #20 0x00005613ff482ed3 main (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x5022ed3)
| #21 0x00007f55eb44524a (/lib/x86_64-linux-gnu/libc.so.6+0x2724a)
| #22 0x00007f55eb445305 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x27305)
| #23 0x00005613ff47ea21 _start (/b/ml-opt-devrel-x86-64-b1/build/bin/llc+0x501ea21)
`-----------------------------
```
2026-01-26 16:23:38 +00:00
Jay Foad
017f2bc181
[AMDGPU] Simplify legalization of PHI operands (#177352)
In practice when legalizeOperands is called on a PHI node, the result is
never an SGPR class and the operands are never subregs. Simplify the
code accordingly by using the result regclass for all the inputs. This
includes using an AV class where previously we picked either an AGPR or
VGPR class.
2026-01-26 15:39:13 +00:00
David Green
8302e8ae66 [AArch64] Update aarch64-tbz.ll test. NFC 2026-01-26 15:28:01 +00:00
Matt Arsenault
99fab0106b
R600: Remove softPromoteHalfType (#177420)
Also includes a kind of hacky, minimal change to avoid assertions
when softPromoteHalfType is removed to fix kernel arguments
lowered as f16. Half support was never really implemented
for r600, and there just happened to be a few incidental tests
which included a half argument (which were also not even meaningful,
since the function body just folded to nothing due to no callable
function support).
2026-01-26 16:26:58 +01:00
Matt Arsenault
1db5d6410b
AMDGPU: Move softPromoteHalfType override to R600 only (#177419)
As expected the code is much worse, but more correct.
We could do a better job with source modifier management around
fp16_to_fp/fp_to_fp16.
2026-01-26 15:23:04 +00:00
Nikita Popov
1bad00adc4
[SDAG] Remove non-canonical fabs libcall handling (#177967)
This is a followup to https://github.com/llvm/llvm-project/pull/171288,
which removed lowering of libcalls to SDAG nodes for most libcalls that
get unconditionally canonicalized to intrinsics. This handles the
remaining fabs case, which I originally skipped due to larger test
impact.
2026-01-26 15:11:17 +00:00
Tim Corringham
d5f405558d
[HLSL] Implement f32tof16() intrinsic (#172469)
Implement the f32tof16() intrinsic, DXIL and SPIRV codegen, and related
tests.

Fixes #99113

---------

Co-authored-by: Tim Corringham <tcorring@amd.com>
2026-01-26 15:06:48 +00:00
Matt Arsenault
535ec2e4e5
AArch64: Use poison more in legalization (#177919)
Convert many, but not all contexts creating new undefs
to use poison instead.
2026-01-26 15:37:42 +01:00
Simon Pilgrim
c5e6257351
[X86] combineX86FPLogicOp - attempt to fold FAND/FOR/FXOR scalar nodes if they are constant or contain UNDEFs (#177947)
Fixes #177923
2026-01-26 13:30:12 +00:00
Mariusz Sikora
3c0f5045e1
[AMDGPU] Add FeatureGFX13 and SMEM encoding for gfx13 (#177567)
For now list of features is based on gfx12 and gfx1250

---------

Co-authored-by: Jay Foad <jay.foad@amd.com>
2026-01-26 14:16:36 +01:00
Simon Pilgrim
7cd5b2bffb
[X86] combineConcatVectorOps - concat(scalar_to_vector(extractelt(x,0)),scalar_to_vector(extractelt(y,0))) -> concat(x,y) (#177930)
Peek through free scalar_to_vector/extract_vector_elt pairs (of the same
vector width) that might still persist (ideally a better topological
sorting would have removed these already....)
2026-01-26 13:13:08 +00:00
Benjamin Maxwell
28bf8369c6
[AArch64][SDAG] Combine vecreduce.add(ZExt(predicate)) into cntp(predicate) (#176935)
This folds `vecreduce.add(ZExt(predicate))` into `cntp(predicate)`
before type legalization expands the "ZExt" for illegal types.
2026-01-26 11:47:09 +00:00
Julian Pokrovsky
5b4811eddb
[GlobalIsel] Enabling more rules for fp constant folding (#177902)
This PR extends GlobalISel to enable additional compile time constant
foldings

Resolves https://github.com/llvm/llvm-project/issues/86406
2026-01-26 11:55:15 +01:00
Sudharsan Veeravalli
3ed48305ab
[RISCV] Run combineOrToBitfieldInsert after DAG legalize (#177830)
Not combing `OR` into `QC.INSB(I)` before DAG legalization helps known
bits analysis to simplify the code if possible.
2026-01-26 15:43:00 +05:30
Simon Tatham
0921542e3b
[ARM] Count register copies when estimating function size (#175763)
`EstimateFunctionSizeInBytes`, in `ARMFrameLowering.cpp`, provides an
early estimate of the compiled size of a function, in a context that
wants to overestimate rather than underestimate.

In some cases it was underestimating severely, by over 20%. The
discrepancy was entirely accounted for by the fact that `COPY`
operations were not being counted at all, even though each one (or at
least each one that survives any post-regalloc optimizations) takes 2
bytes in Thumb or 4 in Arm. This could lead to a compile failure, if the
underestimated function size led frame lowering to not stack LR, but
later, `ARMConstantIslandsPass` needed to insert an intra-function
branch long enough to require a `bl` instruction, needing LR to have
been stacked.

The result of `EstimateFunctionSizeInBytes` was not directly available
for testing, so I added an `LLVM_DEBUG` at the end of the function. That
way, the test file doesn't need to try to make a >2048 byte function
estimated at <2048 bytes; it just needs to exhibit a function with a
single `COPY` and make sure it's counted.

At the moment, `EstimateFunctionSizeInBytes` is only used at all in
Thumb-1 compilations, to decide whether the function is large enough to
justify stacking LR as a precaution. However, the subroutine
`ARMBaseInstrInfo::getInstSizeInBytes` which counts each individual
`MachineInstr` is called from other contexts too, so I've made it return
a sensible answer for `COPY` nodes in both of Arm and Thumb.
2026-01-26 09:28:38 +00:00
Jim Lin
150c4d6b26
[M68k] Update llvm/test/CodeGen/M68k/pipeline.ll (#177910)
Due to https://github.com/llvm/llvm-project/pull/176172.
2026-01-26 09:22:31 +00:00
Ryan Mitchell
13b20e7aea
[AMDGPU][SILoadStoreOptimizer] Fix lds address operand offset (#176816)
The offset operand in GLOBAL_LOAD_ASYNC_TO_LDS_B128, for instance, is
added to both the lds and global address, but SILoadStoreOptimizer is
currently unaware of that. This PR inserts an add to counteract the
offset meant for the global address. This one add is better than not
doing the optimization at all, and having to insert 2 adds for each
global address calculation (with no offset).

```
; ENABLE-LABEL: name: promote_async_load_offset
; ENABLE: liveins: $ttmp7, $vgpr0, $sgpr0_sgpr1
; ENABLE-NEXT: {{  $}}
; ENABLE-NEXT: renamable $vgpr1 = V_LSHLREV_B32_e32 8, $vgpr0, implicit $exec
; ENABLE-NEXT: renamable $vgpr2, renamable $vcc_lo = V_ADD_CO_U32_e64 $vgpr0, 512, 0, implicit $exec
; ENABLE-NEXT: renamable $vgpr3, dead $sgpr_null = V_ADDC_U32_e64 0, killed $vgpr0, killed $vcc_lo, 0, implicit $exec
; ENABLE-NEXT: renamable $vgpr1 = disjoint V_OR_B32_e32 0, killed $vgpr1, implicit $exec
; ENABLE-NEXT: renamable $vgpr0 = V_ADD_U32_e32 256, $vgpr1, implicit $exec
; ENABLE-NEXT: GLOBAL_LOAD_ASYNC_TO_LDS_B128 killed $vgpr0, $vgpr2_vgpr3, -256, 0, implicit-def $asynccnt, implicit $exec, implicit $asynccnt :: (load store (s128), align 1, addrspace 3)
; ENABLE-NEXT: GLOBAL_LOAD_ASYNC_TO_LDS_B128 killed $vgpr1, killed $vgpr2_vgpr3, 0, 0, implicit-def $asynccnt, implicit $exec, implicit $asynccnt :: (load store (s128), align 1, addrspace 3)

; DISABLE-LABEL: name: promote_async_load_offset
; DISABLE: liveins: $ttmp7, $vgpr0, $sgpr0_sgpr1
; DISABLE-NEXT: {{  $}}
; DISABLE-NEXT: renamable $vgpr1 = V_LSHLREV_B32_e32 8, $vgpr0, implicit $exec
; DISABLE-NEXT: renamable $vgpr2, renamable $vcc_lo = V_ADD_CO_U32_e64 256, $vgpr0, 0, implicit $exec
; DISABLE-NEXT: renamable $vgpr3, $sgpr_null = V_ADDC_U32_e64 0, $vgpr0, killed $vcc_lo, 0, implicit $exec
; DISABLE-NEXT: renamable $vgpr1 = disjoint V_OR_B32_e32 0, killed $vgpr1, implicit $exec
; DISABLE-NEXT: GLOBAL_LOAD_ASYNC_TO_LDS_B128 $vgpr1, killed $vgpr2_vgpr3, 0, 0, implicit-def $asynccnt, implicit $exec, implicit $asynccnt :: (load store (s128), align 1, addrspace 3)
; DISABLE-NEXT: renamable $vgpr2, renamable $vcc_lo = V_ADD_CO_U32_e64 512, $vgpr0, 0, implicit $exec
; DISABLE-NEXT: renamable $vgpr3, $sgpr_null = V_ADDC_U32_e64 0, killed $vgpr0, killed $vcc_lo, 0, implicit $exec
; DISABLE-NEXT: GLOBAL_LOAD_ASYNC_TO_LDS_B128 killed $vgpr1, killed $vgpr2_vgpr3, 0, 0, implicit-def $asynccnt, implicit $exec, implicit $asynccnt :: (load store (s128), align 1, addrspace 3)
```

This PR also promotes the global address to an offset when the offset is
calculated with V_ADD_U64 on applicable gfx versions, (and inversely
adds the LDS offset), whereas previously the optimization opportunity
was missed entirely.
2026-01-26 09:23:17 +01:00
Alexander Richardson
fc2230f574
[RISC-V][MC] Introduce RVY extension feature
This adds the initial feature for the base RVY extension,
other extensions such as the hybrid mode will be added later.
RVY specification: https://riscv.github.io/riscv-cheri/

Co-authored-by: Jessica Clarke <jrtc27@jrtc27.com>
Co-authored-by: Petr Vesely <petr.vesely@codasip.com>

Pull Request: https://github.com/llvm/llvm-project/pull/176870
2026-01-25 22:05:31 -08:00
Fady Farag
eae75353f7
[NFC] Fix "FIMXE" typos to "FIXME" (#177895)
Replace common typo "FIMXE" with the intended "FIXME" across the
codebase.
2026-01-26 10:03:30 +05:30
valadaptive
cdc6a84c14
TargetLowering: Allow FMINNUM/FMAXNUM to lower to FMINIMUM/FMAXIMUM even without nsz (#177828)
This restriction was originally added in
https://reviews.llvm.org/D143256, with the given justification:

> Currently, in TargetLowering, if the target does not support fminnum,
we lower to fminimum if neither operand could be a NaN. But this isn't
quite correct because fminnum and fminimum treat +/-0 differently; so,
we need to prove that one of the operands isn't a zero.

As far as I can tell, this was never correct. Before
https://github.com/llvm/llvm-project/pull/172012, `minnum` and `maxnum`
were nondeterministic with regards to signed zero, so it's always been
perfectly legal to lower them to operations that order signed zeroes.
2026-01-25 18:24:12 -05:00