Skip to content

Commit d2f2fde

Browse files
authored
[CIR][CIRGen] Add dsolocal attribute to GlobalOp and FuncOp (#686)
as title. In this PR 1. make setDSOLocal an interface function. 2. implemented shouldAssumeDSOLocal function in CIRGenModule, using the same skeleton as shouldAssumeDSOLocal in OG's CodeGenModule.cpp. 3. added call sites of setDSOLocal within CIRGenModule, like what's in OG's CodeGenModule. 4. fixed printing format 5. LLVM lowering 6. keep CIRGenModule::setDSOLocal(mlir::Operation *Op) wrapper at call sites, so if we make changes to interface, we don't have to touch call sites since there are many. We don't have LLVM test for this PR yet, and it will be addressed by the next PR,: **TODO in the next PR:** 1. Implement setNonAliasAttributes in CIRGenModule.cpp, which should be called by CIRGenModule::buildGlobalFunctionDefinition. That way, we will set dso_local correctly for all func ops who have defs in the module. That way we should have LLVM test case in this next PR. detailed explanation below: Since LLVM asm printer omits dso_local in [isImplicitDSOLocal](https://github.com/llvm/clangir/blob/main/llvm/lib/IR/AsmWriter.cpp#L3689)(), and all we cover so far in CIR all fall into this category, we're not able to have a LLVM test. However, the case [isDeclarationForLinker()](https://github.com/llvm/clangir/blob/c28908396a3ba7bda6345907233e4f5c4e53a33e/clang/lib/CodeGen/CodeGenModule.cpp#L1655) should have a lot of test examples as all func defs should have dso_local, We don't have it CIR is because A to-do in our CG. When OG is building func def, after code is generated, it will call setDSOLocal again via setNonAliasAttributes—>SetCommonAttributes—>setGVProperties. The key difference is now GV is not declaration anymore. so satisfies the test if (!GV->isDeclarationForLinker()) return true; https://github.com/llvm/clangir/blob/f78f9a55e7cd6b9e350556e35097616676cf1f3e/clang/lib/CodeGen/CodeGenModule.cpp#L5864 But our CG missed this step of calling setNonAliasAttributes so it won’t give setDSOLocal another chance to get it right https://github.com/llvm/clangir/blob/c28908396a3ba7bda6345907233e4f5c4e53a33e/clang/lib/CIR/CodeGen/CIRGenModule.cpp#L496 **TODO in the next next PR** 2. add call to setDSOLocal in other parts of CG other than CIRGenModule. 3. implement DefaultVisibility check, didn't do in this PR as LLVM::DefaultVisibility has no direct counterpart in [MLIR::](mlir::SymbolTable::Visibility). Therefore, it takes care examination of cases to see what is the best emulation of hasDefaultVisibility in MLIR/CIR context as far as dsolocal is concerned. **TODO in future** other than DefaultVisibility check, we didn't implement canBenefitFromLocalAlias as it depends on other missing features like setComDat. There is a lot of cases we need to cover, so this is just the first step!
1 parent c289083 commit d2f2fde

21 files changed

+182
-36
lines changed

clang/include/clang/CIR/Dialect/IR/CIROps.td

+3
Original file line numberDiff line numberDiff line change
@@ -1924,6 +1924,7 @@ def GlobalOp : CIR_Op<"global",
19241924
// Note this can also be a FlatSymbolRefAttr
19251925
OptionalAttr<AnyAttr>:$initial_value,
19261926
UnitAttr:$constant,
1927+
UnitAttr:$dsolocal,
19271928
OptionalAttr<I64Attr>:$alignment,
19281929
OptionalAttr<ASTVarDeclInterface>:$ast,
19291930
OptionalAttr<StrAttr>:$section
@@ -1934,6 +1935,7 @@ def GlobalOp : CIR_Op<"global",
19341935
(`constant` $constant^)?
19351936
$linkage
19361937
($tls_model^)?
1938+
(`dsolocal` $dsolocal^)?
19371939
$sym_name
19381940
custom<GlobalOpTypeAndInitialValue>($sym_type, $initial_value, $ctorRegion, $dtorRegion)
19391941
attr-dict
@@ -2671,6 +2673,7 @@ def FuncOp : CIR_Op<"func", [
26712673
UnitAttr:$coroutine,
26722674
UnitAttr:$lambda,
26732675
UnitAttr:$no_proto,
2676+
UnitAttr:$dsolocal,
26742677
DefaultValuedAttr<GlobalLinkageKind,
26752678
"GlobalLinkageKind::ExternalLinkage">:$linkage,
26762679
ExtraFuncAttr:$extra_attrs,

clang/include/clang/CIR/Interfaces/CIROpInterfaces.h

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "clang/AST/Attr.h"
1818
#include "clang/AST/DeclTemplate.h"
1919
#include "clang/AST/Mangle.h"
20+
#include "clang/CIR/Dialect/IR/CIROpsEnums.h"
2021

2122
namespace mlir {
2223
namespace cir {} // namespace cir

clang/include/clang/CIR/Interfaces/CIROpInterfaces.td

+21
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,35 @@ let cppNamespace = "::mlir::cir" in {
4646
/*defaultImplementation=*/[{ return false; }]
4747
>,
4848
InterfaceMethod<"",
49+
"bool", "hasLocalLinkage", (ins), [{}],
50+
/*defaultImplementation=*/[{
51+
return mlir::cir::isLocalLinkage($_op.getLinkage());
52+
}]
53+
>,
54+
InterfaceMethod<"",
55+
"bool", "hasExternalWeakLinkage", (ins), [{}],
56+
/*defaultImplementation=*/[{
57+
return mlir::cir::isExternalWeakLinkage($_op.getLinkage());
58+
}]
59+
>,
60+
InterfaceMethod<"",
4961
"bool", "isDeclarationForLinker", (ins), [{}],
5062
/*defaultImplementation=*/[{
5163
if ($_op.hasAvailableExternallyLinkage())
5264
return true;
5365
return $_op.isDeclaration();
5466
}]
5567
>,
68+
InterfaceMethod<"",
69+
"void", "setDSOLocal", (ins "bool":$val), [{}],
70+
/*defaultImplementation=*/[{
71+
$_op.setDsolocal(val);
72+
}]
73+
>,
5674
];
75+
let extraClassDeclaration = [{
76+
bool canBenefitFromLocalAlias() const;
77+
}];
5778
}
5879

5980
} // namespace mlir::cir

clang/include/clang/CIR/MissingFeatures.h

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ struct MissingFeatures {
4848
static bool hiddenVisibility() { return false; }
4949
static bool protectedVisibility() { return false; }
5050
static bool addCompilerUsedGlobal() { return false; }
51+
static bool supportIFuncAttr() { return false; }
52+
static bool setDefaultVisibility() { return false; }
5153

5254
// Sanitizers
5355
static bool reportGlobalToASan() { return false; }

clang/lib/CIR/CodeGen/CIRGenModule.cpp

+102-1
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,103 @@ bool CIRGenModule::MayBeEmittedEagerly(const ValueDecl *Global) {
364364
return true;
365365
}
366366

367+
static bool hasDefaultVisibility(CIRGlobalValueInterface GV) {
368+
// TODO: we need to have a precise definition of what is a default visibility.
369+
// in the context of MILR and CIR, now we default to
370+
assert(!MissingFeatures::setDefaultVisibility());
371+
return true;
372+
}
373+
374+
static bool shouldAssumeDSOLocal(const CIRGenModule &CGM,
375+
CIRGlobalValueInterface GV) {
376+
if (GV.hasLocalLinkage())
377+
return true;
378+
379+
if (!hasDefaultVisibility(GV) && !GV.hasExternalWeakLinkage()) {
380+
return true;
381+
}
382+
383+
// DLLImport explicitly marks the GV as external.
384+
// so it shouldn't be dso_local
385+
// But we don't have the info set now
386+
assert(!MissingFeatures::setDLLImportDLLExport());
387+
388+
const llvm::Triple &TT = CGM.getTriple();
389+
const auto &CGOpts = CGM.getCodeGenOpts();
390+
if (TT.isWindowsGNUEnvironment()) {
391+
// In MinGW, variables without DLLImport can still be automatically
392+
// imported from a DLL by the linker; don't mark variables that
393+
// potentially could come from another DLL as DSO local.
394+
395+
// With EmulatedTLS, TLS variables can be autoimported from other DLLs
396+
// (and this actually happens in the public interface of libstdc++), so
397+
// such variables can't be marked as DSO local. (Native TLS variables
398+
// can't be dllimported at all, though.)
399+
llvm_unreachable("MinGW not supported here");
400+
}
401+
402+
// On COFF, don't mark 'extern_weak' symbols as DSO local. If these symbols
403+
// remain unresolved in the link, they can be resolved to zero, which is
404+
// outside the current DSO.
405+
if (TT.isOSBinFormatCOFF() && GV.hasExternalWeakLinkage())
406+
return false;
407+
408+
// Every other GV is local on COFF.
409+
// Make an exception for windows OS in the triple: Some firmware builds use
410+
// *-win32-macho triples. This (accidentally?) produced windows relocations
411+
// without GOT tables in older clang versions; Keep this behaviour.
412+
// FIXME: even thread local variables?
413+
if (TT.isOSBinFormatCOFF() || (TT.isOSWindows() && TT.isOSBinFormatMachO()))
414+
return true;
415+
416+
// Only handle COFF and ELF for now.
417+
if (!TT.isOSBinFormatELF())
418+
return false;
419+
420+
llvm::Reloc::Model RM = CGOpts.RelocationModel;
421+
const auto &LOpts = CGM.getLangOpts();
422+
if (RM != llvm::Reloc::Static && !LOpts.PIE) {
423+
// On ELF, if -fno-semantic-interposition is specified and the target
424+
// supports local aliases, there will be neither CC1
425+
// -fsemantic-interposition nor -fhalf-no-semantic-interposition. Set
426+
// dso_local on the function if using a local alias is preferable (can avoid
427+
// PLT indirection).
428+
if (!(isa<mlir::cir::FuncOp>(GV) && GV.canBenefitFromLocalAlias())) {
429+
return false;
430+
}
431+
return !(CGM.getLangOpts().SemanticInterposition ||
432+
CGM.getLangOpts().HalfNoSemanticInterposition);
433+
}
434+
435+
// A definition cannot be preempted from an executable.
436+
if (!GV.isDeclarationForLinker())
437+
return true;
438+
439+
// Most PIC code sequences that assume that a symbol is local cannot produce a
440+
// 0 if it turns out the symbol is undefined. While this is ABI and relocation
441+
// depended, it seems worth it to handle it here.
442+
if (RM == llvm::Reloc::PIC_ && GV.hasExternalWeakLinkage())
443+
return false;
444+
445+
// PowerPC64 prefers TOC indirection to avoid copy relocations.
446+
if (TT.isPPC64())
447+
return false;
448+
449+
if (CGOpts.DirectAccessExternalData) {
450+
llvm_unreachable("-fdirect-access-external-data not supported");
451+
}
452+
453+
// If we can use copy relocations we can assume it is local.
454+
455+
// Otherwise don't assume it is local.
456+
457+
return false;
458+
}
459+
460+
void CIRGenModule::setDSOLocal(CIRGlobalValueInterface GV) const {
461+
GV.setDSOLocal(shouldAssumeDSOLocal(*this, GV));
462+
}
463+
367464
void CIRGenModule::buildGlobal(GlobalDecl GD) {
368465
const auto *Global = cast<ValueDecl>(GD.getDecl());
369466

@@ -1272,7 +1369,6 @@ generateStringLiteral(mlir::Location loc, mlir::TypedAttr C,
12721369
GV.setLinkageAttr(
12731370
mlir::cir::GlobalLinkageKindAttr::get(CGM.getBuilder().getContext(), LT));
12741371
CIRGenModule::setInitializer(GV, C);
1275-
12761372
// TODO(cir)
12771373
assert(!cir::MissingFeatures::threadLocal() && "NYI");
12781374
assert(!cir::MissingFeatures::unnamedAddr() && "NYI");
@@ -1326,6 +1422,7 @@ CIRGenModule::getAddrOfConstantStringFromLiteral(const StringLiteral *S,
13261422
llvm_unreachable("this should never be untyped at this point");
13271423
GV = generateStringLiteral(loc, typedC, LT, *this, GlobalVariableName,
13281424
Alignment);
1425+
setDSOLocal(static_cast<mlir::Operation *>(GV));
13291426
ConstantStringMap[C] = GV;
13301427

13311428
assert(!cir::MissingFeatures::reportGlobalToASan() && "NYI");
@@ -1979,6 +2076,9 @@ void CIRGenModule::setGlobalVisibility(mlir::Operation *GV,
19792076

19802077
void CIRGenModule::setDSOLocal(mlir::Operation *Op) const {
19812078
assert(!MissingFeatures::setDSOLocal());
2079+
if (auto globalValue = dyn_cast<mlir::cir::CIRGlobalValueInterface>(Op)) {
2080+
setDSOLocal(globalValue);
2081+
}
19822082
}
19832083

19842084
void CIRGenModule::setGVProperties(mlir::Operation *Op,
@@ -2750,6 +2850,7 @@ mlir::cir::GlobalOp CIRGenModule::createOrReplaceCXXRuntimeVariable(
27502850
assert(!MissingFeatures::setComdat());
27512851

27522852
GV.setAlignmentAttr(getSize(Alignment));
2853+
setDSOLocal(static_cast<mlir::Operation *>(GV));
27532854
return GV;
27542855
}
27552856

clang/lib/CIR/CodeGen/CIRGenModule.h

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "clang/CIR/Dialect/IR/CIRDialect.h"
3131
#include "clang/CIR/Dialect/IR/CIROpsEnums.h"
3232
#include "clang/CIR/Dialect/IR/CIRTypes.h"
33+
#include "clang/CIR/Interfaces/CIROpInterfaces.h"
3334

3435
#include "llvm/ADT/ScopedHashTable.h"
3536
#include "llvm/ADT/SmallPtrSet.h"
@@ -281,6 +282,8 @@ class CIRGenModule : public CIRGenTypeCache {
281282
void buildDeferredVTables();
282283
bool shouldOpportunisticallyEmitVTables();
283284

285+
void setDSOLocal(mlir::cir::CIRGlobalValueInterface GV) const;
286+
284287
/// Return the appropriate linkage for the vtable, VTT, and type information
285288
/// of the given class.
286289
mlir::cir::GlobalLinkageKind getVTableLinkage(const CXXRecordDecl *RD);

clang/lib/CIR/Dialect/IR/CIRDialect.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -2116,6 +2116,9 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
21162116
if (vis != mlir::SymbolTable::Visibility::Public)
21172117
p << vis << " ";
21182118

2119+
if (getDsolocal())
2120+
p << "dsolocal ";
2121+
21192122
// Print function name, signature, and control.
21202123
p.printSymbolName(getSymName());
21212124
auto fnType = getFunctionType();
@@ -2134,6 +2137,7 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
21342137
getAliaseeAttrName(),
21352138
getBuiltinAttrName(),
21362139
getCoroutineAttrName(),
2140+
getDsolocalAttrName(),
21372141
getExtraAttrsAttrName(),
21382142
getFunctionTypeAttrName(),
21392143
getGlobalCtorAttrName(),

clang/lib/CIR/Interfaces/CIROpInterfaces.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,18 @@
77
//===----------------------------------------------------------------------===//
88
#include "clang/CIR/Interfaces/CIROpInterfaces.h"
99

10+
#include "clang/CIR/Dialect/IR/CIROpsEnums.h"
1011
#include "llvm/ADT/SmallVector.h"
1112

1213
using namespace mlir::cir;
1314

1415
/// Include the generated type qualifiers interfaces.
1516
#include "clang/CIR/Interfaces/CIROpInterfaces.cpp.inc"
17+
18+
#include "clang/CIR/MissingFeatures.h"
19+
20+
bool CIRGlobalValueInterface::canBenefitFromLocalAlias() const {
21+
assert(!::cir::MissingFeatures::supportIFuncAttr());
22+
assert(!::cir::MissingFeatures::setComdat());
23+
return false;
24+
}

clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,7 @@ class CIRFuncLowering : public mlir::OpConversionPattern<mlir::cir::FuncOp> {
15121512
mlir::ConversionPatternRewriter &rewriter) const override {
15131513

15141514
auto fnType = op.getFunctionType();
1515+
auto isDsoLocal = op.getDsolocal();
15151516
mlir::TypeConverter::SignatureConversion signatureConversion(
15161517
fnType.getNumInputs());
15171518

@@ -1545,7 +1546,7 @@ class CIRFuncLowering : public mlir::OpConversionPattern<mlir::cir::FuncOp> {
15451546
filterFuncAttributes(op, /*filterArgAndResAttrs=*/false, attributes);
15461547

15471548
auto fn = rewriter.create<mlir::LLVM::LLVMFuncOp>(
1548-
Loc, op.getName(), llvmFnTy, linkage, false, mlir::LLVM::CConv::C,
1549+
Loc, op.getName(), llvmFnTy, linkage, isDsoLocal, mlir::LLVM::CConv::C,
15491550
mlir::SymbolRefAttr(), attributes);
15501551

15511552
rewriter.inlineRegionBefore(op.getBody(), fn.getBody(), fn.end());
@@ -1654,6 +1655,7 @@ class CIRGlobalOpLowering
16541655
// Fetch required values to create LLVM op.
16551656
const auto llvmType = getTypeConverter()->convertType(op.getSymType());
16561657
const auto isConst = op.getConstant();
1658+
const auto isDsoLocal = op.getDsolocal();
16571659
const auto linkage = convertLinkage(op.getLinkage());
16581660
const auto symbol = op.getSymName();
16591661
const auto loc = op.getLoc();
@@ -1670,7 +1672,7 @@ class CIRGlobalOpLowering
16701672
rewriter.replaceOpWithNewOp<mlir::LLVM::GlobalOp>(
16711673
op, llvmType, isConst, linkage, symbol, mlir::Attribute(),
16721674
/*alignment*/ 0, /*addrSpace*/ 0,
1673-
/*dsoLocal*/ false, /*threadLocal*/ (bool)op.getTlsModelAttr(),
1675+
/*dsoLocal*/ isDsoLocal, /*threadLocal*/ (bool)op.getTlsModelAttr(),
16741676
/*comdat*/ mlir::SymbolRefAttr(), attributes);
16751677
return mlir::success();
16761678
}

clang/test/CIR/CodeGen/array.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void local_stringlit() {
4040
const char *s = "whatnow";
4141
}
4242

43-
// CHECK: cir.global "private" constant internal @".str" = #cir.const_array<"whatnow\00" : !cir.array<!s8i x 8>> : !cir.array<!s8i x 8> {alignment = 1 : i64}
43+
// CHECK: cir.global "private" constant internal dsolocal @".str" = #cir.const_array<"whatnow\00" : !cir.array<!s8i x 8>> : !cir.array<!s8i x 8> {alignment = 1 : i64}
4444
// CHECK: cir.func @_Z15local_stringlitv()
4545
// CHECK-NEXT: %0 = cir.alloca !cir.ptr<!s8i>, !cir.ptr<!cir.ptr<!s8i>>, ["s", init] {alignment = 8 : i64}
4646
// CHECK-NEXT: %1 = cir.get_global @".str" : !cir.ptr<!cir.array<!s8i x 8>>

clang/test/CIR/CodeGen/const-array.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ void bar() {
44
const int arr[1] = {1};
55
}
66

7-
// CHECK: cir.global "private" constant internal @bar.arr = #cir.const_array<[#cir.int<1> : !s32i]> : !cir.array<!s32i x 1> {alignment = 4 : i64}
7+
// CHECK: cir.global "private" constant internal dsolocal @bar.arr = #cir.const_array<[#cir.int<1> : !s32i]> : !cir.array<!s32i x 1> {alignment = 4 : i64}
88
// CHECK: cir.func no_proto @bar()
99
// CHECK: {{.*}} = cir.get_global @bar.arr : !cir.ptr<!cir.array<!s32i x 1>>
1010

clang/test/CIR/CodeGen/coro-task.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ folly::coro::Task<int> go1_lambda() {
338338
co_return co_await task;
339339
}
340340

341-
// CHECK: cir.func coroutine lambda internal private @_ZZ10go1_lambdavENK3$_0clEv{{.*}}22 extra{{.*}}{
341+
// CHECK: cir.func coroutine lambda internal private dsolocal @_ZZ10go1_lambdavENK3$_0clEv{{.*}}22 extra{{.*}}{
342342
// CHECK: cir.func coroutine @_Z10go1_lambdav() {{.*}}22 extra{{.*}}{
343343

344344
folly::coro::Task<int> go4() {

clang/test/CIR/CodeGen/globals.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ int use_func() { return func<int>(); }
4949
// CHECK-NEXT: cir.global external @rgb = #cir.const_array<[#cir.int<0> : !u8i, #cir.int<233> : !u8i, #cir.int<33> : !u8i]> : !cir.array<!u8i x 3>
5050
// CHECK-NEXT: cir.global external @alpha = #cir.const_array<"abc\00" : !cir.array<!s8i x 4>> : !cir.array<!s8i x 4>
5151

52-
// CHECK-NEXT: cir.global "private" constant internal @".str" = #cir.const_array<"example\00" : !cir.array<!s8i x 8>> : !cir.array<!s8i x 8> {alignment = 1 : i64}
52+
// CHECK-NEXT: cir.global "private" constant internal dsolocal @".str" = #cir.const_array<"example\00" : !cir.array<!s8i x 8>> : !cir.array<!s8i x 8> {alignment = 1 : i64}
5353
// CHECK-NEXT: cir.global external @s = #cir.global_view<@".str"> : !cir.ptr<!s8i>
5454

55-
// CHECK-NEXT: cir.global "private" constant internal @".str1" = #cir.const_array<"example1\00" : !cir.array<!s8i x 9>> : !cir.array<!s8i x 9> {alignment = 1 : i64}
55+
// CHECK-NEXT: cir.global "private" constant internal dsolocal @".str1" = #cir.const_array<"example1\00" : !cir.array<!s8i x 9>> : !cir.array<!s8i x 9> {alignment = 1 : i64}
5656
// CHECK-NEXT: cir.global external @s1 = #cir.global_view<@".str1"> : !cir.ptr<!s8i>
5757

5858
// CHECK-NEXT: cir.global external @s2 = #cir.global_view<@".str"> : !cir.ptr<!s8i>

clang/test/CIR/CodeGen/hello.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ int main (void) {
88
}
99

1010
// CHECK: cir.func private @printf(!cir.ptr<!s8i>, ...) -> !s32i
11-
// CHECK: cir.global "private" constant internal @".str" = #cir.const_array<"Hello, world!\0A\00" : !cir.array<!s8i x 15>> : !cir.array<!s8i x 15> {alignment = 1 : i64}
11+
// CHECK: cir.global "private" constant internal dsolocal @".str" = #cir.const_array<"Hello, world!\0A\00" : !cir.array<!s8i x 15>> : !cir.array<!s8i x 15> {alignment = 1 : i64}
1212
// CHECK: cir.func @main() -> !s32i
1313
// CHECK: %0 = cir.alloca !s32i, !cir.ptr<!s32i>, ["__retval"] {alignment = 4 : i64}
1414
// CHECK: %1 = cir.get_global @printf : !cir.ptr<!cir.func<!s32i (!cir.ptr<!s8i>, ...)>>

clang/test/CIR/CodeGen/lambda.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void fn() {
99
// CHECK: !ty_22anon2E222 = !cir.struct<class "anon.2" {!cir.int<u, 8>}>
1010
// CHECK-DAG: module
1111

12-
// CHECK: cir.func lambda internal private @_ZZ2fnvENK3$_0clEv{{.*}}) extra
12+
// CHECK: cir.func lambda internal private dsolocal @_ZZ2fnvENK3$_0clEv{{.*}}) extra
1313

1414
// CHECK: cir.func @_Z2fnv()
1515
// CHECK-NEXT: %0 = cir.alloca !ty_22anon2E222, !cir.ptr<!ty_22anon2E222>, ["a"]
@@ -21,7 +21,7 @@ void l0() {
2121
a();
2222
}
2323

24-
// CHECK: cir.func lambda internal private @_ZZ2l0vENK3$_0clEv({{.*}}) extra
24+
// CHECK: cir.func lambda internal private dsolocal @_ZZ2l0vENK3$_0clEv({{.*}}) extra
2525

2626
// CHECK: %0 = cir.alloca !cir.ptr<!ty_22anon2E422>, !cir.ptr<!cir.ptr<!ty_22anon2E422>>, ["this", init] {alignment = 8 : i64}
2727
// CHECK: cir.store %arg0, %0 : !cir.ptr<!ty_22anon2E422>, !cir.ptr<!cir.ptr<!ty_22anon2E422>>
@@ -99,13 +99,13 @@ int g3() {
9999
}
100100

101101
// lambda operator()
102-
// CHECK: cir.func lambda internal private @_ZZ2g3vENK3$_0clERKi{{.*}}!s32i extra
102+
// CHECK: cir.func lambda internal private dsolocal @_ZZ2g3vENK3$_0clERKi{{.*}}!s32i extra
103103

104104
// lambda __invoke()
105-
// CHECK: cir.func internal private @_ZZ2g3vEN3$_08__invokeERKi
105+
// CHECK: cir.func internal private dsolocal @_ZZ2g3vEN3$_08__invokeERKi
106106

107107
// lambda operator int (*)(int const&)()
108-
// CHECK: cir.func internal private @_ZZ2g3vENK3$_0cvPFiRKiEEv
108+
// CHECK: cir.func internal private dsolocal @_ZZ2g3vENK3$_0cvPFiRKiEEv
109109

110110
// CHECK: cir.func @_Z2g3v() -> !s32i
111111
// CHECK: %0 = cir.alloca !s32i, !cir.ptr<!s32i>, ["__retval"] {alignment = 4 : i64}

0 commit comments

Comments
 (0)