57901 Commits

Author SHA1 Message Date
Matt Arsenault
f75d75b889
AMDGPU: Use MFPropsModifier modifier in SIFoldOperands (#127752)
This doesn't appear to work. I do not get an error in the new PM.

---------

Co-authored-by: Akshat Oke <Akshat.Oke@amd.com>
2025-03-17 13:37:34 +07:00
Hua Tian
b09b9ac108
[llvm][CodeGen] Fix the empty interval issue in Window Scheduler (#129204)
The interval of newly generated reg in ModuloScheduleExpander is empty.
This will cause crash at some corner case. This patch recalculate the
live intervals of these regs.
2025-03-17 14:28:47 +08:00
Akshat Oke
687c9d359e
[CodeGen][NPM] Port FEntryInserter to NPM (#129857) 2025-03-17 10:35:53 +05:30
Jim Lin
2a2d6d61b1 [RISCV] Remove unused check prefixes from half arith strict test. NFC 2025-03-17 12:51:39 +08:00
Fangrui Song
81ba006296
[X86] nocf_check: disable tail call
When a function pointer is annotated with
`void (*fptr)(void) __attribute__((nocf_check));`, calling it should use
the NOTRACK prefix, as the callee may not contain an ENDBR.

https://reviews.llvm.org/D41879 implemented NOTRACK variants for
X86ISD::CALL and ISD::BRIND but not for TCRETURN. Given that there are
so many tail call variants (e.g. conditional tailcall
https://reviews.llvm.org/D29856), let's just disable tailcall.
While nocf_check has some uses within the Linux kernel, it isn't a
popular attribute.

Fix #91228

Pull Request: https://github.com/llvm/llvm-project/pull/131487
2025-03-16 16:18:14 -07:00
David Green
90e6ba606f [AArch64][GlobalISel] Remove min/max v2s64 clamp
We can now lower the icmp, allowing us to remove the FIXME.
2025-03-16 09:49:22 +00:00
David Green
3fac23505f [AArch64][GlobalISel] Add cttz, ctlz and ctpop test coverage. NFC 2025-03-16 09:49:22 +00:00
Pedro Lobo
de03e102d1
[DirectX] Change placeholders from undef to poison used in fully instantiated vector [NFC] (#130970) 2025-03-16 09:47:48 +00:00
Hubert Tong
2091547d4c [PPC codegen test] NFC: Fix RUN line; fix DATA checks to match 64-bit 2025-03-15 21:20:22 -04:00
Ulrich Weigand
f4ea1055ad [SystemZ] Implement i128 funnel shifts
These can be handled via the VECTOR SHIFT LEFT/RIGHT DOUBLE
family of instructions, depending on architecture level.

Fixes: https://github.com/llvm/llvm-project/issues/129955
2025-03-15 18:28:44 +01:00
Ulrich Weigand
4155cc0fb3 [SystemZ] Recognize carry/borrow computation
Generate code using the VECTOR ADD COMPUTE CARRY and
VECTOR SUBTRACT COMPUTE BORROW INDICATION instructions
to implement open-coded IR with those semantics.

Handles integer vector types as well as i128.

Fixes: https://github.com/llvm/llvm-project/issues/129608
2025-03-15 18:28:44 +01:00
Ulrich Weigand
4a4987be36 [SystemZ] Optimize vector zero/sign extensions
Generate more efficient code for zero or sign extensions where
the source is a subvector generated via SHUFFLE_VECTOR.

Specifically, recognize patterns corresponding to (series of)
VECTOR UNPACK instructions, or the VECTOR SIGN EXTEND TO
DOUBLEWORD instruction.

As a special case, also handle zero or sign extensions of a
vector element to i128.

Fixes: https://github.com/llvm/llvm-project/issues/129576
Fixes: https://github.com/llvm/llvm-project/issues/129899
2025-03-15 18:28:44 +01:00
Ulrich Weigand
cdc7864986 [SystemZ] Optimize widening and high-word vector multiplication
Detect (non-intrinsic) IR patterns corresponding to the semantics
of the various widening and high-word multiplication instructions.

Specifically, this is done by:
- Recognizing even/odd widening multiplication patterns in DAGCombine
- Recognizing widening multiply-and-add on top during ISel
- Implementing the standard MULHS/MUHLU IR opcodes
- Detecting high-word multiply-and-add (which common code does not)

Depending on architecture level, this can support all integer
vector types as well as the scalar i128 type.

Fixes: https://github.com/llvm/llvm-project/issues/129705
2025-03-15 18:28:44 +01:00
Ulrich Weigand
7af3d3929e [SystemZ] Optimize vector comparison reductions
Generate efficient code using the condition code set by the
VECTOR (FP) COMPARE family of instructions to implement
vector comparison reductions, e.g. as resulting from
__builtin_reduce_and/or of some vector comparsion.

Fixes: https://github.com/llvm/llvm-project/issues/129434
2025-03-15 18:28:44 +01:00
Phoebe Wang
254951749f
[X86][APX] Remove the EFLAGS def operand rather than the last one (#131430)
The last one may be an implict use, e.g.,
`IDIV32r %4:gr32, implicit-def dead $eax, implicit-def $edx,
implicit-def dead $eflags, implicit $eax, implicit $edx`

https://godbolt.org/z/KPKzj5c8K
2025-03-15 16:37:38 +08:00
Brox Chen
0f1175c8ad
[AMDGPU][True16][CodeGen] enable true16 for more codegen test patch 3 (#131212)
This is a NFC patch.

Enable true16 mode for more CodeGen tests
2025-03-14 14:58:10 -04:00
Brox Chen
b1fe7dabce
[AMDGPU][True16][CodeGen] enable true16 for more codegen test patch 2 (#131210)
This is a NFC patch.

Enable true16 mode for more CodeGen tests
2025-03-14 14:57:55 -04:00
Brox Chen
0b688f3ce1
[AMDGPU][True16][CodeGen] enable true16 for more codegen test patch 1 (#131206)
This is a NFC patch.

Enable true16 mode for more CodeGen tests
2025-03-14 14:57:42 -04:00
Simon Pilgrim
3ec693d352
[X86] combineConcatVectorOps - use ConcatSubOperand for X86ISD::VPERMV operand concatenation (#131352)
More aggressively concatenate operands
2025-03-14 18:07:19 +00:00
Matthias Braun
e6382f2111
SelectionDAG: neg (and x, 1) --> SIGN_EXTEND_INREG x, i1 (#131239)
The pattern
```LLVM
%shl = shl i32 %x, 31
%ashr = ashr i32 %shl, 31
```
would be combined to `SIGN_EXTEND_INREG %x, ValueType:ch:i1` by
SelectionDAG.
However InstCombine normalizes this pattern to:
```LLVM
%and = and i32 %x, 1
%neg = sub i32 0, %and
```
This adds matching code to DAGCombiner to catch this variant as well.
2025-03-14 10:47:56 -07:00
Simon Pilgrim
352b9e65be [X86] combineConcatVectorOps - extend ISD::ROTLI/VROTRI handling to support 256-bit types
Add checks that we aren't concatenating 128-bit X86ISD::VPERMI nodes.
2025-03-14 17:34:27 +00:00
Matt Arsenault
3f62718c4a
AMDGPU: Migrate some tests away from undef (#131277) 2025-03-15 00:29:10 +07:00
Matt Arsenault
87a55191a5
MIR: Replace undef with poison in some MIR tests (#131282)
The IR doesn't matter so much in these.
2025-03-15 00:20:18 +07:00
Simon Pilgrim
a8949b16e6 [X86] Add test coverage showing failure to concatenate matching rotate nodes 2025-03-14 17:02:46 +00:00
Brox Chen
cd54d581b5
[AMDGPU][True16][CodeGen] add v_cndmask_t16 to hazardmask (#128912)
add v_cndmask_t16 to hazardmask
2025-03-14 12:31:57 -04:00
Jeremy Morse
792a6f8119
[RemoveDIs] Remove "try-debuginfo-iterators..." test flags (#130298)
These date back to when the non-intrinsic format of variable locations
was still being tested and was behind a compile-time flag, so not all
builds / bots would correctly run them. The solution at the time, to get
at least some test coverage, was to have tests opt-in to non-intrinsic
debug-info if it was built into LLVM.

Nowadays, non-intrinsic format is the default and has been on for more
than a year, there's no need for this flag to exist.

(I've downgraded the flag from "try" to explicitly requesting
non-intrinsic format in some places, so that we can deal with tests that
are explicitly about non-intrinsic format in their own commit).
2025-03-14 15:50:49 +00:00
Simon Pilgrim
42ddb55017
[X86] combineINSERT_SUBVECTOR - peek through bitcasts to find a concatenation of subvector shuffles (#131331)
Extend existing concat(shuffle(),shuffle(),..) shuffle combining to handle mixed bitcasts such as concat(shuffle(),bitcast(shuffle()),...)
2025-03-14 15:27:50 +00:00
Hans Wennborg
52cd27e60b Revert "[Aarch64] [ISel] Don't save vaargs registers if vaargs are unused (#126780)"
This caused miscompiles on windows arm64, see comment on the PR.

This reverts commit e122483762b44c7f4386165099ff2a404705d7d4.
2025-03-14 16:20:03 +01:00
Frederik Harwath
6962cf1700
Rename ExpandLargeFpConvertPass to ExpandFpPass (#131128)
This is meant as a preparation for PR #130988 "[AMDGPU] Implement IR
expansion for frem instruction" which implements the expansion of
another instruction in this pass. The more general name seems more
appropriate given this change and quite reasonable even without it.
2025-03-14 13:11:45 +01:00
Simon Pilgrim
73e93ec3a2
[X86] combineConcatVectorOps - attempt to recursively call combineConcatVectorOps from inside ConcatSubOperand. (#131303)
Before falling back to creating a generic ISD::CONCAT_VECTORS node, see if we can directly concat the subvectors if we peek through any bitcasts.
2025-03-14 12:09:54 +00:00
Matt Arsenault
11d35a0a94
AMDGPU: Use generated checks in coalescer_distribute.ll (#131276)
Also replace the undef with poison.
2025-03-14 18:21:55 +07:00
Matt Arsenault
a9843ac285
AMDGPU: Use generated checks in unchecked test (#131275)
Also replace undef uses
2025-03-14 18:18:01 +07:00
Viktoria Maximova
a58a6a95b0
[SPIR-V] Support SPV_INTEL_fp_max_error extension for !fpmath metadata (#130619)
Specification:

https://github.khronos.org/SPIRV-Registry/extensions/INTEL/SPV_INTEL_fp_max_error.html
2025-03-14 12:12:28 +01:00
Sander de Smalen
9af538420a
[AArch64][GISel] Fix lowering of fp16 intrinsics (#130156)
This addresses the issue described in
https://github.com/llvm/llvm-project/issues/128843
2025-03-14 11:06:10 +00:00
Matt Arsenault
7bae61370d
AMDGPU: Use generated tests in reg-coalescer-sched-crash.ll test (#131259)
This wasn't checking anything. Also remove undef uses.
2025-03-14 16:04:55 +07:00
Matt Arsenault
4c1a1a5bf3
AMDGPU: Add generated checks to compile only test (#131258)
Also replace an undef use
2025-03-14 16:01:47 +07:00
Shilei Tian
75cf046f03 Re-apply "[AMDGPU] Fix test failures when expensive checks are enabled (#130644)"
As suggested on
5ec884e5d8 (commitcomment-153707488)
this seems to fix the following tests when building with -DLLVM_ENABLE_EXPENSIVE_CHECKS=ON:

  LLVM :: CodeGen/AMDGPU/materialize-frame-index-sgpr.gfx10.ll
  LLVM :: CodeGen/AMDGPU/materialize-frame-index-sgpr.ll
  LLVM :: CodeGen/AMDGPU/schedule-amdgpu-tracker-physreg-crash.ll

> This PR fixes test failures introduced in #127353 when expensive checks
> are enabled.
>
> For `llvm/test/CodeGen/AMDGPU/materialize-frame-index-sgpr.ll` and
> `llvm/test/CodeGen/AMDGPU/materialize-frame-index-sgpr.gfx10.ll`, `s59`
> is no longer in live-ins because it is caller saved. Switch to `s55` in
> this PR.
2025-03-14 09:49:20 +01:00
Matt Arsenault
9b83ffb5c6
AMDGPU: Switch a test to generated checks which only tested labels (#131257)
Also remove an undef use
2025-03-14 14:54:46 +07:00
Matt Arsenault
8d0205f6dd
AMDGPU: Remove undef in subreg-coalescer-crash.ll (#131256) 2025-03-14 14:51:46 +07:00
Matt Arsenault
3529c64dbc
AMDGPU: Switch a test with only function label checks to generated (#131255)
I suspect the first function at least is not usefully testing
the original failure.
2025-03-14 14:48:04 +07:00
Matt Arsenault
ac94ccd564
AMDGPU: Replace undef references with poison in some MIR tests (#131254) 2025-03-14 14:45:49 +07:00
Matt Arsenault
17eb7777c0
AMDGPU: Use generated checks in test missing checks (#131110) 2025-03-14 14:42:47 +07:00
Akshat Oke
87916f8c32
[CodeGen][NPM] Port MachineBlockPlacement to NPM (#129828) 2025-03-14 10:31:53 +05:30
Akshat Oke
f34385dd1b
[AMDGPU][NPM] Port GCNCreateVOPD to NPM (#130059) 2025-03-14 10:22:45 +05:30
Matt Arsenault
910514c6ab
AMDGPU: Replace some test undef uses with poison (#131103) 2025-03-14 09:56:47 +07:00
Matt Arsenault
06c379a349
AMDGPU: Replace more undef test pointer uses with poison (#131102) 2025-03-14 09:53:45 +07:00
Matt Arsenault
37c8792e53
AMDGPU: Replace test uses of ptr addrspace(5) undef with poison (#131101) 2025-03-14 09:50:48 +07:00
Matt Arsenault
ad993687b1
AMDGPU: Replace ptr addrspace(4) undef uses with poison in tests (#131095) 2025-03-14 09:47:54 +07:00
Simon Pilgrim
688d7a5d0a
[X86] combineConcatVectorOps - extend ISD::VECTOR_SHUFFLE handling to support 512-bit types (#131189)
Limit cases to AVX512 targets that support two-operand crosslane
shuffles
2025-03-13 20:36:49 +00:00
aankit-ca
d642eec78f
[HEXAGON] Fix semantics of ordered FP compares (#131089)
For the ordered FP compare bitcode instructions, the Hexagon backend was
assuming that no operand could be a NaN. This assumption is flawed. This
patch fixes the code-generation to produce fpcmp.uo and and appropriate
bit comparison operators to account for the case when an operand to a FP
compare is a NaN.

Fix for https://github.com/llvm/llvm-project/issues/129391

Co-authored-by: aankit-quic <aankit@quicinc.com>
2025-03-13 14:48:31 -05:00