Skip to content

Commit e9d0543

Browse files
committed
use lookthrucopylike
1 parent e261621 commit e9d0543

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Target/AMDGPU/SIFoldOperands.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,9 +1820,9 @@ bool SIFoldOperandsImpl::tryFoldClamp(MachineInstr &MI) {
18201820
return false;
18211821

18221822
// Look through COPY. COPY only observed with True16.
1823-
MachineOperand *DefSrc = lookUpCopyChain(*TII, *MRI, ClampSrc->getReg());
1824-
MachineInstr *Def = MRI->getVRegDef(
1825-
DefSrc && DefSrc->isReg() ? DefSrc->getReg() : ClampSrc->getReg());
1823+
Register DefSrcReg = TRI->lookThruCopyLike(ClampSrc->getReg(), MRI);
1824+
MachineInstr *Def =
1825+
MRI->getVRegDef(DefSrcReg.isVirtual() ? DefSrcReg : ClampSrc->getReg());
18261826

18271827
// The type of clamp must be compatible.
18281828
if (TII->getClampMask(*Def) != TII->getClampMask(MI))

0 commit comments

Comments
 (0)