diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2017-01-11 22:35:17 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2017-01-11 22:35:17 +0000 |
commit | 28bd4cbeaf0093b90b1f38d2675bb0db999cac46 (patch) | |
tree | 57dbae3d4cd0c2bce4a131454387605cdf70333a /llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp | |
parent | 503162b4a1fc5d5274c08d5f8e317c2b8cb46ca0 (diff) | |
download | bcm5719-llvm-28bd4cbeaf0093b90b1f38d2675bb0db999cac46.tar.gz bcm5719-llvm-28bd4cbeaf0093b90b1f38d2675bb0db999cac46.zip |
AMDGPU: Fix breaking VOP3 v_add_i32s
This was shrinking the instruction even though the carry output
register was a virtual register, not known VCC.
llvm-svn: 291716
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp index b27d7c69103..650eb33c111 100644 --- a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp +++ b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp @@ -84,7 +84,7 @@ static bool canShrink(MachineInstr &MI, const SIInstrInfo *TII, // FIXME: v_cndmask_b32 has 3 operands and is shrinkable, but we need to add // a special case for it. It can only be shrunk if the third operand // is vcc. We should handle this the same way we handle vopc, by addding - // a register allocation hint pre-regalloc and then do the shrining + // a register allocation hint pre-regalloc and then do the shrinking // post-regalloc. if (Src2) { switch (MI.getOpcode()) { @@ -456,6 +456,16 @@ bool SIShrinkInstructions::runOnMachineFunction(MachineFunction &MF) { continue; } + // Check for the bool flag output for instructions like V_ADD_I32_e64. + const MachineOperand *SDst = TII->getNamedOperand(MI, + AMDGPU::OpName::sdst); + if (SDst && SDst->getReg() != AMDGPU::VCC) { + if (TargetRegisterInfo::isVirtualRegister(SDst->getReg())) + MRI.setRegAllocationHint(SDst->getReg(), 0, AMDGPU::VCC); + + continue; + } + // We can shrink this instruction DEBUG(dbgs() << "Shrinking " << MI); |