[PATCH] D43245: [LoopInterchange] Support reductions across inner and outer loop.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 9 10:24:34 PDT 2018


fhahn marked 3 inline comments as done.
fhahn added a comment.

Sorry for the delay Eli! I've restructured the code a bit to fix inner loop only reductions (https://reviews.llvm.org/D53027) and to keep 2 sets for reduction PHIs we can use to find out which kind of PHI we are dealing with.



================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:1521
+      if (InnerLoop->contains(InBB) ||
+          isa<PHINode>(PHI->getIncomingValueForBlock(InBB)))
         continue;
----------------
fhahn wrote:
> efriedma wrote:
> > Checking `isa<PHINode>()` here seems sort of confusing... is this supposed to be checking for a PHI node from the outer loop?  If so, is there some guarantee it isn't a PHI node from somewhere else?
> Yeah, it seems like inner loop reductions are not handled properly to start with. I will look into that first. It might be helpful to keep track of reduction/induction phis after the initial checks and use that info here (and other places, rather than recomputing)
The code now just checks OuterInnerReductions and InnerReductions.


https://reviews.llvm.org/D43245





More information about the llvm-commits mailing list