File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
llvm/lib/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -2401,8 +2401,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
2401
2401
// Swap true/false values and condition.
2402
2402
CmpInst *Cond = cast<CmpInst>(CondVal);
2403
2403
Cond->setPredicate (CmpInst::getInversePredicate (Pred));
2404
- SI.setOperand (1 , FalseVal);
2405
- SI.setOperand (2 , TrueVal);
2404
+ SI.swapValues ();
2406
2405
SI.swapProfMetadata ();
2407
2406
Worklist.push (Cond);
2408
2407
return &SI;
@@ -2783,8 +2782,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
2783
2782
Value *NotCond;
2784
2783
if (match (CondVal, m_Not (m_Value (NotCond)))) {
2785
2784
SI.setOperand (0 , NotCond);
2786
- SI.setOperand (1 , FalseVal);
2787
- SI.setOperand (2 , TrueVal);
2785
+ SI.swapValues ();
2788
2786
SI.swapProfMetadata ();
2789
2787
return &SI;
2790
2788
}
You can’t perform that action at this time.
0 commit comments