[llvm-bugs] [Bug 42741] New: LegacyDivergenceAnalysis: sync dependence misses some divergent uses outside a loop
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Jul 24 09:16:40 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=42741
Bug ID: 42741
Summary: LegacyDivergenceAnalysis: sync dependence misses some
divergent uses outside a loop
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Global Analyses
Assignee: unassignedbugs at nondot.org
Reporter: jay.foad at gmail.com
CC: llvm-bugs at lists.llvm.org
Created attachment 22281
--> https://bugs.llvm.org/attachment.cgi?id=22281&action=edit
test case
See the attached test case,
test/Analysis/LegacyDivergenceAnalysis/AMDGPU/syncbug.ll.
%tmp7 is divergent because it's sync-dependent on the divergent loop exit
condition %tmp5, but LegacyDivergenceAnalysis does not mark it as divergent.
Quoting from LegacyDivergenceAnalysis.cpp:
// Propagation rule 2: if a value defined in a loop is used outside, the user
// is sync dependent on the condition of the loop exits that dominate the
// user. For example,
OK.
// The algorithm used here handles both natural and unstructured loops.
Given
// a branch TI, we first compute its influence region, the union of all
simple
// paths from TI to its immediate post dominator (IPostDom). Then, we search
// for all the values defined in the influence region but used outside. All
// these users are sync dependent on TI.
This algorithm doesn't appear to work. The influence region includes all blocks
from bb2 to bb8, so %tmp7 is never marked divergent by this algorithm because
it is not outside the influence region.
This might be related to 37185.
--
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/20190724/c12b7f00/attachment.html>
More information about the llvm-bugs
mailing list