From: Sanjay Patel Date: Thu, 28 Jun 2018 20:52:43 +0000 (+0000) Subject: [InstCombine] fix opcode check in shuffle fold X-Git-Tag: llvmorg-7.0.0-rc1~2579 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d512853aa3cfd2fe5451f854ab8ba742ac9fe39b;p=platform%2Fupstream%2Fllvm.git [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 --- 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) :