[llvm] r335920 - [InstCombine] fix opcode check in shuffle fold
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 28 13:52:43 PDT 2018
Author: spatel
Date: Thu Jun 28 13:52:43 2018
New Revision: 335920
URL: http://llvm.org/viewvc/llvm-project?rev=335920&view=rev
Log:
[InstCombine] fix opcode check in shuffle fold
There's no way to expose this difference currently,
but we should use the updated variable because the
original opcodes can go stale if we transform into
something new.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp?rev=335920&r1=335919&r2=335920&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp Thu Jun 28 13:52:43 2018
@@ -1199,7 +1199,7 @@ static Instruction *foldSelectShuffles(S
// If the shuffle mask contains undef elements, then the new constant
// vector will have undefs in those lanes. This could cause the entire
// binop to be undef.
- if (B0->isIntDivRem())
+ if (Instruction::isIntDivRem(BOpc))
NewC = getSafeVectorConstantForIntDivRem(NewC);
Instruction *NewBO = ConstantsAreOp1 ? BinaryOperator::Create(BOpc, X, NewC) :
More information about the llvm-commits
mailing list