forked from OSchip/llvm-project
[InstCombine] Remove some repeated calls to getOperand. NFCI
We had alread loaded operand 1 and 2 of the select as TV and FV using the more the readable getTrueValue/getFalseValue.
This commit is contained in:
parent
4b7aa6c8c1
commit
94b1404587
|
@ -922,8 +922,7 @@ Instruction *InstCombiner::FoldOpIntoSelect(Instruction &Op, SelectInst *SI) {
|
|||
if (auto *CI = dyn_cast<CmpInst>(SI->getCondition())) {
|
||||
if (CI->hasOneUse()) {
|
||||
Value *Op0 = CI->getOperand(0), *Op1 = CI->getOperand(1);
|
||||
if ((SI->getOperand(1) == Op0 && SI->getOperand(2) == Op1) ||
|
||||
(SI->getOperand(2) == Op0 && SI->getOperand(1) == Op1))
|
||||
if ((TV == Op0 && FV == Op1) || (FV == Op0 && TV == Op1))
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue