[PATCH] D16637: [SimplifyCFG] limit recursion depth when speculating instructions (PR26308)
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 27 10:32:13 PST 2016
majnemer added a comment.
In http://reviews.llvm.org/D16637#337461, @dberlin wrote:
> Errr, rather than limit recursion depth, why not just keep track of what's
> visited and avoid the cycles?
> (You could also cheaply build sccs of the instruction and it's uses, and
> decide what to do for each SCC as a whole, which would avoid this issue as
We run DominatesMergePoint on every two entry phi node. Using a set of visited blocks would still be pretty expensive because, in the worst case, DominatesMergePoint might recurse back to the entry node if there are a lot of cheap BBs. I think it would make sense to have a depth limit to handle such pathological cases.
More information about the llvm-commits