<html>
    <head>
      <base href="https://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 --- - LiveDebugValues is very slow"
   href="https://llvm.org/bugs/show_bug.cgi?id=26055">26055</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LiveDebugValues is very slow
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>Common Code Generator Code
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>vikram.tarikere@gmail.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>vonosmas@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>aprantl@apple.com, dberlin@dberlin.org, dblaikie@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>LiveDebugValues pass re-committed in r255759 is slow on large functions with
lots of local variables and basic blocks. This often happens if one is using
"-O2 -fsanitize=address -g" (first flag causes a lot of inlining, while ASan
adds a number of non-trivial basic blocks).

Attached is a reproducer created from OpenCV 2.2.0:

$ ./bin/llc -filetype=obj a.ll

takes forever, and the time is spent in this pass:

 46.42%  llc  llc                  [.] (anonymous
namespace)::LiveDebugValues::VarLoc::operator==((anonymous
namespace)::LiveDebugValues::VarLoc const&) const
 20.04%  llc  llc                  [.] (anonymous
namespace)::LiveDebugValues::transfer(llvm::MachineInstr&, std::list<(anonymous
namespace)::LiveDebugValues::VarLoc, std::allocator<(anonymous
namespace)::LiveDeb
 11.14%  llc  llc                  [.] bool
__gnu_cxx::__ops::_Iter_pred<(anonymous
namespace)::LiveDebugValues::transferRegisterDef(llvm::MachineInstr&,
std::list<(anonymous namespace)::LiveDebugValues::VarLoc,
  9.74%  llc  llc                  [.] (anonymous
namespace)::LiveDebugValues::runOnMachineFunction(llvm::MachineFunction&)

Note that some functions are wildly inefficient: e.g.
transferTerminatorInst appends one list to another in O(n^2) time. It looks
like at least in some cases it would be beneficial to replace lists with hash
maps. I've created a patch to do so, but the compile time was huge anyway.

Also, do you have an estimate on the total number of times you will consider a
single machine instruction? (as you can scan the same MBB several times).

Currently there's no way to disable this pass: could you consider adding an
option to switch it on/off, or disabling it while working on speeding it up?</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>