Skip to content

Commit 49bd463

Browse files
committed
[AMDGPU] Mark PC_ADD_REL_OFFSET rematerializable
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. It significantly improves performance of HIP apps which have large number of function calls, e.g., Blender.
1 parent 223025a commit 49bd463

File tree

4 files changed

+168
-143
lines changed

4 files changed

+168
-143
lines changed

llvm/lib/Target/AMDGPU/SIInstructions.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,7 @@ let isConvergent = 1 in {
10361036
defm SI_SPILL_WWM_AV32 : SI_SPILL_VGPR <AV_32, 1>;
10371037
}
10381038

1039+
let isReMaterializable = 1, isAsCheapAsAMove = 1 in
10391040
def SI_PC_ADD_REL_OFFSET : SPseudoInstSI <
10401041
(outs SReg_64:$dst),
10411042
(ins si_ga:$ptr_lo, si_ga:$ptr_hi),

0 commit comments

Comments
 (0)