Skip to content

Commit 8eb4af9

Browse files
committed
[MLIR] should use dso_local
1 parent ef232a7 commit 8eb4af9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

mlir/lib/Target/LLVMIR/ModuleImport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2106,7 +2106,7 @@ LogicalResult ModuleImport::processFunction(llvm::Function *func) {
21062106
iface.isConvertibleIntrinsic(func->getIntrinsicID()))
21072107
return success();
21082108

2109-
bool dsoLocal = func->hasLocalLinkage();
2109+
bool dsoLocal = func->isDSOLocal();
21102110
CConv cconv = convertCConvFromLLVM(func->getCallingConv());
21112111

21122112
// Insert the function at the end of the module.

mlir/test/Target/LLVMIR/Import/function-attributes.ll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ define internal spir_func void @spir_func_internal() {
1010
ret void
1111
}
1212

13+
; Ensure that we have dso_local;
14+
; CHECK : llvm.func @dsolocal_func() attributes{dso_local}
15+
define dso_local void @dsolocal_func() {
16+
ret void
17+
}
18+
1319
; // -----
1420

1521
; CHECK-LABEL: @func_readnone

0 commit comments

Comments
 (0)