[PATCH] D51781: [InstCombine] Do not fold scalar ops over select with vector condition.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 7 07:37:50 PDT 2018


spatel added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineSelect.cpp:365
 
+  // If the select condition is a vector, the operands also must be vectors.
+  if (SI.getCondition()->getType()->isVectorTy() &&
----------------
fhahn wrote:
> spatel wrote:
> > I found this comment confusing. The select operands themselves are vectors, but the operands of those operands must also be vectors. This can only be a problem with GEPs? If that's correct, let's state that in the comment.
> I tried to make it more explicit, what do you think? I *think* it only can happen for getlementptr currently, but there might be other cases ,e.g. if the code around here becomes more powerful)
Works for me - thanks!


https://reviews.llvm.org/D51781





More information about the llvm-commits mailing list