diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-09-04 17:12:57 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-09-04 17:12:57 +0000 |
commit | 84489b34f6f147b4de6127441f3051e0d0e08364 (patch) | |
tree | cadb66b916c27d26472ae6c527052ca5bc3a9b4b /llvm/lib/Target/AMDGPU/SIInstrInfo.cpp | |
parent | e6b26f2f91a3b80d6ee726ee1b6147d72252cc55 (diff) | |
download | bcm5719-llvm-84489b34f6f147b4de6127441f3051e0d0e08364.tar.gz bcm5719-llvm-84489b34f6f147b4de6127441f3051e0d0e08364.zip |
AMDGPU: Handle frame index expansion with no free SGPRs pre gfx9
Since an add instruction must produce an unused carry out, this
requires additional SGPRs. This can be avoided by keeping the entire
offset computation in SGPRs. If one SGPR is still available, this only
costs one extra mov. If none are available, the entire computation can
be done in place and reversed.
This does assume the use is a VGPR operand. This was already assumed,
and we currently only select frame indexes to VALU instructions. This
should probably be fixed at some point to handle more possible MIR.
llvm-svn: 370929
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIInstrInfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp index 7b7c34ed8a2..2a3a1b34094 100644 --- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp +++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp @@ -6098,7 +6098,7 @@ MachineInstrBuilder SIInstrInfo::getAddNoCarry(MachineBasicBlock &MBB, Register UnusedCarry = RS.scavengeRegister(RI.getBoolRC(), I, 0, false); // TODO: Users need to deal with this. if (!UnusedCarry.isValid()) - report_fatal_error("failed to scavenge unused carry-out SGPR"); + return MachineInstrBuilder(); return BuildMI(MBB, I, DL, get(AMDGPU::V_ADD_I32_e64), DestReg) .addReg(UnusedCarry, RegState::Define | RegState::Dead); |