diff options
author | Sanjay Patel <spatel@rotateright.com> | 2015-11-21 16:51:19 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2015-11-21 16:51:19 +0000 |
commit | 04df583a42b6c9514abc7130ed6d353d64c5a107 (patch) | |
tree | 67d371e99f6a0d5efa5f2f23a280317dcaf5d78f /llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | |
parent | 1f3fa2133adfaf55ab9670aa85a6bb1c9a783fd3 (diff) | |
download | llvm-04df583a42b6c9514abc7130ed6d353d64c5a107.zip llvm-04df583a42b6c9514abc7130ed6d353d64c5a107.tar.gz llvm-04df583a42b6c9514abc7130ed6d353d64c5a107.tar.bz2 |
use ternary ops; NFC
llvm-svn: 253787
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstructionCombining.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index 7abf92a..10a517a 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -1325,14 +1325,8 @@ Value *InstCombiner::SimplifyVectorOp(BinaryOperator &Inst) { } if (MayChange) { Constant *C2 = ConstantVector::get(C2M); - Value *NewLHS, *NewRHS; - if (isa<Constant>(LHS)) { - NewLHS = C2; - NewRHS = Shuffle->getOperand(0); - } else { - NewLHS = Shuffle->getOperand(0); - NewRHS = C2; - } + Value *NewLHS = isa<Constant>(LHS) ? C2 : Shuffle->getOperand(0); + Value *NewRHS = isa<Constant>(LHS) ? Shuffle->getOperand(0) : C2; Value *NewBO = CreateBinOpAsGiven(Inst, NewLHS, NewRHS, Builder); return Builder->CreateShuffleVector(NewBO, UndefValue::get(Inst.getType()), Shuffle->getMask()); |