Skip to content

Commit

Permalink
[AMDGPU] SIShrinkInstructions: sink code to where it's used. NFC.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfoad committed Dec 13, 2021
1 parent 6368152 commit 16de2c0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
Expand Up @@ -771,10 +771,6 @@ bool SIShrinkInstructions::runOnMachineFunction(MachineFunction &MF) {
const MachineOperand *SDst = TII->getNamedOperand(MI,
AMDGPU::OpName::sdst);

// Check the carry-in operand for v_addc_u32_e64.
const MachineOperand *Src2 = TII->getNamedOperand(MI,
AMDGPU::OpName::src2);

if (SDst) {
bool Next = false;

Expand All @@ -786,6 +782,8 @@ bool SIShrinkInstructions::runOnMachineFunction(MachineFunction &MF) {

// All of the instructions with carry outs also have an SGPR input in
// src2.
const MachineOperand *Src2 = TII->getNamedOperand(MI,
AMDGPU::OpName::src2);
if (Src2 && Src2->getReg() != VCCReg) {
if (Src2->getReg().isVirtual())
MRI.setRegAllocationHint(Src2->getReg(), 0, VCCReg);
Expand Down

0 comments on commit 16de2c0

Please sign in to comment.