[AMDGPU] Add support for HW_REG_WAVE_SCHED_MODE#169840
Merged
Conversation
Member
|
@llvm/pr-subscribers-backend-amdgpu Author: None (lancesix) ChangesExpose HW_REG_WAVE_SCHED_MODE to the s_getreg_b32, s_setreg_b32, s_setreg_imm32_b32 instructions. Full diff: https://github.com/llvm/llvm-project/pull/169840.diff 3 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/SIDefines.h b/llvm/lib/Target/AMDGPU/SIDefines.h
index b7a92a0a1d634..192e1a0d7a812 100644
--- a/llvm/lib/Target/AMDGPU/SIDefines.h
+++ b/llvm/lib/Target/AMDGPU/SIDefines.h
@@ -541,6 +541,7 @@ enum Id { // HwRegCode, (6) [5:0]
ID_EXCP_FLAG_PRIV = 17,
ID_EXCP_FLAG_USER = 18,
ID_TRAP_CTRL = 19,
+ ID_SCHED_MODE = 26,
// GFX94* specific registers
ID_XCC_ID = 20,
diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp
index 6489e63d4f6b8..24d139b73d2b1 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp
@@ -208,6 +208,7 @@ static constexpr CustomOperand Operands[] = {
{{"HW_REG_HW_ID"}, ID_HW_ID1, isGFX10},
{{"HW_REG_SQ_PERF_SNAPSHOT_PC_LO"}, ID_SQ_PERF_SNAPSHOT_PC_LO, isGFX940},
{{"HW_REG_WAVE_HW_ID2"}, ID_HW_ID2, isGFX12Plus},
+ {{"HW_REG_WAVE_SCHED_MODE"}, ID_SCHED_MODE, isGFX12Plus},
{{"HW_REG_HW_ID2"}, ID_HW_ID2, isGFX10Plus},
{{"HW_REG_SQ_PERF_SNAPSHOT_PC_HI"}, ID_SQ_PERF_SNAPSHOT_PC_HI, isGFX940},
{{"HW_REG_POPS_PACKER"}, ID_POPS_PACKER, isGFX10},
diff --git a/llvm/test/MC/AMDGPU/gfx12_asm_sopk.s b/llvm/test/MC/AMDGPU/gfx12_asm_sopk.s
index 819ecb866c5ae..ba5159482df50 100644
--- a/llvm/test/MC/AMDGPU/gfx12_asm_sopk.s
+++ b/llvm/test/MC/AMDGPU/gfx12_asm_sopk.s
@@ -258,3 +258,12 @@ s_getreg_b32 s0, hwreg(HW_REG_SHADER_CYCLES_LO)
s_getreg_b32 s0, hwreg(HW_REG_SHADER_CYCLES_HI)
// GFX12: encoding: [0x1e,0xf8,0x80,0xb8]
+
+s_getreg_b32 s0, hwreg(HW_REG_WAVE_SCHED_MODE)
+// GFX12: encoding: [0x1a,0xf8,0x80,0xb8]
+
+s_setreg_b32 hwreg(HW_REG_WAVE_SCHED_MODE, 0, 2), s2
+// GFX12: encoding: [0x1a,0x08,0x02,0xb9]
+
+s_setreg_imm32_b32 hwreg(HW_REG_WAVE_SCHED_MODE), 0x2
+// GFX12: encoding: [0x1a,0xf8,0x80,0xb9,0x02,0x00,0x00,0x00]
|
jayfoad
reviewed
Nov 27, 2025
jayfoad
reviewed
Nov 27, 2025
🐧 Linux x64 Test Results
|
7859ef2 to
35b3d7b
Compare
Contributor
|
builders seem to be detecting errors in lit tests |
Expose HW_REG_WAVE_SCHED_MODE to the s_getreg_b32, s_setreg_b32, s_setreg_imm32_b32 instructions.
1013c5b to
7ab6454
Compare
ronlieb
pushed a commit
to ROCm/llvm-project
that referenced
this pull request
Nov 28, 2025
Expose HW_REG_WAVE_SCHED_MODE to the s_getreg_b32, s_setreg_b32, s_setreg_imm32_b32 instructions.
ronlieb
pushed a commit
to ROCm/llvm-project
that referenced
this pull request
Nov 28, 2025
Expose HW_REG_WAVE_SCHED_MODE to the s_getreg_b32, s_setreg_b32, s_setreg_imm32_b32 instructions.
ronlieb
added a commit
to ROCm/llvm-project
that referenced
this pull request
Nov 29, 2025
Expose HW_REG_WAVE_SCHED_MODE to the s_getreg_b32, s_setreg_b32, s_setreg_imm32_b32 instructions. Co-authored-by: lancesix <lancelot.six@amd.com>
aahrun
pushed a commit
to aahrun/llvm-project
that referenced
this pull request
Dec 1, 2025
Expose HW_REG_WAVE_SCHED_MODE to the s_getreg_b32, s_setreg_b32, s_setreg_imm32_b32 instructions.
augusto2112
pushed a commit
to augusto2112/llvm-project
that referenced
this pull request
Dec 3, 2025
Expose HW_REG_WAVE_SCHED_MODE to the s_getreg_b32, s_setreg_b32, s_setreg_imm32_b32 instructions.
kcloudy0717
pushed a commit
to kcloudy0717/llvm-project
that referenced
this pull request
Dec 4, 2025
Expose HW_REG_WAVE_SCHED_MODE to the s_getreg_b32, s_setreg_b32, s_setreg_imm32_b32 instructions.
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
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.
Expose HW_REG_WAVE_SCHED_MODE to the s_getreg_b32, s_setreg_b32, s_setreg_imm32_b32 instructions.