Skip to content

Commit 1364490

Browse files
committed
[win][arm64ec] Handle 'externally available' functions
1 parent efbbc0b commit 1364490

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

llvm/lib/Target/AArch64/AArch64Arm64ECCallLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ bool AArch64Arm64ECCallLowering::runOnModule(Module &Mod) {
872872
if (!F.isDeclaration() && (!F.hasLocalLinkage() || F.hasAddressTaken()) &&
873873
F.getCallingConv() != CallingConv::ARM64EC_Thunk_Native &&
874874
F.getCallingConv() != CallingConv::ARM64EC_Thunk_X64) {
875-
if (!F.hasComdat())
875+
if (!F.hasComdat() && !F.isDeclarationForLinker())
876876
F.setComdat(Mod.getOrInsertComdat(F.getName()));
877877
ThunkMapping.push_back(
878878
{&F, buildEntryThunk(&F), Arm64ECThunkType::Entry});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
; RUN: llc -mtriple arm64ec-windows-msvc < %s
2+
3+
; Arm64EC Regression Test: The Arm64EC Call Lowering was placing "available
4+
; externally" items in COMDATs, which is not permitted by the module verifier.
5+
6+
define available_externally i32 @f() {
7+
entry:
8+
ret i32 0
9+
}

0 commit comments

Comments
 (0)