mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-05 18:49:06 +00:00
[InstCombine] Use swapValues(); NFC
Less code, and makes it more obvious that these operands do not need to be added back to the worklist.
This commit is contained in:
parent
ffc3055731
commit
ed54f1ad37
@ -2401,8 +2401,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
|
||||
// Swap true/false values and condition.
|
||||
CmpInst *Cond = cast<CmpInst>(CondVal);
|
||||
Cond->setPredicate(CmpInst::getInversePredicate(Pred));
|
||||
SI.setOperand(1, FalseVal);
|
||||
SI.setOperand(2, TrueVal);
|
||||
SI.swapValues();
|
||||
SI.swapProfMetadata();
|
||||
Worklist.push(Cond);
|
||||
return &SI;
|
||||
@ -2783,8 +2782,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
|
||||
Value *NotCond;
|
||||
if (match(CondVal, m_Not(m_Value(NotCond)))) {
|
||||
SI.setOperand(0, NotCond);
|
||||
SI.setOperand(1, FalseVal);
|
||||
SI.setOperand(2, TrueVal);
|
||||
SI.swapValues();
|
||||
SI.swapProfMetadata();
|
||||
return &SI;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user