<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 - Support for Relative VTables C++ ABI in Whole Program Devirtualization"
   href="https://bugs.llvm.org/show_bug.cgi?id=50048">50048</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Support for Relative VTables C++ ABI in Whole Program Devirtualization
          </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>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Global Analyses
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Currently, whole program devirtualization doesn't actually take effect on
vtables built under the relative vtables ABI. The `DevirtModule` pass is still
run, but it doesn't detect any vtable call slots because the transformation
attempts to pattern match against instructions that look like a load into the
vtable (ie. bitcasts, loads, GEPs).

More specifically, within `DevirtModule::run`, virtual function call sites are
added through a call to `DevirtModule::scanTypeTestUsers`, which eventually
calls `findLoadCallsAtConstantOffset`. This function attempts to check if calls
made to a vptr are done through bitcasts, loads, or GEPs. Under RV, loads to
the vtable are instead made with a call to the intrinsic `llvm.load.relative`.
Because we don't currently check for this intrinsic, no call sites are
recorded, and the pass doesn't make any transformations. This means that
devirtualization won't actually take place under RV.

A first step would be to add the proper checks for supporting RV in this case.
It's likely that we will run into other build/runtime issues after this though
since there may be other assumptions made about the vtable layout or how it's
accessed within WPD.</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>