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: unassignedb...@nondot.org
          Reporter: nikita....@gmail.com
                CC: arnaud.degrandmai...@arm.com,
                    llvm-bugs@lists.llvm.org, smithp...@googlemail.com,
                    ties.st...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to