<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - llvm::SpillPlacement::addLinks takes all the time with asan or msan and -O2"
   href="http://llvm.org/bugs/show_bug.cgi?id=17409">17409</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm::SpillPlacement::addLinks takes all the time with asan or msan and -O2
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>kcc@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu, stoklund@2pi.dk
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This is a continuation of <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - quadratic compile time due to llvm::SpillPlacement::addLinks (with ASAN)"
   href="show_bug.cgi?id=12653">http://llvm.org/bugs/show_bug.cgi?id=12653</a>
and to some extent related to <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Slow compilation (1.5 hours) in llvm::LiveInterval::extendIntervalEndTo with ASAN"
   href="show_bug.cgi?id=12652">http://llvm.org/bugs/show_bug.cgi?id=12652</a>
Linux x86_64, r191651 (fresh trunk)

We have a large auto-generated (from protobuffers) C++ code, 
which takes too long to compile at -O2 with asan or msan instrumentation. 
Most of the time is taken by llvm::SpillPlacement::addLinks

The reproducer is too large to attach here: it is attached to 
<a href="https://b.corp.google.com/viewIssue?id=5993523#ISSUE_HistoryHeader10">https://b.corp.google.com/viewIssue?id=5993523#ISSUE_HistoryHeader10</a>

for opt in "-O0"  "-O1" "-O2" "-O2 -fsanitize=address" "-O2 -fsanitize=memory";
do 
  echo ================ $opt =============; 
  (time perf record -f -- clang $opt -c 1000.cc) 2>&1
   perf report 2>&1 | grep "%" | head -5;
done 

================ -O0 =============
TIME: real: 7.350; user: 4.990; system: 0.260
     3.45%  clang-3.3  clang-3.3            [.]
clang::CFGReverseBlockReachabilityAnalysis::mapReachability(clang::CFGBlock
const*)
..
================ -O1 =============
TIME: real: 13.761; user: 13.390; system: 0.210
...
================ -O2 =============
TIME: real: 38.358; user: 37.320; system: 0.790
     3.36%  clang-3.3  clang-3.3            [.]
llvm::ValueHandleBase::RemoveFromUseList()
...
================ -O2 -fsanitize=address =============

TIME: real: 196.757; user: 194.500; system: 1.230
    41.30%  clang-3.3  clang-3.3            [.]
llvm::SpillPlacement::addLinks(llvm::ArrayRef<unsigned int>)
     6.11%  clang-3.3  clang-3.3            [.] (anonymous
namespace)::InlineSpiller::propagateSiblingValue(llvm::DenseMapIterator<llvm::VNInfo*,
(anonymous namespace)::InlineSpiller::SibValueInfo,
llvm::DenseMapInfo<llvm::VNInfo*>, false>, llvm::VNInfo*)
...
================ -O2 -fsanitize=memory =============
TIME: real: 409.187; user: 405.200; system: 2.050
    34.22%  clang-3.3  clang-3.3            [.]
llvm::SpillPlacement::addLinks(llvm::ArrayRef<unsigned int>)
    14.12%  clang-3.3  clang-3.3            [.] (anonymous
namespace)::InlineSpiller::propagateSiblingValue(llvm::DenseMapIterator<llvm::VNInfo*,
(anonymous namespace)::InlineSpiller::SibValueInfo,
llvm::DenseMapInfo<llvm::VNInfo*>, false>, llvm::VNInfo*)
     3.58%  clang-3.3  clang-3.3            [.]
llvm::TinyPtrVector<llvm::VNInfo*>::push_back(llvm::VNInfo*)
...</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>