[llvm-bugs] [Bug 31119] New: Infinite loop in SampleProfileLoader (inlineHotFunctions)

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 22 12:11:57 PST 2016


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

            Bug ID: 31119
           Summary: Infinite loop in SampleProfileLoader
                    (inlineHotFunctions)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Interprocedural Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: greg_bedwell at sn.scee.net
                CC: danielcdh at gmail.com, dnovillo at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

We've had a report from a user out in the field of a hang in the compiler that
occurs when -fprofile-sample-use is used.  I can see that it's getting stuck in
SampleProfileLoader::inlineHotFunctions due to never breaking out of the
while(true).  I've reduced the (large) user-provided testcase and constructed
the following simple one that demonstrates the behaviour:

$ type pgo.txt
#
==============================================================================
_Z5alphav:102608:432
 0.1: _Z4sort14GenericFunctor:105
#
==============================================================================

$ type test.cpp
//
=============================================================================
__attribute__((__nodebug__)) inline void _Sort(unsigned aa) {
  if (aa)
    _Sort(--aa);
}
struct GenericFunctor {
  GenericFunctor() {}
};
unsigned depth;
__attribute__((__nodebug__)) inline void sort(GenericFunctor) { _Sort(depth); }
void alpha() { sort(GenericFunctor()); }
//
=============================================================================

$ clang -target x86_64-unknown-unknown -v
clang version 4.0.0 (http://llvm.org/git/clang.git
76fd46ed36e54c6418eb2d9254d9b99d1528311b) (http://llvm.org/git/llvm.git
fcc1f76b4d065552630b28ec1d7959b692680c18)
Target: x86_64-unknown-unknown
Thread model: posix
InstalledDir:
C:\work\public-git\upstream-llvm\build-vs2015-ps4-master\Release\bin

$ clang -target x86_64-unknown-unknown -Rpass=sample -c test.cpp -O3 -g

$ clang -target x86_64-unknown-unknown -Rpass=sample -c test.cpp -O3 -g
-fprofile-sample-use=pgo.txt
test.cpp:11:16: remark: inlined hot callee '_Z4sort14GenericFunctor' with 105
samples into '_Z5alphav' [-Rpass=sample-profile]
void alpha() { sort(GenericFunctor()); }
               ^
test.cpp:11:16: remark: inlined hot callee '_Z5_Sortj' with 105 samples into
'_Z5alphav' [-Rpass=sample-profile]
test.cpp:11:16: remark: inlined hot callee '_Z5_Sortj' with 105 samples into
'_Z5alphav' [-Rpass=sample-profile]
test.cpp:11:16: remark: inlined hot callee '_Z5_Sortj' with 105 samples into
'_Z5alphav' [-Rpass=sample-profile]
test.cpp:11:16: remark: inlined hot callee '_Z5_Sortj' with 105 samples into
'_Z5alphav' [-Rpass=sample-profile]
test.cpp:11:16: remark: inlined hot callee '_Z5_Sortj' with 105 samples into
'_Z5alphav' [-Rpass=sample-profile]
test.cpp:11:16: remark: inlined hot callee '_Z5_Sortj' with 105 samples into
'_Z5alphav' [-Rpass=sample-profile]
test.cpp:11:16: remark: inlined hot callee '_Z5_Sortj' with 105 samples into
'_Z5alphav' [-Rpass=sample-profile]
^C
$

-- 
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/20161122/7faaf609/attachment.html>


More information about the llvm-bugs mailing list