Skip to content

Commit b8c075e

Browse files
committed
[MLIR] should use dso_local
1 parent 2e43f39 commit b8c075e

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
@@ -2128,7 +2128,7 @@ LogicalResult ModuleImport::processFunction(llvm::Function *func) {
21282128
iface.isConvertibleIntrinsic(func->getIntrinsicID()))
21292129
return success();
21302130

2131-
bool dsoLocal = func->hasLocalLinkage();
2131+
bool dsoLocal = func->isDSOLocal();
21322132
CConv cconv = convertCConvFromLLVM(func->getCallingConv());
21332133

21342134
// 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)