Skip to content

Commit 080158a

Browse files
committed
[AMDGPU] Enable copy from VCC to SHARED_BASE.
1 parent 5a20b72 commit 080158a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,14 @@ void SIInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
845845
}
846846
}
847847

848+
if (AMDGPU::APERTURE_ClassRegClass.contains(DestReg)) {
849+
if (SrcReg == AMDGPU::VCC) {
850+
BuildMI(MBB, MI, DL, get(AMDGPU::S_MOV_B64), DestReg)
851+
.addReg(SrcReg, getKillRegState(KillSrc));
852+
return;
853+
}
854+
}
855+
848856
if (RC == &AMDGPU::VGPR_32RegClass) {
849857
assert(AMDGPU::VGPR_32RegClass.contains(SrcReg) ||
850858
AMDGPU::SReg_32RegClass.contains(SrcReg) ||

llvm/test/CodeGen/AMDGPU/sgpr-phys-copy.mir

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ body: |
6767
$vcc = COPY $src_shared_base
6868
...
6969

70+
---
71+
name: vcc_to_src_shared_base
72+
body: |
73+
bb.0:
74+
; GFX9-LABEL: name: vcc_to_src_shared_base
75+
; GFX9: $src_shared_base = S_MOV_B64 $vcc
76+
$src_shared_base = COPY $vcc
77+
...
78+
7079
---
7180
name: sgpr96_aligned_src_dst
7281
body: |

0 commit comments

Comments
 (0)