[PATCH] D29727: [SLP] Fix for PR31690: Allow using of extra values in horizontal reductions.

Michael Kuperstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 12:57:40 PST 2017


mkuper accepted this revision.
mkuper added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:2862
+      DebugLoc DL = ExternallyUsedValues[Scalar];
+      if (auto *VecI = dyn_cast<Instruction>(Vec)) {
+        Builder.SetInsertPoint(VecI->getParent(),
----------------
ABataev wrote:
> mkuper wrote:
> > mkuper wrote:
> > > I guess it's impossible for Vec to be a PHI here, because the real user is going to be a reduction operation, right?
> > > If so, how is it possible for it to be a non-Instruction?
> > Er, actually, what I wrote above doesn't make sense.
> > Why can't it be a Phi?
> It does not matter for Vec is it a PHI or not (PHI is an instruction also), it can be a constant, I believe, which is not an instruction.
If VecI is a PHI, std::next(VecI->getIterator()) may not be a valid insertion point, but, never mind, I realized VecI can't be a phi anyway (and below, we don't care about the case VecI is a phi, we care about the case the User is a phi...).
Never mind this.


https://reviews.llvm.org/D29727





More information about the llvm-commits mailing list