[llvm] [AMDGPU] Handle `s_setreg_imm32_b32` targeting `MODE` register (PR #174681)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 7 10:18:18 PST 2026


================
@@ -18,6 +19,7 @@ define amdgpu_ps float @add_max_u32_svv(i32 inreg %a, i32 %b, i32 %c) {
 ; GCN-LABEL: add_max_u32_svv:
 ; GCN:       ; %bb.0:
 ; GCN-NEXT:    s_setreg_imm32_b32 hwreg(HW_REG_WAVE_MODE, 25, 1), 1
+; GCN-NEXT:    s_setreg_imm32_b32 hwreg(HW_REG_WAVE_MODE, 12, 8), 0
----------------
rampitec wrote:

I do not think you need to worry about the hole. You do not even need to update the mask, just set these 8 bits. If mask is correctly handled extra bits will be ignored, otherwise it will be set regardless of the mask and a hole.

https://github.com/llvm/llvm-project/pull/174681


More information about the llvm-commits mailing list