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

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 24 06:38:55 PDT 2017


anna added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:914
+      // of individual elements in the vector (and will always return false).
+      if (InC && !isa<ConstantExpr>(InC) && !isa<VectorType>(InC->getType()))
         InV = InC->isNullValue() ? FalseVInPred : TrueVInPred;
----------------
sanjoy wrote:
> How about `ConstantArray` and `ConstantStruct`?
yes, good point. We are currently miscompiling for those types as well (basically all constant aggregate types : struct, array, vector). I'll update the patch and add test cases for these types.


https://reviews.llvm.org/D31189





More information about the llvm-commits mailing list