[InstCombine] reduce indent; NFC

llvm-svn: 272193
This commit is contained in:
Sanjay Patel 2016-06-08 20:09:04 +00:00
parent 7aa0ad65ce
commit 10a2c38d83
1 changed files with 65 additions and 64 deletions

View File

@ -984,9 +984,9 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
if (Instruction *Result = visitSelectInstWithICmp(SI, ICI))
return Result;
if (Instruction *TI = dyn_cast<Instruction>(TrueVal))
if (Instruction *FI = dyn_cast<Instruction>(FalseVal))
if (TI->hasOneUse() && FI->hasOneUse()) {
auto *TI = dyn_cast<Instruction>(TrueVal);
auto *FI = dyn_cast<Instruction>(FalseVal);
if (TI && FI && TI->hasOneUse() && FI->hasOneUse()) {
Instruction *AddOp = nullptr, *SubOp = nullptr;
// Turn (select C, (op X, Y), (op X, Z)) -> (op X, (select C, Y, Z))
@ -1000,12 +1000,14 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
FI->getOpcode() == Instruction::Add) ||
(TI->getOpcode() == Instruction::FSub &&
FI->getOpcode() == Instruction::FAdd)) {
AddOp = FI; SubOp = TI;
AddOp = FI;
SubOp = TI;
} else if ((FI->getOpcode() == Instruction::Sub &&
TI->getOpcode() == Instruction::Add) ||
(FI->getOpcode() == Instruction::FSub &&
TI->getOpcode() == Instruction::FAdd)) {
AddOp = TI; SubOp = FI;
AddOp = TI;
SubOp = FI;
}
if (AddOp) {
@ -1035,9 +1037,8 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
Value *NewFalseOp = NegVal;
if (AddOp != TI)
std::swap(NewTrueOp, NewFalseOp);
Value *NewSel =
Builder->CreateSelect(CondVal, NewTrueOp,
NewFalseOp, SI.getName() + ".p");
Value *NewSel = Builder->CreateSelect(CondVal, NewTrueOp, NewFalseOp,
SI.getName() + ".p");
if (SI.getType()->isFPOrFPVectorTy()) {
Instruction *RI =