mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-15 17:07:52 +00:00
AMDGPU: Rename spill operands to match real instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281823 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
077ab85e5a
commit
28d052241c
@ -1210,8 +1210,8 @@ multiclass SI_SPILL_VGPR <RegisterClass vgpr_class> {
|
||||
SchedRW = [WriteVMEM] in {
|
||||
def _SAVE : VPseudoInstSI <
|
||||
(outs),
|
||||
(ins vgpr_class:$vdata, i32imm:$vaddr, SReg_128:$scratch_rsrc,
|
||||
SReg_32:$scratch_offset, i32imm:$offset)> {
|
||||
(ins vgpr_class:$vdata, i32imm:$vaddr, SReg_128:$srsrc,
|
||||
SReg_32:$soffset, i32imm:$offset)> {
|
||||
let mayStore = 1;
|
||||
let mayLoad = 0;
|
||||
// (2 * 4) + (8 * num_subregs) bytes maximum
|
||||
@ -1220,7 +1220,7 @@ multiclass SI_SPILL_VGPR <RegisterClass vgpr_class> {
|
||||
|
||||
def _RESTORE : VPseudoInstSI <
|
||||
(outs vgpr_class:$vdata),
|
||||
(ins i32imm:$vaddr, SReg_128:$scratch_rsrc, SReg_32:$scratch_offset,
|
||||
(ins i32imm:$vaddr, SReg_128:$srsrc, SReg_32:$soffset,
|
||||
i32imm:$offset)> {
|
||||
let mayStore = 0;
|
||||
let mayLoad = 1;
|
||||
|
@ -488,9 +488,9 @@ void SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
|
||||
Size, Align);
|
||||
BuildMI(*MBB, MI, DL, TII->get(AMDGPU::SI_SPILL_V32_SAVE))
|
||||
.addReg(TmpReg, RegState::Kill) // src
|
||||
.addFrameIndex(Index) // frame_idx
|
||||
.addReg(MFI->getScratchRSrcReg()) // scratch_rsrc
|
||||
.addReg(MFI->getScratchWaveOffsetReg()) // scratch_offset
|
||||
.addFrameIndex(Index) // vaddr
|
||||
.addReg(MFI->getScratchRSrcReg()) // srrsrc
|
||||
.addReg(MFI->getScratchWaveOffsetReg()) // soffset
|
||||
.addImm(i * 4) // offset
|
||||
.addMemOperand(MMO);
|
||||
}
|
||||
@ -546,9 +546,9 @@ void SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
|
||||
PtrInfo, MachineMemOperand::MOLoad, Size, Align);
|
||||
|
||||
BuildMI(*MBB, MI, DL, TII->get(AMDGPU::SI_SPILL_V32_RESTORE), TmpReg)
|
||||
.addFrameIndex(Index) // frame_idx
|
||||
.addReg(MFI->getScratchRSrcReg()) // scratch_rsrc
|
||||
.addReg(MFI->getScratchWaveOffsetReg()) // scratch_offset
|
||||
.addFrameIndex(Index) // vaddr
|
||||
.addReg(MFI->getScratchRSrcReg()) // srsrc
|
||||
.addReg(MFI->getScratchWaveOffsetReg()) // soffset
|
||||
.addImm(i * 4) // offset
|
||||
.addMemOperand(MMO);
|
||||
BuildMI(*MBB, MI, DL,
|
||||
@ -576,8 +576,8 @@ void SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
|
||||
case AMDGPU::SI_SPILL_V32_SAVE:
|
||||
buildScratchLoadStore(MI, AMDGPU::BUFFER_STORE_DWORD_OFFSET,
|
||||
TII->getNamedOperand(*MI, AMDGPU::OpName::vdata),
|
||||
TII->getNamedOperand(*MI, AMDGPU::OpName::scratch_rsrc)->getReg(),
|
||||
TII->getNamedOperand(*MI, AMDGPU::OpName::scratch_offset)->getReg(),
|
||||
TII->getNamedOperand(*MI, AMDGPU::OpName::srsrc)->getReg(),
|
||||
TII->getNamedOperand(*MI, AMDGPU::OpName::soffset)->getReg(),
|
||||
FrameInfo.getObjectOffset(Index) +
|
||||
TII->getNamedOperand(*MI, AMDGPU::OpName::offset)->getImm(), RS);
|
||||
MI->eraseFromParent();
|
||||
@ -591,8 +591,8 @@ void SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
|
||||
case AMDGPU::SI_SPILL_V512_RESTORE: {
|
||||
buildScratchLoadStore(MI, AMDGPU::BUFFER_LOAD_DWORD_OFFSET,
|
||||
TII->getNamedOperand(*MI, AMDGPU::OpName::vdata),
|
||||
TII->getNamedOperand(*MI, AMDGPU::OpName::scratch_rsrc)->getReg(),
|
||||
TII->getNamedOperand(*MI, AMDGPU::OpName::scratch_offset)->getReg(),
|
||||
TII->getNamedOperand(*MI, AMDGPU::OpName::srsrc)->getReg(),
|
||||
TII->getNamedOperand(*MI, AMDGPU::OpName::soffset)->getReg(),
|
||||
FrameInfo.getObjectOffset(Index) +
|
||||
TII->getNamedOperand(*MI, AMDGPU::OpName::offset)->getImm(), RS);
|
||||
MI->eraseFromParent();
|
||||
|
Loading…
x
Reference in New Issue
Block a user