[llvm-bugs] [Bug 51823] New: llvm.aarch64.ldxr incompatible with opaque pointers

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Sep 11 06:40:00 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51823

            Bug ID: 51823
           Summary: llvm.aarch64.ldxr incompatible with opaque pointers
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: nikita.ppv at gmail.com
                CC: arnaud.degrandmaison at arm.com,
                    llvm-bugs at lists.llvm.org, smithp352 at googlemail.com,
                    Ties.Stuij at arm.com
            Blocks: 46673

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
(https://gist.github.com/nikic/9b6d48d89d4b6e735d4f100e18c9b08a).


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=46673
[Bug 46673] Remove pointer element types from the IR
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210911/d66fb01c/attachment-0001.html>


More information about the llvm-bugs mailing list