[llvm] r298906 - [InstCombine] For select rule, use positive check of constant int for select operand. NFCI

Anna Thomas via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 28 02:32:24 PDT 2017


Author: annat
Date: Tue Mar 28 04:32:24 2017
New Revision: 298906

URL: http://llvm.org/viewvc/llvm-project?rev=298906&view=rev
Log:
[InstCombine] For select rule, use positive check of constant int for select operand. NFCI

Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp

Modified: llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp?rev=298906&r1=298905&r2=298906&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp Tue Mar 28 04:32:24 2017
@@ -912,7 +912,7 @@ Instruction *InstCombiner::FoldOpIntoPhi
       // 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),




More information about the llvm-commits mailing list