[PATCH] D50433: A New Divergence Analysis for LLVM

Simon Moll via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 27 13:34:57 PDT 2018


simoll added a comment.

In https://reviews.llvm.org/D50433#1214724, @alex-t wrote:

> > Sorry, i am struggeling to follow.
> >  Do you take the union of the PDF(P) for each immediate predecessor P of X? (where X is a potential join point).
> >  That gives you invalid results.
> > 
> >         A
> >       /   \
> >      B     C
> >    /  \   /  \
> >   D     E     F
> >    \  /   \  /
> >      G     H
> >      \    /
> >         I
> >    
> >    
> > 
> > PDF(G) = {E, B}
> >  PDF(H) = {E, C}
> > 
> > PDF(G) join PDF(H) =  {E, B, C}   (where join is set union).
> >  Yet, there are two disjoint paths from A to I. But A is in none of these sets.
>
> You approach to the Control Dependence Analysis considering CFG only. You operate in terms ob BBs and branches.
>  I start from the PHI. The idea is simple: each point where 2 values converge has already been found while building SSA and is annotated with the PHI node.
>  I consider not PHI parent block predecessors PDF but PHI incoming values parent blocks PDFs.


Let's say the phi node in block I reads `%x = phi double [ 0.0, %G ], [ 1.0, %H ]`. How do you detect the divergence in `%x`?


Repository:
  rL LLVM

https://reviews.llvm.org/D50433





More information about the llvm-commits mailing list