[llvm-bugs] [Bug 25864] New: Divergence Analysis: Constant load in branch considered divergent

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 17 07:13:07 PST 2015


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

            Bug ID: 25864
           Summary: Divergence Analysis: Constant load in branch
                    considered divergent
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: unassignedbugs at nondot.org
          Reporter: tstellar at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15479
  --> https://llvm.org/bugs/attachment.cgi?id=15479&action=edit
Test case

I've run into this issue with the DivergenceAnalysis pass, and I'm not sure if
it is a bug or if it is expected behavior.  Attached is the test case, which
can be reproduced by applying this patch: http://reviews.llvm.org/D15608

opt  -analyze -divergence -mtriple=amdgcn-- divergent-test.ll

The output I get from the divergence analysis pass is this:

DIVERGENT:  float %arg1
DIVERGENT:  %tmp2 = fcmp ueq float %arg1, 0.000000e+00
DIVERGENT:  br i1 %tmp2, label %bb7, label %bb3
DIVERGENT:  %tmp4 = phi i1 [ false, %bb7 ], [ true, %bb ]
DIVERGENT:  br i1 %tmp4, label %bb5, label %bb9
DIVERGENT:  %tmp6 = call float @llvm.SI.load.const(<16 x i8> %tmp, i32 16)

^ This last line is what I think it incorrect.  This is a constant load
intrinsic, which takes a non-divergent argument, so it shouldn't be divergent.
I have verified that AMDGPU's implementation of
TargetTransformInfo::isSourceOfDivergence() returns false for this intrinsic.

Based on brief debugging of the issue I think the problem may be that the
DivergenceAnalysis pass incorrectly things this test case contains a loop, but
I'm not really sure.

-- 
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/20151217/45fdf437/attachment.html>


More information about the llvm-bugs mailing list