[PATCH] D35227: [LV] Don't allow outside uses of IVs if the SCEV is predicated on loop conditions

Matthew Simpson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 11 14:15:47 PDT 2017


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

In https://reviews.llvm.org/D35227#805493, @mkuper wrote:

> In https://reviews.llvm.org/D35227#805164, @mssimpso wrote:
>
> > Hi Michael,
> >
> > I'm probably missing something obvious here. For external IV uses, we compute the end IV value assuming we're coming from the vector loop. But if we executed the vector loop, shouldn't the SCEV predicate have been true, which would mean that the PSEV was a safe assumption?
>
>
> You're not necessarily missing something obvious, I may be misunderstanding what PSCEV does here. If I understand correctly, PSCEV adds the assumption the IV doesn't overflow inside the loop. In this case, what I see is that it overflows on loop exit. So, either:
>  a) I misunderstand what PSCEV is doing here. :-)
>  b) PSCEV is wrong inside the loop.
>  c) The assumption PSCEV makes is correct, except on exit. If this is the case, then we can't use the SCEV we get to compute the value after the last iteration.


I see. Yes, that makes sense to me, then.


https://reviews.llvm.org/D35227





More information about the llvm-commits mailing list