[PATCH] [PlaceSafepoints] Use the analysis infrastructure rather than an inner pass manager

Daniel Berlin dberlin at dberlin.org
Wed May 13 12:21:38 PDT 2015


On Wed, May 13, 2015 at 12:11 PM, Philip Reames
<listmail at philipreames.com> wrote:
> Hi sanjoy, igor-laevsky, AndyAyers, pgavlin, hfinkel, rkotler,
>
> I would really appreciate careful review on the analysis update logic in the newly added function.
>
> PlaceSafepoints was previously using an inner pass manager to run an analysis pass *after* modifying the IR to remove unreachable blocks.  In an effort to get rid of the inner pass manager (and the various dominator tree recalcs it implied), I switched to using the analysis infrastructure to actually get the various analysis needed and convert the inner pass manager stuff into a small non-pass helper class.
>
> However, I couldn't figure out how to keep the analysis results up to date over a call to removeUnreachableBlocks.  That routine freely modifies the CFG in non-trivial ways with no provisions for updating any of dominator tree

Can you describe this in more detail?
It simply seems to
1. Constant fold terminators
2. Remove dead blocks (including cycles)

This doesn't seem all that difficult to update dominators for, and
making it update would certainly be helpful to other passes.  In fact,
#2 is trivial, #1 is the only slightly tricky case.

If you can give a before and after example of what you think is a
difficult update, i'd love to see it.

(In general, updating dominators for unreachability is pretty easy,
because if any node strictly dominated by an unreachable blocks is
also unreachable, so you can usually just drop the whole subtree, and
pull everything else up by one)




More information about the llvm-commits mailing list