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-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90db4d6a69e7bdb55b78949c1098721f65fa9818;p=llvm [InstCombine] For select rule, use positive check of constant int for select operand. NFCI git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298906 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index 020e8c9f046..ebc1ea71e44 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/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),