<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.aarch64.ldxr incompatible with opaque pointers"
   href="https://bugs.llvm.org/show_bug.cgi?id=51823">51823</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm.aarch64.ldxr incompatible with opaque pointers
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Backend: AArch64
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>nikita.ppv@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>arnaud.degrandmaison@arm.com, llvm-bugs@lists.llvm.org, smithp352@googlemail.com, Ties.Stuij@arm.com
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>46673
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The AArch64 ldxr/ldxar/stxr/stlxr family of intrinsics currently works like
this:

call i64 @llvm.aarch64.ldxr.p0i8(i8* %addr)

The return value is always i64, and the size of the loaded/stored value is
determined by the pointer element type of the address.

To support opaque pointers, this could be changes in two ways. We could keep
the current approach and require an elementtype attribute:

call i64 @llvm.aarch64.ldxr.p0i8(i8* elementtype(i8) %addr)

Or we could change the definition of the intrinsic to return the loaded type,
rather than i64:

call i8 @llvm.aarch64.ldxr.i8.p0i8(i8* %addr)

The latter variant looks preferable to me. However, I think that needs some
significant changes to how these are lowered/selected. I tried to work on this,
but didn't get far
(<a href="https://gist.github.com/nikic/9b6d48d89d4b6e735d4f100e18c9b08a">https://gist.github.com/nikic/9b6d48d89d4b6e735d4f100e18c9b08a</a>).</pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Remove pointer element types from the IR"
   href="https://bugs.llvm.org/show_bug.cgi?id=46673">Bug 46673</a>] Remove pointer element types from the IR
              </li>
          </ul>
        </div>
        <br>

      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>