Skip to content

AArch64: Fix outline atomic libcall names for arm64ec #144378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions llvm/lib/IR/RuntimeLibcalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ static void setAArch64LibcallNames(RuntimeLibcallsInfo &Info,
LCALLNAME4(RTLIB::OUTLINE_ATOMIC_LDSET, __aarch64_ldset)
LCALLNAME4(RTLIB::OUTLINE_ATOMIC_LDCLR, __aarch64_ldclr)
LCALLNAME4(RTLIB::OUTLINE_ATOMIC_LDEOR, __aarch64_ldeor)
#undef LCALLNAMES
#undef LCALLNAME4
#undef LCALLNAME5

if (TT.isWindowsArm64EC()) {
// FIXME: are there calls we need to exclude from this?
Expand All @@ -54,7 +51,18 @@ static void setAArch64LibcallNames(RuntimeLibcallsInfo &Info,
#include "llvm/IR/RuntimeLibcalls.def"
#undef HANDLE_LIBCALL
#undef LIBCALL_NO_NAME

LCALLNAME5(RTLIB::OUTLINE_ATOMIC_CAS, #__aarch64_cas)
LCALLNAME4(RTLIB::OUTLINE_ATOMIC_SWP, #__aarch64_swp)
LCALLNAME4(RTLIB::OUTLINE_ATOMIC_LDADD, #__aarch64_ldadd)
LCALLNAME4(RTLIB::OUTLINE_ATOMIC_LDSET, #__aarch64_ldset)
LCALLNAME4(RTLIB::OUTLINE_ATOMIC_LDCLR, #__aarch64_ldclr)
LCALLNAME4(RTLIB::OUTLINE_ATOMIC_LDEOR, #__aarch64_ldeor)
}

#undef LCALLNAMES
#undef LCALLNAME4
#undef LCALLNAME5
}

static void setARMLibcallNames(RuntimeLibcallsInfo &Info, const Triple &TT) {
Expand Down
3 changes: 1 addition & 2 deletions llvm/test/CodeGen/AArch64/arm64ec-builtins.ll
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ define i128 @f4(i128 %x, i128 %y) {
ret i128 %r
}

; FIXME: This is wrong; should be "#__aarch64_cas1_relax"
define i8 @f5(i8 %expected, i8 %new, ptr %ptr) "target-features"="+outline-atomics" {
; CHECK-LABEL: "#f5":
; CHECK: bl __aarch64_cas1_relax
; CHECK: bl "#__aarch64_cas1_relax"
%pair = cmpxchg ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1
%r = extractvalue { i8, i1 } %pair, 0
ret i8 %r
Expand Down
Loading