[LLVMbugs] [Bug 17714] New: Non-deterministic behavior when using LoopInfo pass in LLVM

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 28 18:29:54 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17714

            Bug ID: 17714
           Summary: Non-deterministic behavior when using LoopInfo pass in
                    LLVM
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: raphaelernani at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11435
  --> http://llvm.org/bugs/attachment.cgi?id=11435&action=edit
My test pass and Oscar.linked.rbc, extracted from the LLVM test suite
(Singlesource/Benchmarks/Stanford)

Hello,

I'm having a little problem with passes that use LoopInfo. Their statistics
aren't the same when I execute the same pass multiple times in the same
program.

After some investigation, I've found out that LoopInfo is the root of the
problem.

I wrote a little pass that counts the loop headers (number of basic blocks for
which LoopInfo.isLoopHeader(BB) is true). I've picked one of the programs in
the LLVM test suite benchmarks and in three consecutive tests the number of
loop headers was different.

I've sent this problem in the LLVM-dev mailing list and it seems that this
behavior is wrong. Please check this out.

I'm sending attached the bitcodes used in my tests and my little pass.

Thanks,

Raphael Ernani

P.S.: Here is the output (a similar variation occurs when I run my pass without
-mem2reg, -instnamer, and -break-crit-edges):

raphael at ubuntu:~/llvm-3.3/projects/test-suite/SingleSource/Benchmarks/Stanford/Output$
opt -mem2reg -instnamer -break-crit-edges -load MyModule.so -lh-counter -stats
Oscar.linked.rbc -f >/dev/null
===-------------------------------------------------------------------------===
                          ... Statistics Collected ...
===-------------------------------------------------------------------------===

12 NaturalLoopAnalysis - Number of Loop Headers
 8 break-crit-edges    - Number of blocks inserted
23 mem2reg             - Number of PHI nodes inserted
38 mem2reg             - Number of alloca's promoted
20 mem2reg             - Number of alloca's promoted with a single store

raphael at ubuntu:~/llvm-3.3/projects/test-suite/SingleSource/Benchmarks/Stanford/Output$
opt -mem2reg -instnamer -break-crit-edges -load MyModule.so -lh-counter -stats
Oscar.linked.rbc -f >/dev/null
===-------------------------------------------------------------------------===
                          ... Statistics Collected ...
===-------------------------------------------------------------------------===

13 NaturalLoopAnalysis - Number of Loop Headers
 8 break-crit-edges    - Number of blocks inserted
23 mem2reg             - Number of PHI nodes inserted
38 mem2reg             - Number of alloca's promoted
20 mem2reg             - Number of alloca's promoted with a single store

raphael at ubuntu:~/llvm-3.3/projects/test-suite/SingleSource/Benchmarks/Stanford/Output$
opt -mem2reg -instnamer -break-crit-edges -load MyModule.so -lh-counter -stats
Oscar.linked.rbc -f >/dev/null
===-------------------------------------------------------------------------===
                          ... Statistics Collected ...
===-------------------------------------------------------------------------===

11 NaturalLoopAnalysis - Number of Loop Headers
 8 break-crit-edges    - Number of blocks inserted
23 mem2reg             - Number of PHI nodes inserted
38 mem2reg             - Number of alloca's promoted
20 mem2reg             - Number of alloca's promoted with a single store

-- 
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/20131029/a914f94c/attachment.html>


More information about the llvm-bugs mailing list