[PATCH] D50433: A New Divergence Analysis for LLVM

Alexander via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 23 07:45:06 PDT 2018


alex-t added a comment.

BTW, even with analyzing forward (up-down) and lazy style, for each divergent terminator you have to compute join points.
This is exactly what is done constructing SSA form to find all the blocks where should be PHI nodes.
For given branch all the blocks where PHI nodes must be inserted belongs to the branch parent block dominance frontier.
Why don't you use at least DF information from PDT?
Facing the divergent branch you can compute the blocks set affected by the divergence in linear time by Cooper's "two fingers" algorithm.



================
Comment at: lib/Analysis/SyncDependenceAnalysis.cpp:236
+    for (const auto *succBlock : nodeSuccessors) {
+      defMap.emplace(succBlock, succBlock);
+
----------------
on line 152 : // if defMap[B] == B then B is a join point of disjoint paths from X

The immediate successor of the divergent term is not necessarily the join point

The real mapping is done in visitSuccessor so you use defMap[B] == B here as an initial state. It is not immediately clear from the comment.


Repository:
  rL LLVM

https://reviews.llvm.org/D50433





More information about the llvm-commits mailing list