File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1819,10 +1819,13 @@ bool SIFoldOperandsImpl::tryFoldClamp(MachineInstr &MI) {
1819
1819
if (!ClampSrc || !MRI->hasOneNonDBGUser (ClampSrc->getReg ()))
1820
1820
return false ;
1821
1821
1822
+ if (!ClampSrc->getReg ().isVirtual ())
1823
+ return false ;
1824
+
1822
1825
// 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 ());
1826
+ Register DefSrcReg = TRI-> lookThruCopyLike ( ClampSrc->getReg (), MRI );
1827
+ MachineInstr *Def =
1828
+ MRI-> getVRegDef (DefSrcReg. isVirtual ( ) ? DefSrcReg : ClampSrc->getReg ());
1826
1829
1827
1830
// The type of clamp must be compatible.
1828
1831
if (TII->getClampMask (*Def) != TII->getClampMask (MI))
You can’t perform that action at this time.
0 commit comments