File tree Expand file tree Collapse file tree 1 file changed +11
-15
lines changed
llvm/lib/CodeGen/GlobalISel Expand file tree Collapse file tree 1 file changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -1771,26 +1771,22 @@ static bool isGuaranteedNotToBeUndefOrPoison(Register Reg,
1771
1771
1772
1772
MachineInstr *RegDef = MRI.getVRegDef (Reg);
1773
1773
1774
- auto OpCheck = [&](MachineOperand &Operand) {
1775
- if (!Operand.isReg ())
1776
- return true ;
1777
-
1778
- return isGuaranteedNotToBeUndefOrPoison (Operand.getReg (), MRI, Depth + 1 ,
1779
- Kind);
1780
- };
1781
-
1782
1774
switch (RegDef->getOpcode ()) {
1783
1775
case TargetOpcode::G_FREEZE:
1784
1776
return true ;
1785
1777
case TargetOpcode::G_IMPLICIT_DEF:
1786
1778
return !includesUndef (Kind);
1787
- default :
1788
- GenericMachineInstr *Opr = dyn_cast<GBinOp>(RegDef);
1789
- if (!Opr)
1790
- Opr = dyn_cast<GCastOp>(RegDef);
1791
-
1792
- return Opr && !::llvm::canCreateUndefOrPoison (Reg, MRI) &&
1793
- all_of (Opr->operands (), OpCheck);
1779
+ default : {
1780
+ auto MOCheck = [&](const MachineOperand &MO) {
1781
+ if (!MO.isReg ())
1782
+ return true ;
1783
+ return ::isGuaranteedNotToBeUndefOrPoison (MO.getReg (), MRI, Depth + 1 ,
1784
+ Kind);
1785
+ };
1786
+ return !::canCreateUndefOrPoison (Reg, MRI,
1787
+ /* ConsiderFlagsAndMetadata=*/ true , Kind) &&
1788
+ all_of (RegDef->uses (), MOCheck);
1789
+ }
1794
1790
}
1795
1791
}
1796
1792
You can’t perform that action at this time.
0 commit comments