Skip to content

Commit aeb0225

Browse files
arsenmdmcdougall
authored andcommitted
AMDGPU: Mark v_mov_b64_pseudo as a VOP1 instruction (llvm#128677)
This is mostly true, and it tricks the rematerialization code into handling this without special casing it.
1 parent 0203927 commit aeb0225

File tree

4 files changed

+145
-90
lines changed

4 files changed

+145
-90
lines changed

llvm/lib/Target/AMDGPU/SIInstructions.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def V_MOV_B64_PSEUDO : VPseudoInstSI <(outs VReg_64:$vdst),
136136
let isMoveImm = 1;
137137
let SchedRW = [Write64Bit];
138138
let Size = 4;
139+
let VOP1 = 1; // Not entirely correct, but close enough.
139140
let UseNamedOperandTable = 1;
140141
}
141142

llvm/test/CodeGen/AMDGPU/remat-sop.mir

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,4 +653,24 @@ body: |
653653
S_ENDPGM 0
654654
...
655655

656-
656+
---
657+
name: test_remat_s_mov_b64_imm_pseudo
658+
tracksRegLiveness: true
659+
body: |
660+
bb.0:
661+
; GCN-LABEL: name: test_remat_s_mov_b64_imm_pseudo
662+
; GCN: renamable $sgpr0_sgpr1 = S_MOV_B64_IMM_PSEUDO 1
663+
; GCN-NEXT: renamable $sgpr2_sgpr3 = S_MOV_B64_IMM_PSEUDO 2
664+
; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
665+
; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr2_sgpr3
666+
; GCN-NEXT: renamable $sgpr0_sgpr1 = S_MOV_B64_IMM_PSEUDO 3
667+
; GCN-NEXT: S_NOP 0, implicit killed renamable $sgpr0_sgpr1
668+
; GCN-NEXT: S_ENDPGM 0
669+
%0:sgpr_64 = S_MOV_B64_IMM_PSEUDO 1
670+
%1:sgpr_64 = S_MOV_B64_IMM_PSEUDO 2
671+
%2:sgpr_64 = S_MOV_B64_IMM_PSEUDO 3
672+
S_NOP 0, implicit %0
673+
S_NOP 0, implicit %1
674+
S_NOP 0, implicit %2
675+
S_ENDPGM 0
676+
...

0 commit comments

Comments
 (0)