[LLVMdev] Strong post-dominance in LLVM?

Bjarke Roune broune at google.com
Thu Jul 9 13:22:58 PDT 2015


On Thu, Jul 9, 2015 at 12:15 PM, Sanjoy Das <sanjoy at playingwithpointers.com>
wrote:

> On Wed, Jul 8, 2015 at 6:01 PM, Bjarke Roune <broune at google.com> wrote:
> > There is PostDominatorTree for determining post-dominance. Even if A
> > post-dominates B and B is executed, that doesn't guarantee that A will be
> > executed. For example, there could be an infinite loop in-between. Strong
> > post-dominance makes the stronger guarantee that there will be no
> infinite
> > loop from B to A. Do we have anything in LLVM for determining strong
> > post-dominance and in general for guaranteeing that if B is executed,
> then A
> > will also be executed?
>
> The closest thing to this I can think of is `isGuaranteedToExecute` in
> LICM.cpp.  Perhaps that mechanism can be generalized?
>
> Thanks. I took a look at it. It does not appear to take into account
nested infinite loops, yet it uses this function to hoist trapping
instructions. I also don't think that it works correctly if the loop itself
iterates infinitely but does have exit blocks in the CFG. I think this
function is based on the assumption that all loops terminate, but I don't
see where LICM checks that. I'm about to file a bug for that and see if I
can trigger it in an example, but feel free to save me the effort if you
know some reason that what it's doing is OK?

Bjarke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150709/205799ce/attachment.html>


More information about the llvm-dev mailing list