forked from OSchip/llvm-project
AMDGPU: Minor cleanup of shrinking logic
llvm-svn: 307312
This commit is contained in:
parent
60b91e0ba2
commit
a81198d82d
|
@ -110,10 +110,8 @@ static bool canShrink(MachineInstr &MI, const SIInstrInfo *TII,
|
||||||
}
|
}
|
||||||
|
|
||||||
const MachineOperand *Src1 = TII->getNamedOperand(MI, AMDGPU::OpName::src1);
|
const MachineOperand *Src1 = TII->getNamedOperand(MI, AMDGPU::OpName::src1);
|
||||||
const MachineOperand *Src1Mod =
|
if (Src1 && (!isVGPR(Src1, TRI, MRI) ||
|
||||||
TII->getNamedOperand(MI, AMDGPU::OpName::src1_modifiers);
|
TII->hasModifiersSet(MI, AMDGPU::OpName::src1_modifiers)))
|
||||||
|
|
||||||
if (Src1 && (!isVGPR(Src1, TRI, MRI) || (Src1Mod && Src1Mod->getImm() != 0)))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// We don't need to check src0, all input types are legal, so just make sure
|
// We don't need to check src0, all input types are legal, so just make sure
|
||||||
|
@ -122,10 +120,8 @@ static bool canShrink(MachineInstr &MI, const SIInstrInfo *TII,
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Check output modifiers
|
// Check output modifiers
|
||||||
if (TII->hasModifiersSet(MI, AMDGPU::OpName::omod))
|
return !TII->hasModifiersSet(MI, AMDGPU::OpName::omod) &&
|
||||||
return false;
|
!TII->hasModifiersSet(MI, AMDGPU::OpName::clamp);
|
||||||
|
|
||||||
return !TII->hasModifiersSet(MI, AMDGPU::OpName::clamp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief This function checks \p MI for operands defined by a move immediate
|
/// \brief This function checks \p MI for operands defined by a move immediate
|
||||||
|
|
Loading…
Reference in New Issue