]> granicus.if.org Git - llvm/commitdiff
[InstCombine] For select rule, use positive check of constant int for select operand...
authorAnna Thomas <anna@azul.com>
Tue, 28 Mar 2017 09:32:24 +0000 (09:32 +0000)
committerAnna Thomas <anna@azul.com>
Tue, 28 Mar 2017 09:32:24 +0000 (09:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298906 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstructionCombining.cpp

index 020e8c9f0469ded5e0e93d5f5cf2fceab6a8a65d..ebc1ea71e441d464c16250f6ce6db807a21ad4c2 100644 (file)
@@ -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<ConstantExpr>(InC) && !isa<VectorType>(InC->getType()))
+      if (InC && !isa<ConstantExpr>(InC) && isa<ConstantInt>(InC))
         InV = InC->isNullValue() ? FalseVInPred : TrueVInPred;
       else
         InV = Builder->CreateSelect(PN->getIncomingValue(i),