[llvm-dev] SimplifyCFG recursion

Craig Topper via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 26 16:03:12 PDT 2018


SimplifyCFG has many places that do this

return simplifyCFG(BB, TTI, Options) || true;

As far as I can tell this calls the global entry point for SimplifyCFG
which creates a SimplifyCFGOpt object to call run(BB) on. So I think this
means SimplifyCFG can create a new SimplifyCFGOpt object each time it
recurses like this. I don't know how deep it goes in practice.

The global entry point also has a 4th argument called LoopHeaders that is
defaulted to nullptr. I think we lose the LoopHeaders pointer the first
time we recurse because none of the recursive calls pass it along.

Should we instead be recursing to the run function on the current
SimplifyCFGOpt object?

~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180926/4de83228/attachment.html>


More information about the llvm-dev mailing list