Skip to content

Commit 7a9ef10

Browse files
committed
[MLIR] should use dso_local
1 parent ef232a7 commit 7a9ef10

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-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-generic.ll

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,13 @@
77
; CHECK-NOT: res_attrs
88
; CHECK-SAME: }>
99
declare ptr @func_no_param_attrs()
10+
11+
; Ensure that we have dso_local
12+
; CHECK: "llvm.func"()
13+
; CHECK-SAME: <{
14+
; CHECK-SAME: dso_local
15+
; CHECK-SAME: "dsolocal_func"
16+
; CHECK-SAME: }>
17+
define dso_local void @dsolocal_func() {
18+
ret void
19+
}

0 commit comments

Comments
 (0)