Skip to content

Commit a6512e8

Browse files
committed
[AMDGPU] Mark PC_ADD_REL_OFFSET rematerializable (llvm#79674)
This is cherrypick of llvm#79674 Currently machine LICM hoist PC_ADD_REL_OFFSET out of loops, causes register pressure when function calls are deep in loops. This is a main cause of sgpr spill for programs containing large number of function calls in loops. This patch marks PC_ADD_REL_OFFSET as rematerializable, which eliminates sgpr spills due to function calls in loops. Change-Id: I4aec3dfd93b13390ccbc69ab5048a3fe83c268c1
1 parent cecc76a commit a6512e8

File tree

4 files changed

+186
-161
lines changed

4 files changed

+186
-161
lines changed

llvm/lib/Target/AMDGPU/SIInstructions.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,7 @@ defm SI_SPILL_AV1024 : SI_SPILL_VGPR <AV_1024, 1>;
962962
let isConvergent = 1 in
963963
defm SI_SPILL_WWM_V32 : SI_SPILL_VGPR <VGPR_32>;
964964

965+
let isReMaterializable = 1, isAsCheapAsAMove = 1 in
965966
def SI_PC_ADD_REL_OFFSET : SPseudoInstSI <
966967
(outs SReg_64:$dst),
967968
(ins si_ga:$ptr_lo, si_ga:$ptr_hi),

0 commit comments

Comments
 (0)