[PATCH] D34135: [LVI] Add initial result to avoid infinite getValueFromCondition recursion

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 14 13:27:05 PDT 2017


dberlin added a comment.

In https://reviews.llvm.org/D34135#780637, @efriedma wrote:

> > Can't you just tell LVI the blocks are dead without them being dead?
>
> I'm not following your question.
>
> The sequence here is that we constant-fold a terminator (deleting an edge), then continue iterating through all the blocks in the function, and eventually crash when LVI discovers a cycle in a loop which was made unreachable.  Which blocks is JumpThreading supposed to tell LVI about?


Sorry, yes, my question didn't make sense.
I wrote too quickly.
I stared at it later, and saw this.

I also stared at the unreachable code removal (which as you say, is O(cfg edges)).
The way it does this looks super-strange and expensive (it should be doable in O(blocks) time, trivially)
It also iterates jump threading in basically random order, which sadly means it will take more iterations, and has to check for cases that it wouldn't otherwise, and can't eagerly remove most unreachable blocks

Sigh, oh well.


https://reviews.llvm.org/D34135





More information about the llvm-commits mailing list