[AMDGPU] SIShrinkInstructions: sink code to where it's used. NFC.

This commit is contained in:
Jay Foad 2021-12-13 14:45:50 +00:00
parent 63681527ee
commit 16de2c09dd
1 changed files with 2 additions and 4 deletions

View File

@ -771,10 +771,6 @@ bool SIShrinkInstructions::runOnMachineFunction(MachineFunction &MF) {
const MachineOperand *SDst = TII->getNamedOperand(MI, const MachineOperand *SDst = TII->getNamedOperand(MI,
AMDGPU::OpName::sdst); AMDGPU::OpName::sdst);
// Check the carry-in operand for v_addc_u32_e64.
const MachineOperand *Src2 = TII->getNamedOperand(MI,
AMDGPU::OpName::src2);
if (SDst) { if (SDst) {
bool Next = false; bool Next = false;
@ -786,6 +782,8 @@ bool SIShrinkInstructions::runOnMachineFunction(MachineFunction &MF) {
// All of the instructions with carry outs also have an SGPR input in // All of the instructions with carry outs also have an SGPR input in
// src2. // src2.
const MachineOperand *Src2 = TII->getNamedOperand(MI,
AMDGPU::OpName::src2);
if (Src2 && Src2->getReg() != VCCReg) { if (Src2 && Src2->getReg() != VCCReg) {
if (Src2->getReg().isVirtual()) if (Src2->getReg().isVirtual())
MRI.setRegAllocationHint(Src2->getReg(), 0, VCCReg); MRI.setRegAllocationHint(Src2->getReg(), 0, VCCReg);