[PATCH] D37528: [JumpThreading] Preserve dominance across the pass.

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 7 17:20:54 PDT 2017


dberlin added a comment.

In https://reviews.llvm.org/D37528#864194, @brzycki wrote:

> In https://reviews.llvm.org/D37528#863731, @kuhar wrote:
>
> > @brzycki, one related thing: have you tried preserving postdominators as well? I'm not sure if that would be beneficial here, but in theory, it should be pretty simple, as you can pass exactly the same update sequences to the DominatorTree and PostDominatorTree.
>
>
> I have not. I'll talk to @sebpop and see if he thinks this makes sense to include in this patch. Depending on our follow-on updates to JT we may need post dominators as well.


Even if you don't need it, it's trivial to preserve and probably worth doing.

Jakub, we should just create an updater object that updates whatever is around with the same edge sequence.

if you stare at getBestSimplifyQuery in lib/Analysis/SimplifyInstruction.cpp, you can see how to do that with both the old and new PM.

You can see how it is used in Transforms/Scalar/CorrelatedValuePropagation.cpp and Transforms/Scalar/LoopRotation.cpp for both the old and new PM.
An updater object that gets the postdom/dom tree if it's around, and handles the update edge sequence for both, would go a long way to getting postdom preserved everywhere.


https://reviews.llvm.org/D37528





More information about the llvm-commits mailing list