8456 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
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
Matt Arsenault
3f62718c4a
AMDGPU: Migrate some tests away from undef (#131277) 2025-03-15 00:29:10 +07: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
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
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
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
Brox Chen
15a5b3a192
[AMDGPU][True16][CodeGen] gisel true16 for ICMP (#128913)
GlobalIsel true16 selection for ICMP
2025-03-13 12:03:17 -04:00
Matt Arsenault
c3c97eab12
PeepholeOpt: Do not skip reg_sequence sources with subregs (#125667)
Contrary to the comment, this particular code is not responsible
for handling any composes that may be required, and unhandled cases
are already rejected later. Lift this restriction to permit composes
and reg_sequence subregisters later.
2025-03-13 21:49:16 +07:00
Matt Arsenault
e3c80d4496
AMDGPU: Fix broken negative test from ancient times (#131106)
Before the dawn of civilization, instructions were printed in all
caps using the raw tablegen pseudo-names. This -NOT check was looking
for that, instead of the actual ISA output. Just switch to using generated
checks. Also replace a use of undef.
2025-03-13 21:40:30 +07:00
Matt Arsenault
94c8fa61d6
AMDGPU: Replace some test i32 undef uses with poison (#131092) 2025-03-13 20:10:17 +07:00
Matt Arsenault
024df9c9dc
AMDGPU: Replace some float undef test uses with poison (#131090) 2025-03-13 20:07:48 +07:00
Matt Arsenault
1eb5588457
AMDGPU: Replace i16 undefs with poison in tests (#131084) 2025-03-13 18:52:49 +07:00
Matt Arsenault
f613bc57c6
AMDGPU: Replace half undef uses with poison in tests (#131083) 2025-03-13 18:47:01 +07:00
Ana Mihajlovic
459b4e3fe1
Reland "[AMDGPU] Remove s_delay_alu for VALU->SGPR->SALU (#127212)" (#131111)
We have a VALU->SGPR->SALU (VALU writing to SGPR and SALU reading from
it). When VALU is issued, it increments internal counter VA_SDST used to
track use of this SGPR. SALU will not issue until VA_SDST is zero, that
is when VALU is finished writing. Therefore, delays added by s_delay_alu
are not needed in this situation.
2025-03-13 10:26:20 +01:00
Akshat Oke
5952972c91
[CodeGen][NPM] Port BranchFolder to NPM (#128858)
EnableTailMerge is false by default and is handled by the pass builder.
Passes are independent of target pipeline options.

This completes the generic `MachineLateOptimization` passes for the NPM
pipeline.
2025-03-13 13:41:28 +05:30
Matt Arsenault
9e91725fd4
AMDGPU: Replace some undef uses in test metadata with poison (#131052) 2025-03-13 13:43:48 +07:00
Matt Arsenault
26ae98c4d7
AMDGPU: Replace undef global initializers in tests with poison (#131051) 2025-03-13 13:41:03 +07:00
Matt Arsenault
7811075b6f
AMDGPU: Replace ptr undef in tests with poison (#131050) 2025-03-13 13:34:52 +07:00
Matt Arsenault
331250c6fa
AMDGPU: Replace ptr addrspace(3) undef in tests with poison (#131049) 2025-03-13 13:28:55 +07:00
LU-JOHN
95e186cadf
Reland "DAG: Preserve range metadata when load is narrowed" (#128144) (#130609)
Changes: Add guard to ensure truncation is strictly smaller than
original size.

---------

Signed-off-by: John Lu <John.Lu@amd.com>
2025-03-13 12:47:03 +07:00
Matt Arsenault
12fe5ae88c
AMDGPU: Replace ptr addrspace(8) undef uses with poison (#130904) 2025-03-13 08:37:51 +07:00
Matt Arsenault
e1e44dfcad
AMDGPU: Replace <8 x i32> undef uses in tests with poison (#130903) 2025-03-13 08:31:57 +07:00
Matt Arsenault
c182f4042a
AMDGPU: Replace <4 x i32> undef uses in tests with poison (#130902)
Most of these are from resource descriptors.
2025-03-13 08:28:48 +07:00
Matt Arsenault
6705d812b8
AMDGPU: Replace ptr addrspace(1) undefs with poison (#130900)
Many tests use store to undef as a placeholder use, so just replace
all of these with poison.
2025-03-13 08:25:02 +07:00
Brox Chen
c8047c6dbc
[AMDGPU][True16][CodeGen] update test for buildbot failure (#131028)
This is a NFC patch

https://github.com/llvm/llvm-project/pull/103366 hit a buildbot failure
with i1-to-bf16.ll. Update the test to fix the build.

Also remove duplicated comments added in
https://github.com/llvm/llvm-project/pull/103366
2025-03-12 16:59:48 -04:00
Brox Chen
9d7e1d92db
[AMDGPU][True16] added Pre-RA hint to improve copy elimination (#103366)
The allocation order of 16 bit registers is vgpr0lo16, vgpr0hi16,
vgpr1lo16, vgpr1hi16, vgpr2lo16.... We prefer (essentially require) that
allocation order, because it uses the minimum number of registers. But
when you have 16 bit data passing between 16 and 32 bit instructions you
get lots of COPY.

This patch teach the compiler that a COPY of a 16-bit value from a 32
bit register to a lo-half 16 bit register is free, to a hi-half 16 bit
register is not.

This might get improved to coalescing with additional cases, and perhaps
as an alternative to the RA hints. For now upstreaming this solution
first.
2025-03-12 16:12:58 -04:00
Kazu Hirata
aa008e0008 Revert "[AMDGPU] Remove s_delay_alu for VALU->SGPR->SALU (#127212)"
This reverts commit 71582c6667a6334c688734cae628e906b3c1ac1d.

Multiple buildbot failures have been reported:
https://github.com/llvm/llvm-project/pull/127212
2025-03-12 12:09:09 -07:00
Ana Mihajlovic
71582c6667
[AMDGPU] Remove s_delay_alu for VALU->SGPR->SALU (#127212)
We have a VALU->SGPR->SALU (VALU writing to SGPR and SALU reading from
it). When VALU is issued, it increments internal counter VA_SDST used to
track use of this SGPR. SALU will not issue until VA_SDST is zero, that
is when VALU is finished writing. Therefore, delays added by s_delay_alu
are not needed in this situation.
2025-03-12 09:33:07 -07:00
Matt Arsenault
b76e396990
AMDGPU: Replace tests using undef in shufflevector with poison (#130899) 2025-03-12 20:45:02 +07:00
Matt Arsenault
1d0dd76eec
AMDGPU: Replace insertelement undef with poison in cases with manual updates (#130898)
I had to manually intervene in a few tests. fcanonicalize.f16.ll is directly sensitive
to undef vs. poison.
2025-03-12 20:36:46 +07:00
Matt Arsenault
da42b2f67d
AMDGPU: Replace insertelement poison with insertelement undef (#130896)
This is the bulk update with perl, with cases which require additional
update left for later.
2025-03-12 20:33:33 +07:00
Pedro Lobo
15136f1c09
[AMDGPU] Change placeholder from undef to poison (#130853)
Call `insertelement` with `poison` instead of `undef`.
2025-03-12 12:52:38 +00:00