[PATCH] D31189: [InstCombine] Fix folding of select into phi nodes when incoming element of phi is a vector type

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 24 09:06:21 PDT 2017


sanjoy added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:915
+      // `TrueVInPred`.
+      if (InC && !isa<ConstantExpr>(InC) && !isa<VectorType>(InC->getType()))
         InV = InC->isNullValue() ? FalseVInPred : TrueVInPred;
----------------
Actually, one more thing -- can we rewrite this as a positive test?  That is, instead of checking what `Inc` cannot be, check that it is only allowed to be a `ConstantInt`?

(I'm fine doing that cleanup as a follow-on change.)


https://reviews.llvm.org/D31189





More information about the llvm-commits mailing list