<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 out of memory error when using new pass manager (after emsdk 2.0.17)"
   href="https://bugs.llvm.org/show_bug.cgi?id=52132">52132</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLVM out of memory error when using new pass manager (after emsdk 2.0.17)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </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>wasm
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>amogh.raichur@autodesk.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, sbc@chromium.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>LLVM version: 13.0.0.0-rc1
commit: 31e75512174e1bdaa242ee5c7f30fe56e68c3748

I am using the ninja build system with emscripten. I am able to build my
projects successfully with emsdk 2.0.15 and ninja JOB_POOLS_LINK property set
to 6 (i.e. max 6 parallel link processes).

However, after upgrading to emsdk 2.0.17+ (LLVM 13.0.0.0-rc1), wasm-ld throws
LLVM : out of memory exception OR the build process terminates with SIGKILL -9

In this case, I am able to build my projects only if the ninja JOB_POOL_LINK
property is set to 2 (i.e. max 2 parallel link processes).
Any more than 2 parallel link processes and I get the out of memory error.

I observed that using the -Wl, --lto-legacy-pass-manager linker option resolves
this issue. 

I also noticed that the LLVM legacy pass manager was the default setting till
2.0.15, but it was changed to the new LLVM pass manager in 2.0.17.

It seems like the new LLVM pass manager is causing increased memory consumption
when parallel linker processes are run.</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>