diff options
| -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 7abf92a5ca6..10a517af42e 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());  | 

