[llvm-bugs] [Bug 37185] New: Divergence Analysis: undetected divergence in unstructured control

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 20 02:10:57 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37185

            Bug ID: 37185
           Summary: Divergence Analysis: undetected divergence in
                    unstructured control
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: unassignedbugs at nondot.org
          Reporter: moll at cs.uni-saarland.de
                CC: llvm-bugs at lists.llvm.org

Created attachment 20207
  --> https://bugs.llvm.org/attachment.cgi?id=20207&action=edit
LIT tests for NVPTX and AMDGPU

The divergence analysis fails to detect divergent phi nodes in the presence of
unstructured, divergent control flow.

The attached LIT tests trigger the bug in NVPTX and AMDGPU kernels.

The divergence analysis marks a phi node as divergent if its parent block is
the immediate post-dominator of a divergent branch (sync dependence). The
immediate post-dominator of a branch is the only point of reconvergence in
structured control flow. This assumption does not hold in unstructured control
flow:

"""
entry:
  divergent branch to B and C
B:
  uniform branch to C and D
C:
  %phi.var.hidden = phi .. <- undetected DIVERGENT phi
  br D
D:
  %phi.var = phi .. <- detected DIVERGENT phi in IPostDom of entry
  ret
"""

D is the immediate post-dominator of entry. However, threads that diverge at
the branch in entry can reconverge at block C. The phi node %phi.var.hidden in
turn becomes divergent.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180420/c2ed9d85/attachment.html>


More information about the llvm-bugs mailing list