[PATCH] D101829: [SCEV] By more careful when traversing phis in isImpliedViaMerge.

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 5 13:17:24 PDT 2021


reames added a comment.

In D101829#2739961 <https://reviews.llvm.org/D101829#2739961>, @fhahn wrote:

> In D101829#2739843 <https://reviews.llvm.org/D101829#2739843>, @reames wrote:
>
>> 
>
> I might be glancing over something, but aren't we continuing the loop if `%call >s -1` and exit if `call <=s -1?

No, you're entirely correct.  I'd swapped the branch order in my head when reading.

> So in the iteration before we exit, `%call >s -1`, hence `%x >s -1` in the last iteration. In the last iteration, `%call <=s -1`, but `%x` still has the value from the previous iteration.

There are two sub-cases here:

1. Exit on the first iteration - %x will be -1 (e.g. value on entry).
2. Exit on second or further iteration - %x will be >s -1.  (e.g. value on backedge, last iteration value of call)

We can correctly conclude that x >=s -1, but not x >s -1.  Which I think was your original point right?  Sorry for the confusion.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101829/new/

https://reviews.llvm.org/D101829



More information about the llvm-commits mailing list