[PATCH] D22630: Loop rotation

Aditya K via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 30 08:03:24 PDT 2016


> I can't see how this could ever legally return -1 in this function., can you give an example?

> It's looking at phi nodes in a successor, and trying to find the node that corresponds to a predecessor.
> It should always exist.
Yes, but in the case of loop-rotation when the PHIs have not yet been updated, the PHI in Successor BB only has one entry at that point.
So SplitEdge does not work. Sorry for the confusion.



________________________________
From: Daniel Berlin <dberlin at dberlin.org>
Sent: Monday, August 29, 2016 3:54 PM
To: reviews+D22630+public+f4f36d4d77d3fe89 at reviews.llvm.org; Aditya Kumar
Cc: Hal Finkel; Sanjoy Das; Michael Zolotukhin; llvm at meinersbur.de; Sebastian Pop; laxmansole at gmail.com; llvm-commits
Subject: Re: [PATCH] D22630: Loop rotation

ransformation.
 class LoopRotate {
----------------
Using SplitEdge results in ICE because SplitEdge (for critical edges) tries to update PHI in a strange way. I think there is a bug in SplitEdge PHI update for single-entry PHIs. Moreover, loop-rotation needs to do its own PHI-update later anyways.

Specifically, BreakCriticalEdges:174, PN->getBasicBlockIndex may return -1, and threre is no check for that here.

I can't see how this could ever legally return -1 in this function., can you give an example?

It's looking at phi nodes in a successor, and trying to find the node that corresponds to a predecessor.
It should always exist.

That is,

It has a terminator and the block the terminator is in, and is looking at phi nodes in the successor block.
It tries to find the terminator block in the phi node.

How could this ever fail?

      if (PN->getIncomingBlock(BBIdx) != TIBB)
        BBIdx = PN->getBasicBlockIndex(TIBB);
      PN->setIncomingBlock(BBIdx, NewBB);



https://reviews.llvm.org/D22630



_______________________________________________
llvm-commits mailing list
llvm-commits at lists.llvm.org<mailto:llvm-commits at lists.llvm.org>
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160830/e75fa399/attachment.html>


More information about the llvm-commits mailing list