From: Anna Thomas Date: Tue, 28 Mar 2017 09:32:24 +0000 (+0000) Subject: [InstCombine] For select rule, use positive check of constant int for select operand... X-Git-Tag: llvmorg-5.0.0-rc1~9046 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=923e574bff006ea6a6888e1900ecc4d4a2a4ef41;p=platform%2Fupstream%2Fllvm.git [InstCombine] For select rule, use positive check of constant int for select operand. NFCI llvm-svn: 298906 --- diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index 020e8c9..ebc1ea7 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -912,7 +912,7 @@ Instruction *InstCombiner::FoldOpIntoPhi(Instruction &I) { // FalseVInPred versus TrueVInPred. When we have individual nonzero // elements in the vector, we will incorrectly fold InC to // `TrueVInPred`. - if (InC && !isa(InC) && !isa(InC->getType())) + if (InC && !isa(InC) && isa(InC)) InV = InC->isNullValue() ? FalseVInPred : TrueVInPred; else InV = Builder->CreateSelect(PN->getIncomingValue(i),