[llvm] [AMDGPU] Do not fold an immediate into instructions with frame indexes (PR #151263)

Changpeng Fang via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 00:28:56 PDT 2025


================
@@ -1933,7 +1934,8 @@ define amdgpu_kernel void @store_load_large_imm_offset_kernel() {
 ; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s9
 ; GFX10-NEXT:    v_mov_b32_e32 v0, 13
 ; GFX10-NEXT:    v_mov_b32_e32 v1, 15
-; GFX10-NEXT:    s_movk_i32 s0, 0x3e84
----------------
changpeng wrote:

> The codegen looks better in the original case. It is true for most of the lit-test changes introduced in this patch. Was this move originally incorrect? Or this code bloat is a side-effect of this fix?

If an instruction has both FI and imm operands, it could possibly result in two immediate. So this is to fix the correctness issue conservatively.

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


More information about the llvm-commits mailing list