From d512853aa3cfd2fe5451f854ab8ba742ac9fe39b Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Thu, 28 Jun 2018 20:52:43 +0000 Subject: [PATCH] [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. llvm-svn: 335920 --- llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index 458b0f0..d4fb086 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -1199,7 +1199,7 @@ static Instruction *foldSelectShuffles(ShuffleVectorInst &Shuf) { // 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) : -- 2.7.4