Skip to content

Commit 209df5a

Browse files
authored
[CIR] Fix dso_local Func/GlobalOp printer and align with llvm format (#1666)
This adds missing print of `dso_local` to FuncOp. Attribute `dsolocal` was renamed in both `FuncOp` and `GlobalOp` to align with LLVM naming.
1 parent f077eec commit 209df5a

File tree

187 files changed

+956
-962
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+956
-962
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,7 +2467,7 @@ def GlobalOp : CIR_Op<"global",
24672467
OptionalAttr<AnyAttr>:$initial_value,
24682468
UnitAttr:$comdat,
24692469
UnitAttr:$constant,
2470-
UnitAttr:$dsolocal,
2470+
UnitAttr:$dso_local,
24712471
OptionalAttr<I64Attr>:$alignment,
24722472
OptionalAttr<ASTVarDeclInterface>:$ast,
24732473
OptionalAttr<StrAttr>:$section,
@@ -2480,7 +2480,7 @@ def GlobalOp : CIR_Op<"global",
24802480
$linkage
24812481
(`comdat` $comdat^)?
24822482
($tls_model^)?
2483-
(`dsolocal` $dsolocal^)?
2483+
(`dso_local` $dso_local^)?
24842484
(`addrspace` `(` custom<GlobalOpAddrSpace>($addr_space)^ `)`)?
24852485
$sym_name
24862486
custom<GlobalOpTypeAndInitialValue>($sym_type, $initial_value, $ctorRegion, $dtorRegion)
@@ -3660,7 +3660,7 @@ def FuncOp : CIR_Op<"func", [
36603660
UnitAttr:$coroutine,
36613661
UnitAttr:$lambda,
36623662
UnitAttr:$no_proto,
3663-
UnitAttr:$dsolocal,
3663+
UnitAttr:$dso_local,
36643664
DefaultValuedAttr<GlobalLinkageKind,
36653665
"GlobalLinkageKind::ExternalLinkage">:$linkage,
36663666
DefaultValuedAttr<CallingConv,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,13 @@ let cppNamespace = "::cir" in {
142142
InterfaceMethod<"",
143143
"void", "setDSOLocal", (ins "bool":$val), [{}],
144144
/*defaultImplementation=*/[{
145-
$_op.setDsolocal(val);
145+
$_op.setDsoLocal(val);
146146
}]
147147
>,
148148
InterfaceMethod<"",
149149
"bool", "isDSOLocal", (ins), [{}],
150150
/*defaultImplementation=*/[{
151-
return $_op.getDsolocal();
151+
return $_op.getDsoLocal();
152152
}]
153153
>,
154154
InterfaceMethod<"",

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2321,7 +2321,7 @@ ParseResult cir::FuncOp::parse(OpAsmParser &parser, OperationState &state) {
23212321
auto visNameAttr = getSymVisibilityAttrName(state.name);
23222322
auto noProtoNameAttr = getNoProtoAttrName(state.name);
23232323
auto visibilityNameAttr = getGlobalVisibilityAttrName(state.name);
2324-
auto dsolocalNameAttr = getDsolocalAttrName(state.name);
2324+
auto dsoLocalNameAttr = getDsoLocalAttrName(state.name);
23252325
auto annotationsNameAttr = getAnnotationsAttrName(state.name);
23262326
if (::mlir::succeeded(parser.parseOptionalKeyword(builtinNameAttr.strref())))
23272327
state.addAttribute(builtinNameAttr, parser.getBuilder().getUnitAttr());
@@ -2354,9 +2354,8 @@ ParseResult cir::FuncOp::parse(OpAsmParser &parser, OperationState &state) {
23542354
parseVisibilityAttr(parser, cirVisibilityAttr);
23552355
state.addAttribute(visibilityNameAttr, cirVisibilityAttr);
23562356

2357-
// TODO: It is unclear whether this is printed in the pretty-printer
2358-
if (parser.parseOptionalKeyword(dsolocalNameAttr).succeeded())
2359-
state.addAttribute(dsolocalNameAttr, parser.getBuilder().getUnitAttr());
2357+
if (parser.parseOptionalKeyword(dsoLocalNameAttr).succeeded())
2358+
state.addAttribute(dsoLocalNameAttr, parser.getBuilder().getUnitAttr());
23602359

23612360
StringAttr nameAttr;
23622361
llvm::SmallVector<OpAsmParser::Argument, 8> arguments;
@@ -2568,6 +2567,9 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
25682567
printVisibilityAttr(p, cirVisibilityAttr);
25692568
}
25702569

2570+
if (getDsoLocal())
2571+
p << " dso_local";
2572+
25712573
// Print function name, signature, and control.
25722574
p << ' ';
25732575
p.printSymbolName(getSymName());
@@ -2585,7 +2587,7 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
25852587
p, *this,
25862588
// These are all omitted since they are custom printed already.
25872589
{getAliaseeAttrName(), getBuiltinAttrName(), getCoroutineAttrName(),
2588-
getDsolocalAttrName(), getExtraAttrsAttrName(),
2590+
getDsoLocalAttrName(), getExtraAttrsAttrName(),
25892591
getFunctionTypeAttrName(), getGlobalCtorAttrName(),
25902592
getGlobalDtorAttrName(), getLambdaAttrName(), getLinkageAttrName(),
25912593
getCallingConvAttrName(), getNoProtoAttrName(),

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,18 +2133,19 @@ void CIRToLLVMFuncOpLowering::lowerFuncAttributes(
21332133
cir::FuncOp func, bool filterArgAndResAttrs,
21342134
SmallVectorImpl<mlir::NamedAttribute> &result) const {
21352135
for (auto attr : func->getAttrs()) {
2136-
if (attr.getName() == mlir::SymbolTable::getSymbolAttrName() ||
2137-
attr.getName() == func.getFunctionTypeAttrName() ||
2138-
attr.getName() == getLinkageAttrNameString() ||
2139-
attr.getName() == func.getCallingConvAttrName() ||
2140-
(filterArgAndResAttrs &&
2141-
(attr.getName() == func.getArgAttrsAttrName() ||
2142-
attr.getName() == func.getResAttrsAttrName())))
2136+
StringRef name = attr.getName();
2137+
if (name == mlir::SymbolTable::getSymbolAttrName() ||
2138+
name == func.getFunctionTypeAttrName() ||
2139+
name == getLinkageAttrNameString() ||
2140+
name == func.getCallingConvAttrName() ||
2141+
name == func.getDsoLocalAttrName() ||
2142+
(filterArgAndResAttrs && (name == func.getArgAttrsAttrName() ||
2143+
name == func.getResAttrsAttrName())))
21432144
continue;
21442145

21452146
// `CIRDialectLLVMIRTranslationInterface` requires "cir." prefix for
21462147
// dialect specific attributes, rename them.
2147-
if (attr.getName() == func.getExtraAttrsAttrName()) {
2148+
if (name == func.getExtraAttrsAttrName()) {
21482149
std::string cirName = "cir." + func.getExtraAttrsAttrName().str();
21492150
attr.setName(mlir::StringAttr::get(getContext(), cirName));
21502151

@@ -2191,7 +2192,7 @@ mlir::LogicalResult CIRToLLVMFuncOpLowering::matchAndRewrite(
21912192
mlir::ConversionPatternRewriter &rewriter) const {
21922193

21932194
auto fnType = op.getFunctionType();
2194-
auto isDsoLocal = op.getDsolocal();
2195+
auto isDsoLocal = op.getDsoLocal();
21952196
mlir::TypeConverter::SignatureConversion signatureConversion(
21962197
fnType.getNumInputs());
21972198

@@ -2562,7 +2563,7 @@ mlir::LogicalResult CIRToLLVMGlobalOpLowering::matchAndRewrite(
25622563
const auto llvmType =
25632564
convertTypeForMemory(*getTypeConverter(), dataLayout, cirSymType);
25642565
const auto isConst = op.getConstant();
2565-
const auto isDsoLocal = op.getDsolocal();
2566+
const auto isDsoLocal = op.getDsoLocal();
25662567
const auto linkage = convertLinkage(op.getLinkage());
25672568
const auto symbol = op.getSymName();
25682569
mlir::Attribute init = op.getInitialValueAttr();

clang/test/CIR/CallConvLowering/AArch64/aarch64-cc-structs.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <stdint.h>
55

66
typedef struct {
7-
short a;
7+
short a;
88
} LT_64;
99

1010
typedef struct {
@@ -67,7 +67,7 @@ EQ_128 ret_eq_128() {
6767
return x;
6868
}
6969

70-
// CHECK: cir.func {{.*@ret_gt_128}}(%arg0: !cir.ptr<!rec_GT_128>
70+
// CHECK: cir.func {{.*@ret_gt_128}}(%arg0: !cir.ptr<!rec_GT_128>
7171
// CHECK-NOT: cir.return {{%.*}}
7272
GT_128 ret_gt_128() {
7373
GT_128 x;
@@ -77,7 +77,7 @@ GT_128 ret_gt_128() {
7777
typedef struct {
7878
int a;
7979
int b;
80-
int c;
80+
int c;
8181
} S;
8282

8383
// CHECK: cir.func {{.*@retS}}() -> !cir.array<!u64i x 2>
@@ -90,7 +90,7 @@ typedef struct {
9090
// CHECK: %[[#V5:]] = cir.load{{.*}} %[[#V1]] : !cir.ptr<!cir.array<!u64i x 2>>, !cir.array<!u64i x 2>
9191
// CHECK: cir.return %[[#V5]] : !cir.array<!u64i x 2>
9292

93-
// LLVM: [2 x i64] @retS()
93+
// LLVM: [2 x i64] @retS()
9494
// LLVM: %[[#V1:]] = alloca %struct.S, i64 1, align 4
9595
// LLVM: %[[#V2:]] = alloca [2 x i64], i64 1, align 8
9696
// LLVM: call void @llvm.memcpy.p0.p0.i64(ptr %[[#V2]], ptr %[[#V1]], i64 12, i1 false)
@@ -142,7 +142,7 @@ void pass_lt_128(LT_128 s) {}
142142
// LLVM: store [2 x i64] %0, ptr %[[#V1]], align 8
143143
void pass_eq_128(EQ_128 s) {}
144144

145-
// CHECK: cir.func @pass_gt_128(%arg0: !cir.ptr<!rec_GT_128>
145+
// CHECK: cir.func dso_local @pass_gt_128(%arg0: !cir.ptr<!rec_GT_128>
146146
// CHECK: %[[#V0:]] = cir.alloca !cir.ptr<!rec_GT_128>, !cir.ptr<!cir.ptr<!rec_GT_128>>, [""] {alignment = 8 : i64}
147147
// CHECK: cir.store{{.*}} %arg0, %[[#V0]] : !cir.ptr<!rec_GT_128>, !cir.ptr<!cir.ptr<!rec_GT_128>>
148148
// CHECK: %[[#V1:]] = cir.load{{.*}} %[[#V0]] : !cir.ptr<!cir.ptr<!rec_GT_128>>, !cir.ptr<!rec_GT_128>
@@ -153,7 +153,7 @@ void pass_eq_128(EQ_128 s) {}
153153
// LLVM: %[[#V2:]] = load ptr, ptr %[[#V1]], align 8
154154
void pass_gt_128(GT_128 s) {}
155155

156-
// CHECK: cir.func @get_gt_128(%arg0: !cir.ptr<!rec_GT_128> {{.*}}, %arg1: !cir.ptr<!rec_GT_128>
156+
// CHECK: cir.func dso_local @get_gt_128(%arg0: !cir.ptr<!rec_GT_128> {{.*}}, %arg1: !cir.ptr<!rec_GT_128>
157157
// CHECK: %[[#V0:]] = cir.alloca !cir.ptr<!rec_GT_128>, !cir.ptr<!cir.ptr<!rec_GT_128>>, [""] {alignment = 8 : i64}
158158
// CHECK: cir.store{{.*}} %arg1, %[[#V0]] : !cir.ptr<!rec_GT_128>, !cir.ptr<!cir.ptr<!rec_GT_128>>
159159
// CHECK: %[[#V1:]] = cir.load{{.*}} %[[#V0]] : !cir.ptr<!cir.ptr<!rec_GT_128>>, !cir.ptr<!rec_GT_128>
@@ -170,7 +170,7 @@ GT_128 get_gt_128(GT_128 s) {
170170
return s;
171171
}
172172

173-
// CHECK: cir.func no_proto @call_and_get_gt_128(%arg0: !cir.ptr<!rec_GT_128>
173+
// CHECK: cir.func no_proto dso_local @call_and_get_gt_128(%arg0: !cir.ptr<!rec_GT_128>
174174
// CHECK: %[[#V0:]] = cir.alloca !rec_GT_128, !cir.ptr<!rec_GT_128>, ["tmp"] {alignment = 8 : i64}
175175
// CHECK: %[[#V1:]] = cir.load{{.*}} %arg0 : !cir.ptr<!rec_GT_128>, !rec_GT_128
176176
// CHECK: %[[#V2:]] = cir.alloca !rec_GT_128, !cir.ptr<!rec_GT_128>, [""] {alignment = 8 : i64}
@@ -194,7 +194,7 @@ GT_128 call_and_get_gt_128() {
194194
s = get_gt_128(s);
195195
return s;
196196
}
197-
// CHECK: cir.func @passS(%arg0: !cir.array<!u64i x 2>
197+
// CHECK: cir.func dso_local @passS(%arg0: !cir.array<!u64i x 2>
198198
// CHECK: %[[#V0:]] = cir.alloca !rec_S, !cir.ptr<!rec_S>, [""] {alignment = 4 : i64}
199199
// CHECK: %[[#V1:]] = cir.alloca !cir.array<!u64i x 2>, !cir.ptr<!cir.array<!u64i x 2>>, ["tmp"] {alignment = 8 : i64}
200200
// CHECK: cir.store{{.*}} %arg0, %[[#V1]] : !cir.array<!u64i x 2>, !cir.ptr<!cir.array<!u64i x 2>>
@@ -268,7 +268,7 @@ typedef struct {
268268
int a[42];
269269
} CAT;
270270

271-
// CHECK: cir.func @pass_cat(%arg0: !cir.ptr<!rec_CAT>
271+
// CHECK: cir.func dso_local @pass_cat(%arg0: !cir.ptr<!rec_CAT>
272272
// CHECK: %[[#V0:]] = cir.alloca !cir.ptr<!rec_CAT>, !cir.ptr<!cir.ptr<!rec_CAT>>, [""] {alignment = 8 : i64}
273273
// CHECK: cir.store{{.*}} %arg0, %[[#V0]] : !cir.ptr<!rec_CAT>, !cir.ptr<!cir.ptr<!rec_CAT>>
274274
// CHECK: %[[#V1:]] = cir.load{{.*}} %[[#V0]] : !cir.ptr<!cir.ptr<!rec_CAT>>, !cir.ptr<!rec_CAT>
@@ -290,7 +290,7 @@ typedef struct {
290290
};
291291
} NESTED_U;
292292

293-
// CHECK: cir.func @pass_nested_u(%arg0: !u64i
293+
// CHECK: cir.func dso_local @pass_nested_u(%arg0: !u64i
294294
// CHECK: %[[#V0:]] = cir.alloca !rec_NESTED_U, !cir.ptr<!rec_NESTED_U>, [""] {alignment = 4 : i64}
295295
// CHECK: %[[#V1:]] = cir.cast(integral, %arg0 : !u64i), !u16i
296296
// CHECK: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr<!rec_NESTED_U>
@@ -304,7 +304,7 @@ typedef struct {
304304
// LLVM: ret void
305305
void pass_nested_u(NESTED_U a) {}
306306

307-
// CHECK: cir.func no_proto @call_nested_u()
307+
// CHECK: cir.func no_proto dso_local @call_nested_u()
308308
// CHECK: %[[#V0:]] = cir.alloca !rec_NESTED_U, !cir.ptr<!rec_NESTED_U>
309309
// CHECK: %[[#V1:]] = cir.alloca !u64i, !cir.ptr<!u64i>, ["tmp"]
310310
// CHECK: %[[#V2:]] = cir.load{{.*}} %[[#V0]] : !cir.ptr<!rec_NESTED_U>, !rec_NESTED_U
@@ -355,7 +355,7 @@ void bar(void) {
355355
PackedS1 y = foo();
356356
}
357357

358-
// CHECK: cir.func @bar
358+
// CHECK: cir.func dso_local @bar
359359
// CHECK: %[[#V0:]] = cir.alloca !rec_PackedS1, !cir.ptr<!rec_PackedS1>, ["y", init]
360360
// CHECK: %[[#V1:]] = cir.alloca !cir.array<!u64i x 2>, !cir.ptr<!cir.array<!u64i x 2>>, ["tmp"]
361361
// CHECK: %[[#V2:]] = cir.call @foo() : () -> !cir.array<!u64i x 2>
@@ -394,7 +394,7 @@ void qux(void) {
394394
}
395395

396396
// check source of memcpy
397-
// CHECK: cir.func @qux
397+
// CHECK: cir.func dso_local @qux
398398
// CHECK: %[[#V0:]] = cir.alloca !cir.ptr<!rec_PackedS2>, !cir.ptr<!cir.ptr<!rec_PackedS2>>, ["s1", init]
399399
// CHECK: %[[#V1:]] = cir.alloca !u64i, !cir.ptr<!u64i>, ["tmp"]
400400
// CHECK: %[[#V2:]] = cir.get_global @g : !cir.ptr<!cir.array<!rec_PackedS2 x 3>>
@@ -403,9 +403,9 @@ void qux(void) {
403403
// CHECK: %[[#V5:]] = cir.ptr_stride(%[[#V4]] : !cir.ptr<!rec_PackedS2>, %[[#V3]] : !s32i), !cir.ptr<!rec_PackedS2>
404404
// CHECK: cir.store{{.*}} %[[#V5]], %[[#V0]] : !cir.ptr<!rec_PackedS2>, !cir.ptr<!cir.ptr<!rec_PackedS2>>
405405
// CHECK: %[[#V6:]] = cir.load deref{{.*}} %[[#V0]] : !cir.ptr<!cir.ptr<!rec_PackedS2>>, !cir.ptr<!rec_PackedS2>
406-
// CHECK: %[[#V7:]] = cir.cast(bitcast, %[[#V6]] : !cir.ptr<!rec_PackedS2>), !cir.ptr<!void>
406+
// CHECK: %[[#V7:]] = cir.cast(bitcast, %[[#V6]] : !cir.ptr<!rec_PackedS2>), !cir.ptr<!void>
407407
// CHECK: %[[#V8:]] = cir.const #cir.int<6> : !u64i
408-
// CHECK: cir.libc.memcpy %[[#V8]] bytes from %[[#V7]]
408+
// CHECK: cir.libc.memcpy %[[#V8]] bytes from %[[#V7]]
409409

410410
// Note: GEP emitted by cir might not be the same as LLVM, due to constant folding.
411411
// LLVM: void @qux

clang/test/CIR/CallConvLowering/AArch64/basic.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@ bool Bool(bool a) {
1515
return Bool(a);
1616
}
1717

18-
// CHECK: cir.func @_Z5UCharh(%arg0: !u8i loc({{.+}})) -> !u8i
18+
// CHECK: cir.func dso_local @_Z5UCharh(%arg0: !u8i loc({{.+}})) -> !u8i
1919
unsigned char UChar(unsigned char c) {
2020
// CHECK: cir.call @_Z5UCharh(%2) : (!u8i) -> !u8i
2121
return UChar(c);
2222
}
23-
// CHECK: cir.func @_Z6UShortt(%arg0: !u16i loc({{.+}})) -> !u16i
23+
// CHECK: cir.func dso_local @_Z6UShortt(%arg0: !u16i loc({{.+}})) -> !u16i
2424
unsigned short UShort(unsigned short s) {
2525
// CHECK: cir.call @_Z6UShortt(%2) : (!u16i) -> !u16i
2626
return UShort(s);
2727
}
28-
// CHECK: cir.func @_Z4UIntj(%arg0: !u32i loc({{.+}})) -> !u32i
28+
// CHECK: cir.func dso_local @_Z4UIntj(%arg0: !u32i loc({{.+}})) -> !u32i
2929
unsigned int UInt(unsigned int i) {
3030
// CHECK: cir.call @_Z4UIntj(%2) : (!u32i) -> !u32i
3131
return UInt(i);
3232
}
33-
// CHECK: cir.func @_Z5ULongm(%arg0: !u64i loc({{.+}})) -> !u64i
33+
// CHECK: cir.func dso_local @_Z5ULongm(%arg0: !u64i loc({{.+}})) -> !u64i
3434
unsigned long ULong(unsigned long l) {
3535
// CHECK: cir.call @_Z5ULongm(%2) : (!u64i) -> !u64i
3636
return ULong(l);
3737
}
38-
// CHECK: cir.func @_Z9ULongLongy(%arg0: !u64i loc({{.+}})) -> !u64i
38+
// CHECK: cir.func dso_local @_Z9ULongLongy(%arg0: !u64i loc({{.+}})) -> !u64i
3939
unsigned long long ULongLong(unsigned long long l) {
4040
// CHECK: cir.call @_Z9ULongLongy(%2) : (!u64i) -> !u64i
4141
return ULongLong(l);
@@ -44,27 +44,27 @@ unsigned long long ULongLong(unsigned long long l) {
4444

4545
/// Test call conv lowering for trivial signed cases. ///
4646

47-
// CHECK: cir.func @_Z4Chara(%arg0: !s8i loc({{.+}})) -> !s8i
47+
// CHECK: cir.func dso_local @_Z4Chara(%arg0: !s8i loc({{.+}})) -> !s8i
4848
char Char(signed char c) {
4949
// CHECK: cir.call @_Z4Chara(%{{.+}}) : (!s8i) -> !s8i
5050
return Char(c);
5151
}
52-
// CHECK: cir.func @_Z5Shorts(%arg0: !s16i loc({{.+}})) -> !s16i
52+
// CHECK: cir.func dso_local @_Z5Shorts(%arg0: !s16i loc({{.+}})) -> !s16i
5353
short Short(short s) {
5454
// CHECK: cir.call @_Z5Shorts(%{{.+}}) : (!s16i) -> !s16i
5555
return Short(s);
5656
}
57-
// CHECK: cir.func @_Z3Inti(%arg0: !s32i loc({{.+}})) -> !s32i
57+
// CHECK: cir.func dso_local @_Z3Inti(%arg0: !s32i loc({{.+}})) -> !s32i
5858
int Int(int i) {
5959
// CHECK: cir.call @_Z3Inti(%{{.+}}) : (!s32i) -> !s32i
6060
return Int(i);
6161
}
62-
// CHECK: cir.func @_Z4Longl(%arg0: !s64i loc({{.+}})) -> !s64i
62+
// CHECK: cir.func dso_local @_Z4Longl(%arg0: !s64i loc({{.+}})) -> !s64i
6363
long Long(long l) {
6464
// CHECK: cir.call @_Z4Longl(%{{.+}}) : (!s64i) -> !s64i
6565
return Long(l);
6666
}
67-
// CHECK: cir.func @_Z8LongLongx(%arg0: !s64i loc({{.+}})) -> !s64i
67+
// CHECK: cir.func dso_local @_Z8LongLongx(%arg0: !s64i loc({{.+}})) -> !s64i
6868
long long LongLong(long long l) {
6969
// CHECK: cir.call @_Z8LongLongx(%{{.+}}) : (!s64i) -> !s64i
7070
return LongLong(l);
@@ -73,12 +73,12 @@ long long LongLong(long long l) {
7373

7474
/// Test call conv lowering for floating point. ///
7575

76-
// CHECK: cir.func @_Z5Floatf(%arg0: !cir.float loc({{.+}})) -> !cir.float
76+
// CHECK: cir.func dso_local @_Z5Floatf(%arg0: !cir.float loc({{.+}})) -> !cir.float
7777
float Float(float f) {
7878
// cir.call @_Z5Floatf(%{{.+}}) : (!cir.float) -> !cir.float
7979
return Float(f);
8080
}
81-
// CHECK: cir.func @_Z6Doubled(%arg0: !cir.double loc({{.+}})) -> !cir.double
81+
// CHECK: cir.func dso_local @_Z6Doubled(%arg0: !cir.double loc({{.+}})) -> !cir.double
8282
double Double(double d) {
8383
// cir.call @_Z6Doubled(%{{.+}}) : (!cir.double) -> !cir.double
8484
return Double(d);

clang/test/CIR/CallConvLowering/AArch64/ptr-fields.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ typedef struct {
1111

1212
int foo(int x) { return x; }
1313

14-
// CIR: cir.func @passA(%arg0: !u64i
14+
// CIR: cir.func dso_local @passA(%arg0: !u64i
1515
// CIR: %[[#V0:]] = cir.alloca !rec_A, !cir.ptr<!rec_A>, [""] {alignment = 4 : i64}
1616
// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr<!rec_A>), !cir.ptr<!u64i>
1717
// CIR: cir.store{{.*}} %arg0, %[[#V1]] : !u64i, !cir.ptr<!u64i>
@@ -36,7 +36,7 @@ typedef struct {
3636
S_1* s;
3737
} S_2;
3838

39-
// CIR: cir.func @passB(%arg0: !u64i
39+
// CIR: cir.func dso_local @passB(%arg0: !u64i
4040
// CIR: %[[#V0:]] = cir.alloca !rec_S_2, !cir.ptr<!rec_S_2>, [""] {alignment = 4 : i64}
4141
// CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr<!rec_S_2>), !cir.ptr<!u64i>
4242
// CIR: cir.store{{.*}} %arg0, %[[#V1]] : !u64i, !cir.ptr<!u64i>

0 commit comments

Comments
 (0)