-
Notifications
You must be signed in to change notification settings - Fork 15.6k
[AMDGPU] Make VGPR_16_Lo128 allocatable #173309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rampitec
wants to merge
1
commit into
users/rampitec/fmamk_fmaak_t16-test
Choose a base branch
from
users/rampitec/make-vgpr16-lo128-allocatable
base: users/rampitec/fmamk_fmaak_t16-test
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[AMDGPU] Make VGPR_16_Lo128 allocatable #173309
rampitec
wants to merge
1
commit into
users/rampitec/fmamk_fmaak_t16-test
from
users/rampitec/make-vgpr16-lo128-allocatable
+13
−8
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Allows allocation of V_FMAMK_F16/V_FMAAK_F16 registers in real true16 mode.
Collaborator
Author
Member
|
@llvm/pr-subscribers-backend-amdgpu Author: Stanislav Mekhanoshin (rampitec) ChangesAllows allocation of V_FMAMK_F16/V_FMAAK_F16 registers in Full diff: https://github.com/llvm/llvm-project/pull/173309.diff 2 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/SIRegisterInfo.td b/llvm/lib/Target/AMDGPU/SIRegisterInfo.td
index 272d4b5609dfb..8d9fd3662b760 100644
--- a/llvm/lib/Target/AMDGPU/SIRegisterInfo.td
+++ b/llvm/lib/Target/AMDGPU/SIRegisterInfo.td
@@ -614,9 +614,9 @@ def VGPR_16 : SIRegisterClass<"AMDGPU", Reg16Types.types, 16,
def VGPR_16_Lo128 : SIRegisterClass<"AMDGPU", Reg16Types.types, 16,
(add (interleave (sequence "VGPR%u_LO16", 0, 127),
(sequence "VGPR%u_HI16", 0, 127)))> {
+ let AllocationPriority = !add(2, !mul(BaseClassPriority, BaseClassScaleFactor));
let Size = 16;
let GeneratePressureSet = 0;
- let isAllocatable = 0;
// This is the base class for VGPR{0..127}_{LO16,HI16}.
let BaseClassOrder = 16;
diff --git a/llvm/test/CodeGen/AMDGPU/fmamk_fmaak-t16.mir b/llvm/test/CodeGen/AMDGPU/fmamk_fmaak-t16.mir
index b3d9a56ef300e..3eec7f95a976f 100644
--- a/llvm/test/CodeGen/AMDGPU/fmamk_fmaak-t16.mir
+++ b/llvm/test/CodeGen/AMDGPU/fmamk_fmaak-t16.mir
@@ -1,10 +1,5 @@
-# RUN: not llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 -run-pass=machineverifier -filetype=null %s 2>&1 | FileCheck %s -check-prefix=GFX11
-# RUN: not llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 -start-before=greedy,0 -stop-after=virtregrewriter,2 -o - %s 2>&1 | FileCheck %s -check-prefix=GFX11
-
-# FIXME: There is no allocatable 16-bit VGPR class and these instructions
-# do not have VOP3 forms for allocatable VGPR_16 to be used.
-
-# GFX11: Cannot use non-allocatable class 'VGPR_16_Lo128' for virtual register
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 6
+# RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 -start-before=greedy,0 -stop-after=virtregrewriter,2 -o - %s | FileCheck %s -check-prefix=GFX11
---
name: v_fmamk_f16
@@ -12,6 +7,11 @@ tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0, $vgpr1
+ ; GFX11-LABEL: name: v_fmamk_f16
+ ; GFX11: liveins: $vgpr0, $vgpr1
+ ; GFX11-NEXT: {{ $}}
+ ; GFX11-NEXT: renamable $vgpr0_lo16 = nofpexcept V_FMAMK_F16_t16 killed $vgpr0_lo16, 1, killed $vgpr1_hi16, implicit $exec, implicit $mode
+ ; GFX11-NEXT: S_ENDPGM 0, implicit killed renamable $vgpr0_lo16
%0:vgpr_32_lo128 = COPY $vgpr0
%1:vgpr_32_lo128 = COPY $vgpr1
%2:vgpr_16_lo128 = nofpexcept V_FMAMK_F16_t16 %0.lo16, 1, %1.hi16, implicit $exec, implicit $mode
@@ -24,6 +24,11 @@ tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0, $vgpr1
+ ; GFX11-LABEL: name: v_fmaak_f16
+ ; GFX11: liveins: $vgpr0, $vgpr1
+ ; GFX11-NEXT: {{ $}}
+ ; GFX11-NEXT: renamable $vgpr0_lo16 = nofpexcept V_FMAAK_F16_t16 killed $vgpr0_lo16, killed $vgpr1_hi16, 1, implicit $exec, implicit $mode
+ ; GFX11-NEXT: S_ENDPGM 0, implicit killed renamable $vgpr0_lo16
%0:vgpr_32_lo128 = COPY $vgpr0
%1:vgpr_32_lo128 = COPY $vgpr1
%2:vgpr_16_lo128 = nofpexcept V_FMAAK_F16_t16 %0.lo16, %1.hi16, 1, implicit $exec, implicit $mode
|
This was referenced Dec 22, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allows allocation of V_FMAMK_F16/V_FMAAK_F16 registers in
real true16 mode.