[PATCH] D15693: [Polly] Take a PHI's incoming block as value user

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 22 14:28:16 PST 2015


Meinersbur added a comment.

In http://reviews.llvm.org/D15693#315252, @grosser wrote:

> Hi Michael,
>
> I just went again over the patch and debugged a simple example. I have the feeling this patch is in fact not the right approach. Assume there is a PHI node in an exit block of the scop, which uses values that are defined inside the scop and for which the incoming block of the PHI node is also part of the scop. In this case, I would still expect the values used by this PHI node to be marked as escaping. With your patch this would generally not be the case (and just happens to still be the case because we first run executeScopConditionally and only then generate the list escaping values).


There is some special handling for exit block PHIs, which in this case are handled more like MK_Values, not MK_PHIs. MK_Value's are have a final_reload and it does not matter whether there is a single write (in case of MK_Value) or multiple (MK_PHI). It is the the value defined by the PHI which is checked whether escaping (if I'm not mistaken)

> I also do not see how  handleOutsideUsers could ever have caused a bug in its current shape.


Yes, because of executeScopConditionally. But it doesn't change that PHI's use values on edges and not in the BB where the PHI is as assumed in this code.


http://reviews.llvm.org/D15693





More information about the llvm-commits mailing list