From 5077e12ec39ef44164a5cb2889f560bed25ea5de Mon Sep 17 00:00:00 2001 From: xlauko Date: Sun, 30 Nov 2025 21:02:03 +0100 Subject: [PATCH] [CIR] Align inline-kind FuncOp attribute with incubator Switches to more efficient explicit enum property instead of a wrapped storage, simplifying the string representation. The attribute is now placed before the symbol name for consistency with other FuncOp attributes. FileCheck patterns are also simplified to match only the attributes under test. --- .../include/clang/CIR/Dialect/IR/CIRAttrs.td | 42 +--------- clang/include/clang/CIR/Dialect/IR/CIROps.td | 54 +++++++------ clang/lib/CIR/CodeGen/CIRGenExpr.cpp | 3 +- clang/lib/CIR/CodeGen/CIRGenModule.cpp | 19 ++--- clang/lib/CIR/Dialect/IR/CIRDialect.cpp | 80 +++++++++++-------- .../CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp | 8 +- .../CIR/CodeGen/aapcs-volatile-bitfields.c | 14 ++-- .../CIR/CodeGen/address-space-conversion.cpp | 8 +- clang/test/CIR/CodeGen/address-space.c | 6 +- clang/test/CIR/CodeGen/array-ctor.cpp | 8 +- .../CIR/CodeGen/asm-label-inline-builtins.c | 2 +- clang/test/CIR/CodeGen/assign-operator.cpp | 4 +- clang/test/CIR/CodeGen/bitfield-union.c | 2 +- clang/test/CIR/CodeGen/bitfields.c | 6 +- clang/test/CIR/CodeGen/bitfields.cpp | 6 +- clang/test/CIR/CodeGen/bitfields_be.c | 4 +- clang/test/CIR/CodeGen/constant-inits.cpp | 2 +- clang/test/CIR/CodeGen/copy-constructor.cpp | 2 +- clang/test/CIR/CodeGen/coro-task.cpp | 4 +- .../CIR/CodeGen/cxx-conversion-operators.cpp | 10 +-- clang/test/CIR/CodeGen/delete.cpp | 8 +- clang/test/CIR/CodeGen/destructors.cpp | 6 +- clang/test/CIR/CodeGen/dtors.cpp | 2 +- clang/test/CIR/CodeGen/dynamic-cast.cpp | 12 +-- clang/test/CIR/CodeGen/global-ctor-dtor.cpp | 8 +- clang/test/CIR/CodeGen/goto.cpp | 16 ++-- clang/test/CIR/CodeGen/inline-attributes.cpp | 12 +-- clang/test/CIR/CodeGen/label-values.c | 8 +- clang/test/CIR/CodeGen/label.c | 14 ++-- .../CIR/CodeGen/lambda-static-invoker.cpp | 6 +- clang/test/CIR/CodeGen/lambda.cpp | 28 +++---- clang/test/CIR/CodeGen/linkage-spec.cpp | 28 +++---- clang/test/CIR/CodeGen/no-prototype.c | 16 ++-- clang/test/CIR/CodeGen/placement-new.cpp | 2 +- clang/test/CIR/CodeGen/ptrdiff.cpp | 2 +- clang/test/CIR/CodeGen/statement-exprs.c | 16 ++-- clang/test/CIR/CodeGen/stmt-expr.cpp | 4 +- clang/test/CIR/CodeGen/var_arg.c | 4 +- .../CIR/CodeGen/variable-decomposition.cpp | 2 +- clang/test/CIR/CodeGen/vbase.cpp | 2 +- clang/test/CIR/CodeGen/volatile.cpp | 20 ++--- clang/test/CIR/CodeGen/vtable-emission.cpp | 4 +- .../CIR/CodeGenBuiltins/builtin-fcmp-sse.c | 16 ++-- .../test/CIR/CodeGenBuiltins/builtin_inline.c | 2 +- .../CIR/CodeGenBuiltins/builtin_prefetch.c | 2 +- .../CIR/CodeGenBuiltins/builtins-overflow.cpp | 60 +++++++------- clang/test/CIR/IR/inline-attrs.cir | 37 +++++---- clang/test/CIR/func-linkage.cpp | 8 +- 48 files changed, 306 insertions(+), 323 deletions(-) diff --git a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td index 12bc9cf7b5b04..98d4636dafc29 100644 --- a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td +++ b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td @@ -1085,44 +1085,10 @@ def CIR_TypeInfoAttr : CIR_Attr<"TypeInfo", "typeinfo", [TypedAttrInterface]> { //===----------------------------------------------------------------------===// def CIR_InlineKind : CIR_I32EnumAttr<"InlineKind", "inlineKind", [ - I32EnumAttrCase<"NoInline", 1, "never">, - I32EnumAttrCase<"AlwaysInline", 2, "always">, - I32EnumAttrCase<"InlineHint", 3, "hint"> -]> { - let genSpecializedAttr = 0; -} - -def CIR_InlineAttr : CIR_EnumAttr { - let summary = "Inline attribute"; - let description = [{ - Inline attribute represents user directives for inlining behavior. - This attribute is only used by `cir.func` operations. - - Values: - - `never`: Prevents the function from being inlined (__attribute__((noinline))) - - `always`: Forces the function to be inlined (__attribute__((always_inline))) - - `hint`: Suggests the function should be inlined (inline keyword) - - Example: - ``` - cir.func @noinline_func(%arg0: !s32i) -> !s32i inline(never) { - cir.return %arg0 : !s32i - } - cir.func @always_inline_func() -> !s32i inline(always) { - %0 = cir.const #cir.int<42> : !s32i - cir.return %0 : !s32i - } - ``` - }]; - - let cppClassName = "InlineAttr"; - - let extraClassDeclaration = [{ - bool isNoInline() const { return getValue() == InlineKind::NoInline; }; - bool isAlwaysInline() const { return getValue() == InlineKind::AlwaysInline; }; - bool isInlineHint() const { return getValue() == InlineKind::InlineHint; }; - }]; -} + I32EnumAttrCase<"NoInline", 1, "no_inline">, + I32EnumAttrCase<"AlwaysInline", 2, "always_inline">, + I32EnumAttrCase<"InlineHint", 3, "inline_hint"> +]>; //===----------------------------------------------------------------------===// // CatchAllAttr & UnwindAttr diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td index 5f5fab6f12300..47df0ef8d1861 100644 --- a/clang/include/clang/CIR/Dialect/IR/CIROps.td +++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td @@ -2564,9 +2564,9 @@ def CIR_FuncOp : CIR_Op<"func", [ Similarly, for global destructors both `global_dtor` and `global_dtor()` are available. - The `inline(never)` keyword marks a function that should not be inlined. - The `inline(always)` keyword marks a function that should always be inlined. - The `inline(hint)` keyword suggests that the function should be inlined. + The `no_inline` attribute marks a function that should not be inlined. + The `always_inline` attribute marks a function that should always be inlined. + The `inline_hint` attribute suggests that the function should be inlined. Example: @@ -2580,7 +2580,10 @@ def CIR_FuncOp : CIR_Op<"func", [ // Linkage information cir.func linkonce_odr @some_method(...) - ``` + + // Inline information + cir.func no_inline @some_method(...) + // Builtin function cir.func builtin @__builtin_coro_end(!cir.ptr, !cir.bool) -> !cir.bool // Coroutine @@ -2592,26 +2595,29 @@ def CIR_FuncOp : CIR_Op<"func", [ ``` }]; - let arguments = (ins SymbolNameAttr:$sym_name, - CIR_VisibilityAttr:$global_visibility, - TypeAttrOf:$function_type, - UnitAttr:$builtin, - UnitAttr:$coroutine, - UnitAttr:$lambda, - UnitAttr:$no_proto, - UnitAttr:$dso_local, - DefaultValuedAttr:$linkage, - OptionalAttr:$inline_kind, - OptionalAttr:$sym_visibility, - UnitAttr:$comdat, - OptionalAttr:$arg_attrs, - OptionalAttr:$res_attrs, - OptionalAttr:$aliasee, - CIR_OptionalPriorityAttr:$global_ctor_priority, - CIR_OptionalPriorityAttr:$global_dtor_priority, - OptionalAttr:$cxx_special_member - ); + let arguments = (ins + SymbolNameAttr:$sym_name, + CIR_VisibilityAttr:$global_visibility, + TypeAttrOf:$function_type, + UnitAttr:$builtin, + UnitAttr:$coroutine, + OptionalAttr:$inline_kind, + UnitAttr:$lambda, + UnitAttr:$no_proto, + UnitAttr:$dso_local, + DefaultValuedAttr< + CIR_GlobalLinkageKind, + "cir::GlobalLinkageKind::ExternalLinkage" + >:$linkage, + OptionalAttr:$sym_visibility, + UnitAttr:$comdat, + OptionalAttr:$arg_attrs, + OptionalAttr:$res_attrs, + OptionalAttr:$aliasee, + CIR_OptionalPriorityAttr:$global_ctor_priority, + CIR_OptionalPriorityAttr:$global_dtor_priority, + OptionalAttr:$cxx_special_member + ); let regions = (region AnyRegion:$body); diff --git a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp index 4065124f8f568..1c2b83e6094f3 100644 --- a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp @@ -1870,8 +1870,7 @@ CIRGenCallee CIRGenFunction::emitDirectCallee(const GlobalDecl &gd) { clone.setLinkageAttr(cir::GlobalLinkageKindAttr::get( &cgm.getMLIRContext(), cir::GlobalLinkageKind::InternalLinkage)); clone.setSymVisibility("private"); - clone.setInlineKindAttr(cir::InlineAttr::get( - &cgm.getMLIRContext(), cir::InlineKind::AlwaysInline)); + clone.setInlineKind(cir::InlineKind::AlwaysInline); } return CIRGenCallee::forDirect(clone, gd); } diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp index 809c24f8aa670..03bbfbffce717 100644 --- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp @@ -1975,7 +1975,6 @@ void CIRGenModule::setCIRFunctionAttributesForDefinition( existingInlineKind && *existingInlineKind == cir::InlineKind::NoInline; bool isAlwaysInline = existingInlineKind && *existingInlineKind == cir::InlineKind::AlwaysInline; - if (!decl) { assert(!cir::MissingFeatures::hlsl()); @@ -1984,8 +1983,7 @@ void CIRGenModule::setCIRFunctionAttributesForDefinition( // If inlining is disabled and we don't have a declaration to control // inlining, mark the function as 'noinline' unless it is explicitly // marked as 'alwaysinline'. - f.setInlineKindAttr( - cir::InlineAttr::get(&getMLIRContext(), cir::InlineKind::NoInline)); + f.setInlineKind(cir::InlineKind::NoInline); } return; @@ -2002,19 +2000,16 @@ void CIRGenModule::setCIRFunctionAttributesForDefinition( // Handle inline attributes if (decl->hasAttr() && !isAlwaysInline) { // Add noinline if the function isn't always_inline. - f.setInlineKindAttr( - cir::InlineAttr::get(&getMLIRContext(), cir::InlineKind::NoInline)); + f.setInlineKind(cir::InlineKind::NoInline); } else if (decl->hasAttr() && !isNoInline) { // Don't override AlwaysInline with NoInline, or vice versa, since we can't // specify both in IR. - f.setInlineKindAttr( - cir::InlineAttr::get(&getMLIRContext(), cir::InlineKind::AlwaysInline)); + f.setInlineKind(cir::InlineKind::AlwaysInline); } else if (codeGenOpts.getInlining() == CodeGenOptions::OnlyAlwaysInlining) { // If inlining is disabled, force everything that isn't always_inline // to carry an explicit noinline attribute. if (!isAlwaysInline) { - f.setInlineKindAttr( - cir::InlineAttr::get(&getMLIRContext(), cir::InlineKind::NoInline)); + f.setInlineKind(cir::InlineKind::NoInline); } } else { // Otherwise, propagate the inline hint attribute and potentially use its @@ -2036,13 +2031,11 @@ void CIRGenModule::setCIRFunctionAttributesForDefinition( return any_of(pattern->redecls(), checkRedeclForInline); }; if (checkForInline(fd)) { - f.setInlineKindAttr(cir::InlineAttr::get(&getMLIRContext(), - cir::InlineKind::InlineHint)); + f.setInlineKind(cir::InlineKind::InlineHint); } else if (codeGenOpts.getInlining() == CodeGenOptions::OnlyHintInlining && !fd->isInlined() && !isAlwaysInline) { - f.setInlineKindAttr( - cir::InlineAttr::get(&getMLIRContext(), cir::InlineKind::NoInline)); + f.setInlineKind(cir::InlineKind::NoInline); } } } diff --git a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp index 9fada0b2ed052..396d97ddd794e 100644 --- a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp +++ b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp @@ -220,6 +220,41 @@ void parseVisibilityAttr(OpAsmParser &parser, cir::VisibilityAttr &visibility) { visibility = cir::VisibilityAttr::get(parser.getContext(), visibilityKind); } +//===----------------------------------------------------------------------===// +// InlineKindAttr (FIXME: remove once FuncOp uses assembly format) +//===----------------------------------------------------------------------===// + +ParseResult parseInlineKindAttr(OpAsmParser &parser, + cir::InlineKindAttr &inlineKindAttr) { + // Static list of possible inline kind keywords + static constexpr llvm::StringRef keywords[] = {"no_inline", "always_inline", + "inline_hint"}; + + // Parse the inline kind keyword (optional) + llvm::StringRef keyword; + if (parser.parseOptionalKeyword(&keyword, keywords).failed()) { + // Not an inline kind keyword, leave inlineKindAttr empty + return success(); + } + + // Parse the enum value from the keyword + auto inlineKindResult = ::cir::symbolizeEnum<::cir::InlineKind>(keyword); + if (!inlineKindResult) { + return parser.emitError(parser.getCurrentLocation(), "expected one of [") + << llvm::join(llvm::ArrayRef(keywords), ", ") + << "] for inlineKind, got: " << keyword; + } + + inlineKindAttr = + ::cir::InlineKindAttr::get(parser.getContext(), *inlineKindResult); + return success(); +} + +void printInlineKindAttr(OpAsmPrinter &p, cir::InlineKindAttr inlineKindAttr) { + if (inlineKindAttr) { + p << " " << stringifyInlineKind(inlineKindAttr.getValue()); + } +} //===----------------------------------------------------------------------===// // CIR Custom Parsers/Printers //===----------------------------------------------------------------------===// @@ -1753,6 +1788,7 @@ ParseResult cir::FuncOp::parse(OpAsmParser &parser, OperationState &state) { mlir::StringAttr builtinNameAttr = getBuiltinAttrName(state.name); mlir::StringAttr coroutineNameAttr = getCoroutineAttrName(state.name); + mlir::StringAttr inlineKindNameAttr = getInlineKindAttrName(state.name); mlir::StringAttr lambdaNameAttr = getLambdaAttrName(state.name); mlir::StringAttr noProtoNameAttr = getNoProtoAttrName(state.name); mlir::StringAttr visNameAttr = getSymVisibilityAttrName(state.name); @@ -1765,6 +1801,14 @@ ParseResult cir::FuncOp::parse(OpAsmParser &parser, OperationState &state) { if (::mlir::succeeded( parser.parseOptionalKeyword(coroutineNameAttr.strref()))) state.addAttribute(coroutineNameAttr, parser.getBuilder().getUnitAttr()); + + // Parse optional inline kind attribute + cir::InlineKindAttr inlineKindAttr; + if (failed(parseInlineKindAttr(parser, inlineKindAttr))) + return failure(); + if (inlineKindAttr) + state.addAttribute(inlineKindNameAttr, inlineKindAttr); + if (::mlir::succeeded(parser.parseOptionalKeyword(lambdaNameAttr.strref()))) state.addAttribute(lambdaNameAttr, parser.getBuilder().getUnitAttr()); if (parser.parseOptionalKeyword(noProtoNameAttr).succeeded()) @@ -1890,36 +1934,6 @@ ParseResult cir::FuncOp::parse(OpAsmParser &parser, OperationState &state) { }).failed()) return failure(); - // Parse optional inline kind: inline(never|always|hint) - if (parser.parseOptionalKeyword("inline").succeeded()) { - if (parser.parseLParen().failed()) - return failure(); - - llvm::StringRef inlineKindStr; - const std::array - allowedInlineKindStrs{ - cir::stringifyInlineKind(cir::InlineKind::NoInline), - cir::stringifyInlineKind(cir::InlineKind::AlwaysInline), - cir::stringifyInlineKind(cir::InlineKind::InlineHint), - }; - if (parser.parseOptionalKeyword(&inlineKindStr, allowedInlineKindStrs) - .failed()) - return parser.emitError(parser.getCurrentLocation(), - "expected 'never', 'always', or 'hint'"); - - std::optional inlineKind = - cir::symbolizeInlineKind(inlineKindStr); - if (!inlineKind) - return parser.emitError(parser.getCurrentLocation(), - "invalid inline kind"); - - state.addAttribute(getInlineKindAttrName(state.name), - cir::InlineAttr::get(builder.getContext(), *inlineKind)); - - if (parser.parseRParen().failed()) - return failure(); - } - // Parse the rest of the attributes. NamedAttrList parsedAttrs; if (parser.parseOptionalAttrDictWithKeyword(parsedAttrs)) @@ -2028,6 +2042,8 @@ void cir::FuncOp::print(OpAsmPrinter &p) { if (getCoroutine()) p << " coroutine"; + printInlineKindAttr(p, getInlineKindAttr()); + if (getLambda()) p << " lambda"; @@ -2083,10 +2099,6 @@ void cir::FuncOp::print(OpAsmPrinter &p) { p << "(" << globalDtorPriority.value() << ")"; } - if (cir::InlineAttr inlineAttr = getInlineKindAttr()) { - p << " inline(" << cir::stringifyInlineKind(inlineAttr.getValue()) << ")"; - } - function_interface_impl::printFunctionAttributes( p, *this, cir::FuncOp::getAttributeNames()); diff --git a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp index 0c34d87734c3e..c572eb820b385 100644 --- a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp +++ b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp @@ -1978,10 +1978,10 @@ mlir::LogicalResult CIRToLLVMFuncOpLowering::matchAndRewrite( assert(!cir::MissingFeatures::opFuncMultipleReturnVals()); - if (auto inlineKind = op.getInlineKind()) { - fn.setNoInline(inlineKind == cir::InlineKind::NoInline); - fn.setInlineHint(inlineKind == cir::InlineKind::InlineHint); - fn.setAlwaysInline(inlineKind == cir::InlineKind::AlwaysInline); + if (std::optional inlineKind = op.getInlineKind()) { + fn.setNoInline(*inlineKind == cir::InlineKind::NoInline); + fn.setInlineHint(*inlineKind == cir::InlineKind::InlineHint); + fn.setAlwaysInline(*inlineKind == cir::InlineKind::AlwaysInline); } fn.setVisibility_Attr(mlir::LLVM::VisibilityAttr::get( diff --git a/clang/test/CIR/CodeGen/aapcs-volatile-bitfields.c b/clang/test/CIR/CodeGen/aapcs-volatile-bitfields.c index 19362cf79b107..66891f9e1ad78 100644 --- a/clang/test/CIR/CodeGen/aapcs-volatile-bitfields.c +++ b/clang/test/CIR/CodeGen/aapcs-volatile-bitfields.c @@ -82,7 +82,7 @@ int check_load(st1 *s1) { return s1->b; } -// CIR: cir.func dso_local @check_load +// CIR: cir.func {{.*}} @check_load // CIR: [[LOAD:%.*]] = cir.load align(8) {{.*}} : !cir.ptr>, !cir.ptr // CIR: [[MEMBER:%.*]] = cir.get_member [[LOAD]][0] {name = "b"} : !cir.ptr -> !cir.ptr // CIR: [[BITFI:%.*]] = cir.get_bitfield align(4) (#bfi_b, [[MEMBER]] {is_volatile} : !cir.ptr) -> !u32i @@ -114,7 +114,7 @@ int check_load_exception(st3 *s3) { return s3->b; } -// CIR: cir.func dso_local @check_load_exception +// CIR: cir.func {{.*}} @check_load_exception // CIR: [[LOAD:%.*]] = cir.load align(8) {{.*}} : !cir.ptr>, !cir.ptr // CIR: [[MEMBER:%.*]] = cir.get_member [[LOAD]][2] {name = "b"} : !cir.ptr -> !cir.ptr // CIR: [[BITFI:%.*]] = cir.get_bitfield align(4) (#bfi_b1, [[MEMBER]] {is_volatile} : !cir.ptr) -> !u32i @@ -151,7 +151,7 @@ int clip_load_exception2(clip *c) { return c->a; } -// CIR: cir.func dso_local @clip_load_exception2 +// CIR: cir.func {{.*}} @clip_load_exception2 // CIR: [[LOAD:%.*]] = cir.load align(8) {{.*}} : !cir.ptr>, !cir.ptr // CIR: [[MEMBER:%.*]] = cir.get_member [[LOAD]][0] {name = "a"} : !cir.ptr -> !cir.ptr> // CIR: [[BITFI:%.*]] = cir.get_bitfield align(4) (#bfi_a1, [[MEMBER]] {is_volatile} : !cir.ptr>) -> !s32i @@ -178,7 +178,7 @@ void check_store(st2 *s2) { s2->a = 1; } -// CIR: cir.func dso_local @check_store +// CIR: cir.func {{.*}} @check_store // CIR: [[CONST:%.*]] = cir.const #cir.int<1> : !s32i // CIR: [[CAST:%.*]] = cir.cast integral [[CONST]] : !s32i -> !s16i // CIR: [[LOAD:%.*]] = cir.load align(8) {{.*}} : !cir.ptr>, !cir.ptr @@ -209,7 +209,7 @@ void check_store_exception(st3 *s3) { s3->b = 2; } -// CIR: cir.func dso_local @check_store_exception +// CIR: cir.func {{.*}} @check_store_exception // CIR: [[CONST:%.*]] = cir.const #cir.int<2> : !s32i // CIR: [[CAST:%.*]] = cir.cast integral [[CONST]] : !s32i -> !u32i // CIR: [[LOAD:%.*]] = cir.load align(8) {{.*}} : !cir.ptr>, !cir.ptr @@ -239,7 +239,7 @@ void clip_store_exception2(clip *c) { c->a = 3; } -// CIR: cir.func dso_local @clip_store_exception2 +// CIR: cir.func {{.*}} @clip_store_exception2 // CIR: [[CONST:%.*]] = cir.const #cir.int<3> : !s32i // CIR: [[LOAD:%.*]] = cir.load align(8) {{.*}} : !cir.ptr>, !cir.ptr // CIR: [[MEMBER:%.*]] = cir.get_member [[LOAD]][0] {name = "a"} : !cir.ptr -> !cir.ptr> @@ -261,7 +261,7 @@ void check_store_second_member (st4 *s4) { s4->b = 1; } -// CIR: cir.func dso_local @check_store_second_member +// CIR: cir.func {{.*}} @check_store_second_member // CIR: [[ONE:%.*]] = cir.const #cir.int<1> : !s32i // CIR: [[CAST:%.*]] = cir.cast integral [[ONE]] : !s32i -> !u64i // CIR: [[LOAD:%.*]] = cir.load align(8) {{.*}} : !cir.ptr>, !cir.ptr diff --git a/clang/test/CIR/CodeGen/address-space-conversion.cpp b/clang/test/CIR/CodeGen/address-space-conversion.cpp index ca026be60ee71..9ce1f5e4b8e24 100644 --- a/clang/test/CIR/CodeGen/address-space-conversion.cpp +++ b/clang/test/CIR/CodeGen/address-space-conversion.cpp @@ -11,7 +11,7 @@ using pi2_t = int __attribute__((address_space(2))) *; using ri1_t = int __attribute__((address_space(1))) &; using ri2_t = int __attribute__((address_space(2))) &; -// CIR: cir.func dso_local @{{.*test_ptr.*}} +// CIR: cir.func {{.*}} @{{.*test_ptr.*}} // LLVM: define dso_local void @{{.*test_ptr.*}} // OGCG: define dso_local void @{{.*test_ptr.*}} void test_ptr() { @@ -30,7 +30,7 @@ void test_ptr() { // OGCG-NEXT: store ptr addrspace(2) %{{.*}}, ptr %{{.*}} } -// CIR: cir.func dso_local @{{.*test_ref.*}} +// CIR: cir.func {{.*}} @{{.*test_ref.*}} // LLVM: define dso_local void @{{.*test_ref.*}} // OGCG: define dso_local void @{{.*test_ref.*}} void test_ref() { @@ -56,7 +56,7 @@ void test_ref() { // OGCG-NEXT: store ptr addrspace(2) %{{.*}}, ptr %{{.*}} } -// CIR: cir.func dso_local @{{.*test_nullptr.*}} +// CIR: cir.func {{.*}} @{{.*test_nullptr.*}} // LLVM: define dso_local void @{{.*test_nullptr.*}} // OGCG: define dso_local void @{{.*test_nullptr.*}} void test_nullptr() { @@ -74,7 +74,7 @@ void test_nullptr() { // OGCG-NEXT: store ptr addrspace(2) null, ptr %{{.*}} } -// CIR: cir.func dso_local @{{.*test_side_effect.*}} +// CIR: cir.func {{.*}} @{{.*test_side_effect.*}} // LLVM: define dso_local void @{{.*test_side_effect.*}} // OGCG: define dso_local void @{{.*test_side_effect.*}} void test_side_effect(pi1_t b) { diff --git a/clang/test/CIR/CodeGen/address-space.c b/clang/test/CIR/CodeGen/address-space.c index a334b8a2907e4..2a5c0e15d5850 100644 --- a/clang/test/CIR/CodeGen/address-space.c +++ b/clang/test/CIR/CodeGen/address-space.c @@ -6,7 +6,7 @@ // RUN: FileCheck --input-file=%t.ll %s -check-prefix=OGCG // Test address space 1 -// CIR: cir.func dso_local @foo(%arg0: !cir.ptr +// CIR: cir.func {{.*}} @foo(%arg0: !cir.ptr // LLVM: define dso_local void @foo(ptr addrspace(1) %0) // OGCG: define dso_local void @foo(ptr addrspace(1) noundef %arg) void foo(int __attribute__((address_space(1))) *arg) { @@ -14,7 +14,7 @@ void foo(int __attribute__((address_space(1))) *arg) { } // Test explicit address space 0 (should be same as default) -// CIR: cir.func dso_local @bar(%arg0: !cir.ptr +// CIR: cir.func {{.*}} @bar(%arg0: !cir.ptr // LLVM: define dso_local void @bar(ptr %0) // OGCG: define dso_local void @bar(ptr noundef %arg) void bar(int __attribute__((address_space(0))) *arg) { @@ -22,7 +22,7 @@ void bar(int __attribute__((address_space(0))) *arg) { } // Test default address space (no attribute) -// CIR: cir.func dso_local @baz(%arg0: !cir.ptr +// CIR: cir.func {{.*}} @baz(%arg0: !cir.ptr // LLVM: define dso_local void @baz(ptr %0) // OGCG: define dso_local void @baz(ptr noundef %arg) void baz(int *arg) { diff --git a/clang/test/CIR/CodeGen/array-ctor.cpp b/clang/test/CIR/CodeGen/array-ctor.cpp index 1fb14ecf0663e..8643c8c644e11 100644 --- a/clang/test/CIR/CodeGen/array-ctor.cpp +++ b/clang/test/CIR/CodeGen/array-ctor.cpp @@ -14,7 +14,7 @@ void foo() { S s[42]; } -// CIR-BEFORE-LPP: cir.func dso_local @_Z3foov() +// CIR-BEFORE-LPP: cir.func {{.*}} @_Z3foov() // CIR-BEFORE-LPP: %[[ARRAY:.*]] = cir.alloca !cir.array, !cir.ptr>, ["s", init] // CIR-BEFORE-LPP: cir.array.ctor %[[ARRAY]] : !cir.ptr> { // CIR-BEFORE-LPP: ^bb0(%[[ARG:.*]]: !cir.ptr): @@ -24,7 +24,7 @@ void foo() { // CIR-BEFORE-LPP: cir.return // CIR-BEFORE-LPP: } -// CIR: cir.func dso_local @_Z3foov() +// CIR: cir.func {{.*}} @_Z3foov() // CIR: %[[ARRAY:.*]] = cir.alloca !cir.array, !cir.ptr>, ["s", init] // CIR: %[[CONST42:.*]] = cir.const #cir.int<42> : !u64i // CIR: %[[DECAY:.*]] = cir.cast array_to_ptrdecay %[[ARRAY]] : !cir.ptr> -> !cir.ptr @@ -84,12 +84,12 @@ void zero_sized() { S s[0]; } -// CIR-BEFORE-LPP: cir.func dso_local @_Z10zero_sizedv() +// CIR-BEFORE-LPP: cir.func {{.*}} @_Z10zero_sizedv() // CIR-BEFORE-LPP: cir.alloca !cir.array, !cir.ptr>, ["s"] // CIR-BEFORE-LPP-NOT: cir.array.ctor // CIR-BEFORE-LPP: cir.return -// CIR: cir.func dso_local @_Z10zero_sizedv() +// CIR: cir.func {{.*}} @_Z10zero_sizedv() // CIR: cir.alloca !cir.array, !cir.ptr>, ["s"] // CIR-NOT: cir.do // CIR-NOT: cir.call @_ZN1SC1Ev diff --git a/clang/test/CIR/CodeGen/asm-label-inline-builtins.c b/clang/test/CIR/CodeGen/asm-label-inline-builtins.c index 24c9a32e7c41d..bad521aed7821 100644 --- a/clang/test/CIR/CodeGen/asm-label-inline-builtins.c +++ b/clang/test/CIR/CodeGen/asm-label-inline-builtins.c @@ -31,7 +31,7 @@ void test(const char *fmt, __builtin_va_list ap) { vprintf(fmt, ap); } -// CIR: cir.func internal private @__vprintfieee128.inline({{.*}}) -> !s32i inline(always) +// CIR: cir.func always_inline internal private @__vprintfieee128.inline({{.*}}) -> !s32i // CIR: cir.call @__vfprintf_chkieee128(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) // // CIR: cir.func {{.*}} @test({{.*}}) diff --git a/clang/test/CIR/CodeGen/assign-operator.cpp b/clang/test/CIR/CodeGen/assign-operator.cpp index 66d4b4818c10e..ad3e5c00911c4 100644 --- a/clang/test/CIR/CodeGen/assign-operator.cpp +++ b/clang/test/CIR/CodeGen/assign-operator.cpp @@ -13,7 +13,7 @@ void a() { a = 1u; } -// CIR: cir.func private @_ZN1xaSEi(!cir.ptr, !s32i) +// CIR: cir.func {{.*}} @_ZN1xaSEi(!cir.ptr, !s32i) // CIR: cir.func{{.*}} @_Z1av() // CIR: %[[A_ADDR:.*]] = cir.alloca !rec_x, !cir.ptr, ["a"] // CIR: %[[ONE:.*]] = cir.const #cir.int<1> : !u32i @@ -63,7 +63,7 @@ void copy_c(C &c1, C &c2) { // Implicit assignment operator for C. -// CIR: cir.func comdat linkonce_odr @_ZN1CaSERKS_(%arg0: !cir.ptr {{.*}}, %arg1: !cir.ptr {{.*}}) -> !cir.ptr +// CIR: cir.func {{.*}} @_ZN1CaSERKS_(%arg0: !cir.ptr {{.*}}, %arg1: !cir.ptr {{.*}}) -> !cir.ptr // CIR: %[[THIS_ADDR:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] // CIR: %[[ARG1_ADDR:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["", init, const] // CIR: %[[RET_ADDR:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["__retval"] diff --git a/clang/test/CIR/CodeGen/bitfield-union.c b/clang/test/CIR/CodeGen/bitfield-union.c index 14a2aaf68d318..9c235c5dc6195 100644 --- a/clang/test/CIR/CodeGen/bitfield-union.c +++ b/clang/test/CIR/CodeGen/bitfield-union.c @@ -39,7 +39,7 @@ void f() { // CIR: #bfi_y = #cir.bitfield_info // CIR: #bfi_z = #cir.bitfield_info -// CIR: cir.func no_proto dso_local @f +// CIR: cir.func {{.*}} @f // CIR: [[ALLOC:%.*]] = cir.alloca !rec_demo, !cir.ptr, ["d"] {alignment = 4 : i64} // CIR: [[ONE:%.*]] = cir.const #cir.int<1> : !s32i // CIR: [[X:%.*]] = cir.get_member [[ALLOC]][0] {name = "x"} : !cir.ptr -> !cir.ptr diff --git a/clang/test/CIR/CodeGen/bitfields.c b/clang/test/CIR/CodeGen/bitfields.c index b2c7d1c0be926..d1160399fd919 100644 --- a/clang/test/CIR/CodeGen/bitfields.c +++ b/clang/test/CIR/CodeGen/bitfields.c @@ -122,7 +122,7 @@ unsigned int load_field_unsigned(A* s) { return s->more_bits; } -//CIR: cir.func dso_local @load_field_unsigned +//CIR: cir.func {{.*}} @load_field_unsigned //CIR: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] {alignment = 8 : i64} //CIR: [[TMP1:%.*]] = cir.load align(8) [[TMP0]] : !cir.ptr>, !cir.ptr //CIR: [[TMP2:%.*]] = cir.get_member [[TMP1]][3] {name = "more_bits"} : !cir.ptr -> !cir.ptr @@ -228,7 +228,7 @@ void get_volatile(V* v) { v->b = 3; } -// CIR: cir.func dso_local @get_volatile +// CIR: cir.func {{.*}} @get_volatile // CIR: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["v", init] {alignment = 8 : i64} // CIR: [[TMP1:%.*]] = cir.const #cir.int<3> : !s32i // CIR: [[TMP2:%.*]] = cir.load align(8) [[TMP0]] : !cir.ptr>, !cir.ptr @@ -255,7 +255,7 @@ void get_volatile(V* v) { void set_volatile(V* v) { v->b = 3; } -//CIR: cir.func dso_local @set_volatile +//CIR: cir.func {{.*}} @set_volatile //CIR: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["v", init] {alignment = 8 : i64} //CIR: [[TMP1:%.*]] = cir.const #cir.int<3> : !s32i //CIR: [[TMP2:%.*]] = cir.load align(8) [[TMP0]] : !cir.ptr>, !cir.ptr diff --git a/clang/test/CIR/CodeGen/bitfields.cpp b/clang/test/CIR/CodeGen/bitfields.cpp index 7650e0b83faf6..8eeb71c3edfea 100644 --- a/clang/test/CIR/CodeGen/bitfields.cpp +++ b/clang/test/CIR/CodeGen/bitfields.cpp @@ -35,7 +35,7 @@ void def() { int load_field(S* s) { return s->c; } -// CIR: cir.func dso_local @_Z10load_field +// CIR: cir.func {{.*}} @_Z10load_field // CIR: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] // CIR: [[TMP1:%.*]] = cir.load{{.*}} [[TMP0]] : !cir.ptr>, !cir.ptr // CIR: [[TMP2:%.*]] = cir.get_member [[TMP1]][0] {name = "c"} : !cir.ptr -> !cir.ptr @@ -63,7 +63,7 @@ void store_field() { S s; s.a = 3; } -// CIR: cir.func dso_local @_Z11store_field +// CIR: cir.func {{.*}} @_Z11store_field // CIR: [[TMP0:%.*]] = cir.alloca !rec_S, !cir.ptr // CIR: [[TMP1:%.*]] = cir.const #cir.int<3> : !s32i // CIR: [[TMP2:%.*]] = cir.get_member [[TMP0]][0] {name = "a"} : !cir.ptr -> !cir.ptr @@ -88,7 +88,7 @@ void store_bitfield_to_bitfield(S* s) { s->a = s->b = 3; } -// CIR: cir.func dso_local @_Z26store_bitfield_to_bitfieldP1S +// CIR: cir.func {{.*}} @_Z26store_bitfield_to_bitfieldP1S // CIR: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] {alignment = 8 : i64} // CIR: [[TMP1:%.*]] = cir.const #cir.int<3> : !s32i // CIR: [[TMP2:%.*]] = cir.load align(8) [[TMP0]] : !cir.ptr>, !cir.ptr diff --git a/clang/test/CIR/CodeGen/bitfields_be.c b/clang/test/CIR/CodeGen/bitfields_be.c index 3e1f05401728a..f4f3476d2ef23 100644 --- a/clang/test/CIR/CodeGen/bitfields_be.c +++ b/clang/test/CIR/CodeGen/bitfields_be.c @@ -21,7 +21,7 @@ int init(S* s) { return s->c; } -//CIR: cir.func dso_local @init +//CIR: cir.func {{.*}} @init //CIR: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] {alignment = 8 : i64} //CIR: [[TMP1:%.*]] = cir.load align(8) [[TMP0]] : !cir.ptr>, !cir.ptr //CIR: [[TMP2:%.*]] = cir.get_member [[TMP1]][0] {name = "c"} : !cir.ptr -> !cir.ptr @@ -51,7 +51,7 @@ void load(S* s) { } // field 'a' -// CIR: cir.func dso_local @load +// CIR: cir.func {{.*}} @load // CIR: %[[PTR0:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] {alignment = 8 : i64} loc(#loc35) // CIR: %[[CONST1:.*]] = cir.const #cir.int<4> : !s32i // CIR: %[[MIN1:.*]] = cir.unary(minus, %[[CONST1]]) nsw : !s32i, !s32i diff --git a/clang/test/CIR/CodeGen/constant-inits.cpp b/clang/test/CIR/CodeGen/constant-inits.cpp index ef9802de405c1..ff0c0da26b559 100644 --- a/clang/test/CIR/CodeGen/constant-inits.cpp +++ b/clang/test/CIR/CodeGen/constant-inits.cpp @@ -159,7 +159,7 @@ void function() { // CIR-DAG-SAME: #cir.int<125> : !u8i // CIR-DAG-SAME: }> : !rec_mixed_partial_bitfields -// CIR-LABEL: cir.func dso_local @_Z8functionv() +// CIR-LABEL: cir.func {{.*}} @_Z8functionv() // CIR: cir.return diff --git a/clang/test/CIR/CodeGen/copy-constructor.cpp b/clang/test/CIR/CodeGen/copy-constructor.cpp index be05bd582d6f0..97c514ac67e03 100644 --- a/clang/test/CIR/CodeGen/copy-constructor.cpp +++ b/clang/test/CIR/CodeGen/copy-constructor.cpp @@ -12,7 +12,7 @@ struct HasScalarArrayMember { HasScalarArrayMember::HasScalarArrayMember(const HasScalarArrayMember &) = default; -// CIR-LABEL: cir.func dso_local @_ZN20HasScalarArrayMemberC2ERKS_( +// CIR-LABEL: cir.func {{.*}} @_ZN20HasScalarArrayMemberC2ERKS_( // CIR-NEXT: %[[THIS:.*]] = cir.alloca !cir.ptr // CIR-NEXT: %[[OTHER:.*]] = cir.alloca !cir.ptr // CIR-NEXT: cir.store %arg0, %[[THIS]] diff --git a/clang/test/CIR/CodeGen/coro-task.cpp b/clang/test/CIR/CodeGen/coro-task.cpp index 4843f2433fa64..cb665ecd6a202 100644 --- a/clang/test/CIR/CodeGen/coro-task.cpp +++ b/clang/test/CIR/CodeGen/coro-task.cpp @@ -130,7 +130,7 @@ VoidTask silly_task() { co_await std::suspend_always(); } -// CIR: cir.func coroutine dso_local @_Z10silly_taskv() -> ![[VoidTask]] +// CIR: cir.func coroutine {{.*}} @_Z10silly_taskv() -> ![[VoidTask]] // CIR: %[[VoidTaskAddr:.*]] = cir.alloca ![[VoidTask]], {{.*}}, ["__retval"] // CIR: %[[SavedFrameAddr:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["__coro_frame_addr"] // CIR: %[[VoidPromisseAddr:.*]] = cir.alloca ![[VoidPromisse]], {{.*}}, ["__promise"] @@ -212,7 +212,7 @@ folly::coro::Task byRef(const std::string& s) { co_return s.size(); } -// CIR: cir.func coroutine dso_local @_Z5byRefRKSt6string(%[[ARG:.*]]: !cir.ptr {{.*}}) -> ![[IntTask]] +// CIR: cir.func coroutine {{.*}} @_Z5byRefRKSt6string(%[[ARG:.*]]: !cir.ptr {{.*}}) -> ![[IntTask]] // CIR: %[[AllocaParam:.*]] = cir.alloca !cir.ptr, {{.*}}, ["s", init, const] // CIR: %[[IntTaskAddr:.*]] = cir.alloca ![[IntTask]], {{.*}}, ["__retval"] // CIR: %[[SavedFrameAddr:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["__coro_frame_addr"] diff --git a/clang/test/CIR/CodeGen/cxx-conversion-operators.cpp b/clang/test/CIR/CodeGen/cxx-conversion-operators.cpp index a386a4161f82d..30e6298d65fa5 100644 --- a/clang/test/CIR/CodeGen/cxx-conversion-operators.cpp +++ b/clang/test/CIR/CodeGen/cxx-conversion-operators.cpp @@ -27,7 +27,7 @@ void test() { x = o; } -// CIR: cir.func dso_local @_ZN20out_of_line_operatorcviEv(%[[THIS_ARG:.+]]: !cir.ptr{{.*}}) -> !s32i +// CIR: cir.func {{.*}} @_ZN20out_of_line_operatorcviEv(%[[THIS_ARG:.+]]: !cir.ptr{{.*}}) -> !s32i // CIR: %[[THIS_ALLOCA:.+]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] // CIR: %[[RETVAL:.+]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: cir.store %[[THIS_ARG]], %[[THIS_ALLOCA]] : !cir.ptr, !cir.ptr> @@ -38,7 +38,7 @@ void test() { // CIR: cir.return %[[RET_LOAD]] : !s32i // CIR: } -// CIR: cir.func comdat linkonce_odr @_ZNK15inline_operatorcviEv(%[[INLINE_THIS_ARG:.+]]: !cir.ptr{{.*}}) -> !s32i +// CIR: cir.func no_inline comdat linkonce_odr @_ZNK15inline_operatorcviEv(%[[INLINE_THIS_ARG:.+]]: !cir.ptr{{.*}}) -> !s32i // CIR: %[[INLINE_THIS_ALLOCA:.+]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] // CIR: %[[INLINE_RETVAL:.+]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: cir.store %[[INLINE_THIS_ARG]], %[[INLINE_THIS_ALLOCA]] : !cir.ptr, !cir.ptr> @@ -49,7 +49,7 @@ void test() { // CIR: cir.return %[[INLINE_RET_LOAD]] : !s32i // CIR: } -// CIR: cir.func dso_local @_Z4testv() +// CIR: cir.func {{.*}} @_Z4testv() // CIR: %[[X_ALLOCA:.+]] = cir.alloca !s32i, !cir.ptr, ["x", init] // CIR: %[[I_ALLOCA:.+]] = cir.alloca {{.*}}, {{.*}}, ["i"] // CIR: %[[O_ALLOCA:.+]] = cir.alloca {{.*}}, {{.*}}, ["o"] @@ -82,7 +82,7 @@ void test() { // LLVM: ret i32 %[[INLINE_RET_LOAD]] // LLVM: } -// LLVM: define dso_local void @_Z4testv() +// LLVM: define {{.*}} void @_Z4testv() // LLVM: %[[X_ALLOCA:.+]] = alloca i32, i64 1 // LLVM: %[[I_ALLOCA:.+]] = alloca {{.*}}, i64 1 // LLVM: %[[O_ALLOCA:.+]] = alloca {{.*}}, i64 1 @@ -102,7 +102,7 @@ void test() { // OGCG: ret i32 123 // OGCG: } -// OGCG: define dso_local void @_Z4testv() +// OGCG: define {{.*}} void @_Z4testv() // OGCG: entry: // OGCG: %[[X_VAR:.+]] = alloca i32 // OGCG: %[[I_VAR:.+]] = alloca {{.*}} diff --git a/clang/test/CIR/CodeGen/delete.cpp b/clang/test/CIR/CodeGen/delete.cpp index d8ac4361bb538..c8d6f050179fd 100644 --- a/clang/test/CIR/CodeGen/delete.cpp +++ b/clang/test/CIR/CodeGen/delete.cpp @@ -19,7 +19,7 @@ void test_sized_delete(SizedDelete *x) { // CIR: cir.func private @_ZN11SizedDeletedlEPvm(!cir.ptr, !u64i) // LLVM: declare void @_ZN11SizedDeletedlEPvm(ptr, i64) -// CIR: cir.func dso_local @_Z17test_sized_deleteP11SizedDelete +// CIR: cir.func {{.*}} @_Z17test_sized_deleteP11SizedDelete // CIR: %[[X:.*]] = cir.load{{.*}} %{{.*}} // CIR: %[[X_CAST:.*]] = cir.cast bitcast %[[X]] : !cir.ptr -> !cir.ptr // CIR: %[[OBJ_SIZE:.*]] = cir.const #cir.int<4> : !u64i @@ -49,15 +49,15 @@ struct Container { Container::~Container() { delete contents; } // Contents::~Contents() -// CIR: cir.func comdat linkonce_odr @_ZN8ContentsD2Ev +// CIR: cir.func {{.*}} @_ZN8ContentsD2Ev // LLVM: define linkonce_odr void @_ZN8ContentsD2Ev // operator delete(void*, unsigned long) -// CIR: cir.func private @_ZdlPvm(!cir.ptr, !u64i) +// CIR: cir.func {{.*}} @_ZdlPvm(!cir.ptr, !u64i) // LLVM: declare void @_ZdlPvm(ptr, i64) // Container::~Container() -// CIR: cir.func dso_local @_ZN9ContainerD2Ev +// CIR: cir.func {{.*}} @_ZN9ContainerD2Ev // CIR: %[[THIS:.*]] = cir.load %{{.*}} // CIR: %[[CONTENTS_PTR_ADDR:.*]] = cir.get_member %[[THIS]][0] {name = "contents"} : !cir.ptr -> !cir.ptr> // CIR: %[[CONTENTS_PTR:.*]] = cir.load{{.*}} %[[CONTENTS_PTR_ADDR]] diff --git a/clang/test/CIR/CodeGen/destructors.cpp b/clang/test/CIR/CodeGen/destructors.cpp index 4363db5ad34dc..ec190f59b2f1d 100644 --- a/clang/test/CIR/CodeGen/destructors.cpp +++ b/clang/test/CIR/CodeGen/destructors.cpp @@ -18,7 +18,7 @@ out_of_line_destructor::~out_of_line_destructor() { // CIR: !rec_out_of_line_destructor = !cir.record -// CIR: cir.func dso_local @_ZN22out_of_line_destructorD2Ev(%{{.+}}: !cir.ptr +// CIR: cir.func {{.*}} @_ZN22out_of_line_destructorD2Ev(%{{.+}}: !cir.ptr // CIR: cir.call @_Z13some_functionv() nothrow : () -> () // CIR: cir.return @@ -30,7 +30,7 @@ out_of_line_destructor::~out_of_line_destructor() { // OGCG: call void @_Z13some_functionv() // OGCG: ret void -// CIR: cir.func dso_local @_ZN22out_of_line_destructorD1Ev(%{{.+}}: !cir.ptr +// CIR: cir.func {{.*}} @_ZN22out_of_line_destructorD1Ev(%{{.+}}: !cir.ptr // CIR: cir.call @_ZN22out_of_line_destructorD2Ev(%{{.*}}) nothrow : (!cir.ptr) // CIR: cir.return @@ -61,7 +61,7 @@ void test_array_destructor() { array_element arr[5]{}; } -// CIR: cir.func dso_local @_Z21test_array_destructorv() +// CIR: cir.func {{.*}} @_Z21test_array_destructorv() // CIR: %[[ARR:.*]] = cir.alloca !cir.array, !cir.ptr>, ["arr", init] // CIR: %[[ARR_PTR:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["arrayinit.temp", init] // CIR: %[[BEGIN:.*]] = cir.cast array_to_ptrdecay %[[ARR]] : !cir.ptr> diff --git a/clang/test/CIR/CodeGen/dtors.cpp b/clang/test/CIR/CodeGen/dtors.cpp index 1fe048b7d5327..aeee0854dacf0 100644 --- a/clang/test/CIR/CodeGen/dtors.cpp +++ b/clang/test/CIR/CodeGen/dtors.cpp @@ -13,7 +13,7 @@ void test_temporary_dtor() { A(); } -// CIR: cir.func dso_local @_Z19test_temporary_dtorv() +// CIR: cir.func {{.*}} @_Z19test_temporary_dtorv() // CIR: %[[ALLOCA:.*]] = cir.alloca !rec_A, !cir.ptr, ["agg.tmp.ensured"] // CIR: cir.call @_ZN1AD1Ev(%[[ALLOCA]]) nothrow : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/dynamic-cast.cpp b/clang/test/CIR/CodeGen/dynamic-cast.cpp index 5d010d20bb9f1..e963be01950c4 100644 --- a/clang/test/CIR/CodeGen/dynamic-cast.cpp +++ b/clang/test/CIR/CodeGen/dynamic-cast.cpp @@ -21,11 +21,11 @@ Derived *ptr_cast(Base *b) { return dynamic_cast(b); } -// CIR-BEFORE: cir.func dso_local @_Z8ptr_castP4Base +// CIR-BEFORE: cir.func {{.*}} @_Z8ptr_castP4Base // CIR-BEFORE: %{{.+}} = cir.dyn_cast ptr %{{.+}} : !cir.ptr -> !cir.ptr #dyn_cast_info__ZTI4Base__ZTI7Derived // CIR-BEFORE: } -// CIR-AFTER: cir.func dso_local @_Z8ptr_castP4Base +// CIR-AFTER: cir.func {{.*}} @_Z8ptr_castP4Base // CIR-AFTER: %[[SRC:.*]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr // CIR-AFTER-NEXT: %[[SRC_IS_NOT_NULL:.*]] = cir.cast ptr_to_bool %[[SRC]] : !cir.ptr -> !cir.bool // CIR-AFTER-NEXT: %{{.+}} = cir.ternary(%[[SRC_IS_NOT_NULL]], true { @@ -69,11 +69,11 @@ Derived &ref_cast(Base &b) { return dynamic_cast(b); } -// CIR-BEFORE: cir.func dso_local @_Z8ref_castR4Base +// CIR-BEFORE: cir.func {{.*}} @_Z8ref_castR4Base // CIR-BEFORE: %{{.+}} = cir.dyn_cast ref %{{.+}} : !cir.ptr -> !cir.ptr #dyn_cast_info__ZTI4Base__ZTI7Derived // CIR-BEFORE: } -// CIR-AFTER: cir.func dso_local @_Z8ref_castR4Base +// CIR-AFTER: cir.func {{.*}} @_Z8ref_castR4Base // CIR-AFTER: %[[SRC_VOID_PTR:.*]] = cir.cast bitcast %{{.+}} : !cir.ptr -> !cir.ptr // CIR-AFTER-NEXT: %[[SRC_RTTI:.*]] = cir.const #cir.global_view<@_ZTI4Base> : !cir.ptr // CIR-AFTER-NEXT: %[[DEST_RTTI:.*]] = cir.const #cir.global_view<@_ZTI7Derived> : !cir.ptr @@ -106,11 +106,11 @@ void *ptr_cast_to_complete(Base *ptr) { return dynamic_cast(ptr); } -// CIR-BEFORE: cir.func dso_local @_Z20ptr_cast_to_completeP4Base +// CIR-BEFORE: cir.func {{.*}} @_Z20ptr_cast_to_completeP4Base // CIR-BEFORE: %{{.+}} = cir.dyn_cast ptr %{{.+}} : !cir.ptr -> !cir.ptr // CIR-BEFORE: } -// CIR-AFTER: cir.func dso_local @_Z20ptr_cast_to_completeP4Base +// CIR-AFTER: cir.func {{.*}} @_Z20ptr_cast_to_completeP4Base // CIR-AFTER: %[[SRC:.*]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr // CIR-AFTER-NEXT: %[[SRC_IS_NOT_NULL:.*]] = cir.cast ptr_to_bool %[[SRC]] : !cir.ptr -> !cir.bool // CIR-AFTER-NEXT: %{{.+}} = cir.ternary(%[[SRC_IS_NOT_NULL]], true { diff --git a/clang/test/CIR/CodeGen/global-ctor-dtor.cpp b/clang/test/CIR/CodeGen/global-ctor-dtor.cpp index 2e03ff3e88c7d..63f175281a02e 100644 --- a/clang/test/CIR/CodeGen/global-ctor-dtor.cpp +++ b/clang/test/CIR/CodeGen/global-ctor-dtor.cpp @@ -13,28 +13,28 @@ void foo(void) { bar(); } -// CIR-BEFORE-LPP: cir.func dso_local @_Z3foov() global_ctor +// CIR-BEFORE-LPP: cir.func {{.*}} @_Z3foov() global_ctor void foo2(void) __attribute__((constructor(777))); void foo2(void) { bar(); } -// CIR-BEFORE-LPP: cir.func dso_local @_Z4foo2v() global_ctor(777) +// CIR-BEFORE-LPP: cir.func {{.*}} @_Z4foo2v() global_ctor(777) void foo3(void) __attribute__((destructor)); void foo3(void) { bar(); } -// CIR-BEFORE-LPP: cir.func dso_local @_Z4foo3v() global_dtor +// CIR-BEFORE-LPP: cir.func {{.*}} @_Z4foo3v() global_dtor void foo4(void) __attribute__((destructor(789))); void foo4(void) { bar(); } -// CIR-BEFORE-LPP: cir.func dso_local @_Z4foo4v() global_dtor(789) +// CIR-BEFORE-LPP: cir.func {{.*}} @_Z4foo4v() global_dtor(789) // CIR-AFTER: module @{{.*}} attributes {cir.global_ctors = [#cir.global_ctor<"_Z3foov", 65535>, #cir.global_ctor<"_Z4foo2v", 777>], cir.global_dtors = [#cir.global_dtor<"_Z4foo3v", 65535>, #cir.global_dtor<"_Z4foo4v", 789>] diff --git a/clang/test/CIR/CodeGen/goto.cpp b/clang/test/CIR/CodeGen/goto.cpp index 257c2550c2399..4b825d619c221 100644 --- a/clang/test/CIR/CodeGen/goto.cpp +++ b/clang/test/CIR/CodeGen/goto.cpp @@ -12,7 +12,7 @@ int shouldNotGenBranchRet(int x) { err: return -1; } -// CIR: cir.func dso_local @_Z21shouldNotGenBranchReti +// CIR: cir.func {{.*}} @_Z21shouldNotGenBranchReti // CIR: cir.if {{.*}} { // CIR: cir.goto "err" // CIR: } @@ -63,7 +63,7 @@ int shouldGenBranch(int x) { err: return -1; } -// CIR: cir.func dso_local @_Z15shouldGenBranchi +// CIR: cir.func {{.*}} @_Z15shouldGenBranchi // CIR: cir.if {{.*}} { // CIR: cir.goto "err" // CIR: } @@ -99,7 +99,7 @@ void severalLabelsInARow(int a) { end2: b = b + 2; } -// CIR: cir.func dso_local @_Z19severalLabelsInARowi +// CIR: cir.func {{.*}} @_Z19severalLabelsInARowi // CIR: cir.goto "end1" // CIR: ^bb[[#BLK1:]] // CIR: cir.goto "end2" @@ -132,7 +132,7 @@ void severalGotosInARow(int a) { end: b = b + 2; } -// CIR: cir.func dso_local @_Z18severalGotosInARowi +// CIR: cir.func {{.*}} @_Z18severalGotosInARowi // CIR: cir.goto "end" // CIR: ^bb[[#BLK1:]]: // CIR: cir.goto "end" @@ -163,7 +163,7 @@ extern "C" void multiple_non_case(int v) { } } -// CIR: cir.func dso_local @multiple_non_case +// CIR: cir.func {{.*}} @multiple_non_case // CIR: cir.switch // CIR: cir.case(default, []) { // CIR: cir.call @action1() @@ -202,7 +202,7 @@ extern "C" void case_follow_label(int v) { } } -// CIR: cir.func dso_local @case_follow_label +// CIR: cir.func {{.*}} @case_follow_label // CIR: cir.switch // CIR: cir.case(equal, [#cir.int<1> : !s32i]) { // CIR: cir.br ^bb1 @@ -264,7 +264,7 @@ extern "C" void default_follow_label(int v) { } } -// CIR: cir.func dso_local @default_follow_label +// CIR: cir.func {{.*}} @default_follow_label // CIR: cir.switch // CIR: cir.case(equal, [#cir.int<1> : !s32i]) { // CIR: cir.yield @@ -313,7 +313,7 @@ void g3() { goto label; } -// CIR: cir.func dso_local @_Z2g3v +// CIR: cir.func {{.*}} @_Z2g3v // CIR: cir.br ^bb1 // CIR: ^bb1: // CIR: cir.label "label" diff --git a/clang/test/CIR/CodeGen/inline-attributes.cpp b/clang/test/CIR/CodeGen/inline-attributes.cpp index fab4010354daf..54777975e32ab 100644 --- a/clang/test/CIR/CodeGen/inline-attributes.cpp +++ b/clang/test/CIR/CodeGen/inline-attributes.cpp @@ -29,17 +29,17 @@ int (*inline_hint_ptr)(int) = &inline_hint_function; int (*noinline_ptr)(int) = &noinline_function; int (*regular_ptr)(int) = ®ular_function; -// CIR-LABEL: cir.func dso_local @_Z17noinline_functioni(%arg0: !s32i {{.*}}) -> !s32i inline(never) +// CIR-LABEL: cir.func no_inline dso_local @_Z17noinline_functioni(%arg0: !s32i {{.*}}) -> !s32i // CIR-LABEL: cir.func dso_local @_Z16regular_functioni(%arg0: !s32i {{.*}}) -> !s32i -// CIR-NOT: inline(never) -// CIR-NOT: inline(always) -// CIR-NOT: inline(hint) +// CIR-NOT: no_inline +// CIR-NOT: always_inline +// CIR-NOT: inline_hint // CIR-SAME: { -// CIR-LABEL: cir.func {{.*}}@_Z22always_inline_functioni(%arg0: !s32i {{.*}}) -> !s32i inline(always) +// CIR-LABEL: cir.func{{.*}} always_inline {{.*}}@_Z22always_inline_functioni(%arg0: !s32i {{.*}}) -> !s32i -// CIR-LABEL: cir.func {{.*}}@_Z20inline_hint_functioni(%arg0: !s32i {{.*}}) -> !s32i inline(hint) +// CIR-LABEL: cir.func{{.*}} inline_hint {{.*}}@_Z20inline_hint_functioni(%arg0: !s32i {{.*}}) -> !s32i // LLVM: ; Function Attrs:{{.*}} noinline // LLVM: define{{.*}} i32 @_Z17noinline_functioni diff --git a/clang/test/CIR/CodeGen/label-values.c b/clang/test/CIR/CodeGen/label-values.c index 41178e3f62f20..0305442a38471 100644 --- a/clang/test/CIR/CodeGen/label-values.c +++ b/clang/test/CIR/CodeGen/label-values.c @@ -6,7 +6,7 @@ void A(void) { LABEL_A: return; } -// CIR: cir.func dso_local @A +// CIR: cir.func {{.*}} @A // CIR: [[PTR:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["ptr", init] {alignment = 8 : i64} // CIR: [[BLOCK:%.*]] = cir.block_address <@A, "LABEL_A"> : !cir.ptr // CIR: cir.store align(8) [[BLOCK]], [[PTR]] : !cir.ptr, !cir.ptr> @@ -20,7 +20,7 @@ void B(void) { void *ptr = &&LABEL_B; } -// CIR: cir.func dso_local @B() +// CIR: cir.func {{.*}} @B() // CIR: [[PTR:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["ptr", init] {alignment = 8 : i64} // CIR: cir.br ^bb1 // CIR: ^bb1: @@ -37,7 +37,7 @@ void C(int x) { return; } -// CIR: cir.func dso_local @C +// CIR: cir.func {{.*}} @C // CIR: [[BLOCK1:%.*]] = cir.block_address <@C, "LABEL_A"> : !cir.ptr // CIR: [[BLOCK2:%.*]] = cir.block_address <@C, "LABEL_B"> : !cir.ptr // CIR: [[COND:%.*]] = cir.select if [[CMP:%.*]] then [[BLOCK1]] else [[BLOCK2]] : (!cir.bool, !cir.ptr, !cir.ptr) -> !cir.ptr @@ -60,7 +60,7 @@ void D(void) { return; } -// CIR: cir.func dso_local @D +// CIR: cir.func {{.*}} @D // CIR: %[[PTR:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["ptr", init] // CIR: %[[PTR2:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["ptr2", init] // CIR: %[[PTR3:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["ptr3", init] diff --git a/clang/test/CIR/CodeGen/label.c b/clang/test/CIR/CodeGen/label.c index fd3c7f233fc8b..d3fdf5f5abb77 100644 --- a/clang/test/CIR/CodeGen/label.c +++ b/clang/test/CIR/CodeGen/label.c @@ -10,7 +10,7 @@ void label() { return; } -// CIR: cir.func no_proto dso_local @label +// CIR: cir.func {{.*}} @label // CIR: cir.br ^bb1 // CIR: ^bb1: // CIR: cir.label "labelA" @@ -32,7 +32,7 @@ void multiple_labels() { return; } -// CIR: cir.func no_proto dso_local @multiple_labels +// CIR: cir.func {{.*}} @multiple_labels // CIR: cir.br ^bb1 // CIR: ^bb1: // CIR: cir.label "labelB" @@ -62,7 +62,7 @@ void label_in_if(int cond) { } } -// CIR: cir.func dso_local @label_in_if +// CIR: cir.func {{.*}} @label_in_if // CIR: cir.if {{.*}} { // CIR: cir.br ^bb1 // CIR: ^bb1: @@ -107,7 +107,7 @@ void after_return() { label: } -// CIR: cir.func no_proto dso_local @after_return +// CIR: cir.func {{.*}} @after_return // CIR: cir.br ^bb1 // CIR: ^bb1: // 2 preds: ^bb0, ^bb2 // CIR: cir.return @@ -133,7 +133,7 @@ void after_unreachable() { label: } -// CIR: cir.func no_proto dso_local @after_unreachable +// CIR: cir.func {{.*}} @after_unreachable // CIR: cir.unreachable // CIR: ^bb1: // CIR: cir.label "label" @@ -153,7 +153,7 @@ void labelWithoutMatch() { end: return; } -// CIR: cir.func no_proto dso_local @labelWithoutMatch +// CIR: cir.func {{.*}} @labelWithoutMatch // CIR: cir.br ^bb1 // CIR: ^bb1: // CIR: cir.label "end" @@ -181,7 +181,7 @@ void foo() { } } -// CIR: cir.func no_proto dso_local @foo +// CIR: cir.func {{.*}} @foo // CIR: cir.scope { // CIR: %0 = cir.alloca !rec_S, !cir.ptr, ["agg.tmp0"] // CIR: cir.br ^bb1 diff --git a/clang/test/CIR/CodeGen/lambda-static-invoker.cpp b/clang/test/CIR/CodeGen/lambda-static-invoker.cpp index e7d199b976865..fc68447f7c445 100644 --- a/clang/test/CIR/CodeGen/lambda-static-invoker.cpp +++ b/clang/test/CIR/CodeGen/lambda-static-invoker.cpp @@ -37,7 +37,7 @@ int g3() { // OGCG: ret ptr @"_ZZ2g3vEN3$_08__invokeERKi" // lambda operator() -// CIR: cir.func lambda internal private dso_local @_ZZ2g3vENK3$_0clERKi(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}, %[[REF_I_ARG:.*]]: !cir.ptr {{.*}}) +// CIR: cir.func no_inline lambda internal private dso_local @_ZZ2g3vENK3$_0clERKi(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}, %[[REF_I_ARG:.*]]: !cir.ptr {{.*}}) // CIR: %[[THIS_ALLOCA:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] // CIR: %[[REF_I_ALLOCA:.*]] = cir.alloca {{.*}} ["i", init, const] // CIR: %[[RETVAL:.*]] = cir.alloca {{.*}} ["__retval"] @@ -66,7 +66,7 @@ int g3() { // In OGCG, the _ZZ2g3vENK3$_0clERKi function is emitted after _ZZ2g3vEN3$_08__invokeERKi, see below. // lambda invoker -// CIR: cir.func internal private dso_local @_ZZ2g3vEN3$_08__invokeERKi(%[[REF_I_ARG:.*]]: !cir.ptr {{.*}}) -> !s32i{{.*}} { +// CIR: cir.func no_inline internal private dso_local @_ZZ2g3vEN3$_08__invokeERKi(%[[REF_I_ARG:.*]]: !cir.ptr {{.*}}) -> !s32i{{.*}} { // CIR: %[[REF_I_ALLOCA:.*]] = cir.alloca {{.*}} ["i", init, const] // CIR: %[[RETVAL:.*]] = cir.alloca {{.*}} ["__retval"] // CIR: %[[LAM_ALLOCA:.*]] = cir.alloca ![[REC_LAM_G3]], !cir.ptr, ["unused.capture"] @@ -91,7 +91,7 @@ int g3() { // In OGCG, the _ZZ2g3vEN3$_08__invokeERKi function is emitted after _ZN1A3barEv, see below. // lambda operator int (*)(int const&)() -// CIR: cir.func internal private dso_local @_ZZ2g3vENK3$_0cvPFiRKiEEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) -> !cir.ptr) -> !s32i>>{{.*}} { +// CIR: cir.func no_inline internal private dso_local @_ZZ2g3vENK3$_0cvPFiRKiEEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) -> !cir.ptr) -> !s32i>>{{.*}} { // CIR: %[[THIS_ALLOCA:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] // CIR: %[[RETVAL:.*]] = cir.alloca !cir.ptr) -> !s32i>>, !cir.ptr) -> !s32i>>>, ["__retval"] // CIR: cir.store %[[THIS_ARG]], %[[THIS_ALLOCA]] diff --git a/clang/test/CIR/CodeGen/lambda.cpp b/clang/test/CIR/CodeGen/lambda.cpp index 1d06496a85530..10cab66f1d306 100644 --- a/clang/test/CIR/CodeGen/lambda.cpp +++ b/clang/test/CIR/CodeGen/lambda.cpp @@ -14,7 +14,7 @@ void use_global_lambda() { } // CIR: cir.global "private" internal dso_local @global_lambda = #cir.undef : ![[REC_LAM_GLOBAL_LAMBDA:.*]] {alignment = 1 : i64} -// CIR: cir.func lambda internal private dso_local @_ZNK3$_0clEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) +// CIR: cir.func {{.*}} lambda internal private dso_local @_ZNK3$_0clEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) // CIR: %[[THIS:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] // CIR: cir.store %[[THIS_ARG]], %[[THIS]] // CIR: cir.load %[[THIS]] @@ -46,13 +46,13 @@ void fn() { a(); } -// CIR: cir.func lambda internal private dso_local @_ZZ2fnvENK3$_0clEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) {{.*}} { +// CIR: cir.func {{.*}} lambda internal private dso_local @_ZZ2fnvENK3$_0clEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) // CIR: %[[THIS:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] // CIR: cir.store %[[THIS_ARG]], %[[THIS]] // CIR: cir.load %[[THIS]] // CIR: cir.return -// CIR: cir.func dso_local @_Z2fnv() {{.*}} { +// CIR: cir.func {{.*}} @_Z2fnv() // CIR: %[[A:.*]] = cir.alloca ![[REC_LAM_FN_A]], !cir.ptr, ["a"] // CIR: cir.call @_ZZ2fnvENK3$_0clEv(%[[A]]) @@ -85,7 +85,7 @@ void l0() { a(); } -// CIR: cir.func lambda internal private dso_local @_ZZ2l0vENK3$_0clEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) {{.*}} { +// CIR: cir.func {{.*}} lambda internal private dso_local @_ZZ2l0vENK3$_0clEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) // CIR: %[[THIS_ADDR:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CIR: cir.store %[[THIS_ARG]], %[[THIS_ADDR]] // CIR: %[[THIS:.*]] = cir.load %[[THIS_ADDR]] @@ -99,7 +99,7 @@ void l0() { // CIR: cir.store{{.*}} %[[I_PLUS_ONE]], %[[I_ADDR]] // CIR: cir.return -// CIR: cir.func {{.*}} @_Z2l0v() {{.*}} { +// CIR: cir.func {{.*}} @_Z2l0v() // CIR: %[[I:.*]] = cir.alloca !s32i, !cir.ptr, ["i"] // CIR: %[[A:.*]] = cir.alloca ![[REC_LAM_L0_A]], !cir.ptr, ["a", init] // CIR: %[[I_ADDR:.*]] = cir.get_member %[[A]][0] {name = "i"} @@ -157,7 +157,7 @@ auto g() { }; } -// CIR: cir.func dso_local @_Z1gv() -> ![[REC_LAM_G:.*]] {{.*}} { +// CIR: cir.func {{.*}} @_Z1gv() -> ![[REC_LAM_G:.*]] { // CIR: %[[RETVAL:.*]] = cir.alloca ![[REC_LAM_G]], !cir.ptr, ["__retval"] // CIR: %[[I_ADDR:.*]] = cir.alloca !s32i, !cir.ptr, ["i", init] // CIR: %[[TWELVE:.*]] = cir.const #cir.int<12> : !s32i @@ -199,7 +199,7 @@ auto g2() { } // Should be same as above because of NRVO -// CIR: cir.func dso_local @_Z2g2v() -> ![[REC_LAM_G2:.*]] {{.*}} { +// CIR: cir.func {{.*}} @_Z2g2v() -> ![[REC_LAM_G2:.*]] { // CIR: %[[RETVAL:.*]] = cir.alloca ![[REC_LAM_G2]], !cir.ptr, ["__retval", init] // CIR: %[[I_ADDR:.*]] = cir.alloca !s32i, !cir.ptr, ["i", init] // CIR: %[[TWELVE:.*]] = cir.const #cir.int<12> : !s32i @@ -232,7 +232,7 @@ int f() { return g2()(); } -// CIR:cir.func lambda internal private dso_local @_ZZ2g2vENK3$_0clEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) -> !s32i {{.*}} { +// CIR:cir.func {{.*}} lambda internal private dso_local @_ZZ2g2vENK3$_0clEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) -> !s32i // CIR: %[[THIS_ADDR:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] // CIR: %[[RETVAL:.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: cir.store %[[THIS_ARG]], %[[THIS_ADDR]] @@ -250,7 +250,7 @@ int f() { // CIR: %[[RET:.*]] = cir.load %[[RETVAL]] // CIR: cir.return %[[RET]] -// CIR: cir.func dso_local @_Z1fv() -> !s32i {{.*}} { +// CIR: cir.func {{.*}} @_Z1fv() -> !s32i // CIR: %[[RETVAL:.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: cir.scope { // CIR: %[[TMP:.*]] = cir.alloca ![[REC_LAM_G2]], !cir.ptr, ["ref.tmp0"] @@ -332,7 +332,7 @@ struct A { // OGCG: call noundef i32 @_ZN1A3barEv(ptr {{.*}} %[[A_THIS]]) // lambda operator() in foo() -// CIR: cir.func lambda comdat linkonce_odr @_ZZN1A3fooEvENKUlvE_clEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) {{.*}} { +// CIR: cir.func {{.*}} lambda comdat linkonce_odr @_ZZN1A3fooEvENKUlvE_clEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) // CIR: %[[THIS_ADDR:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] // CIR: %[[RETVAL:.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: cir.store{{.*}} %[[THIS_ARG]], %[[THIS_ADDR]] @@ -359,7 +359,7 @@ struct A { // The function above is defined after _ZN1A3barEv in OGCG, see below. // A::foo() -// CIR: cir.func {{.*}} @_ZN1A3fooEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) -> !s32i {{.*}} { +// CIR: cir.func {{.*}} @_ZN1A3fooEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) -> !s32i // CIR: %[[THIS_ADDR:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] // CIR: %[[RETVAL:.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: cir.store %[[THIS_ARG]], %[[THIS_ADDR]] @@ -402,7 +402,7 @@ struct A { // OGCG: ret i32 %[[LAM_RET]] // lambda operator() in bar() -// CIR: cir.func {{.*}} @_ZZN1A3barEvENKUlvE_clEv(%[[THIS_ARG2:.*]]: !cir.ptr {{.*}}) -> !s32i {{.*}} { +// CIR: cir.func {{.*}} @_ZZN1A3barEvENKUlvE_clEv(%[[THIS_ARG2:.*]]: !cir.ptr {{.*}}) -> !s32i // CIR: %[[THIS_ADDR:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] // CIR: %[[RETVAL:.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: cir.store{{.*}} %[[THIS_ARG]], %[[THIS_ADDR]] @@ -431,7 +431,7 @@ struct A { // The function above is defined after _ZZN1A3fooEvENKUlvE_clEv in OGCG, see below. // A::bar() -// CIR: cir.func {{.*}} @_ZN1A3barEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) -> !s32i {{.*}} { +// CIR: cir.func {{.*}} @_ZN1A3barEv(%[[THIS_ARG:.*]]: !cir.ptr {{.*}}) -> !s32i // CIR: %[[THIS_ADDR:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] // CIR: %[[RETVAL:.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: cir.store %[[THIS_ARG]], %[[THIS_ADDR]] @@ -499,7 +499,7 @@ int test_lambda_this1(){ return x+y; } -// CIR: cir.func {{.*}} @_Z17test_lambda_this1v{{.*}} { +// CIR: cir.func {{.*}} @_Z17test_lambda_this1v // CIR: cir.call @_ZN1AC1Ev(%[[A_THIS:.*]]){{.*}} : (!cir.ptr) -> () // CIR: cir.call @_ZN1A3fooEv(%[[A_THIS]]){{.*}} : (!cir.ptr) -> !s32i // CIR: cir.call @_ZN1A3barEv(%[[A_THIS]]){{.*}} : (!cir.ptr) -> !s32i diff --git a/clang/test/CIR/CodeGen/linkage-spec.cpp b/clang/test/CIR/CodeGen/linkage-spec.cpp index 1affecd28d488..bfb21f868bf63 100644 --- a/clang/test/CIR/CodeGen/linkage-spec.cpp +++ b/clang/test/CIR/CodeGen/linkage-spec.cpp @@ -1,42 +1,42 @@ // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - 2>&1 | FileCheck %s extern "C" void TopLevelC(){} -// CHECK: cir.func dso_local @TopLevelC() inline(never) { +// CHECK: cir.func no_inline dso_local @TopLevelC() extern "C++" void TopLevelCpp(){} -// CHECK: cir.func dso_local @_Z11TopLevelCppv() inline(never) { +// CHECK: cir.func no_inline dso_local @_Z11TopLevelCppv() extern "C++" { void ExternCppEmpty(){} - // CHECK: cir.func dso_local @_Z14ExternCppEmptyv() inline(never) { + // CHECK: cir.func no_inline dso_local @_Z14ExternCppEmptyv() extern "C" void ExternCpp_C(){} - // CHECK: cir.func dso_local @ExternCpp_C() inline(never) { + // CHECK: cir.func no_inline dso_local @ExternCpp_C() extern "C++" void ExternCpp_Cpp(){} - // CHECK: cir.func dso_local @_Z13ExternCpp_Cppv() inline(never) { + // CHECK: cir.func no_inline dso_local @_Z13ExternCpp_Cppv() extern "C" { void ExternCpp_CEmpty(){} - // CHECK: cir.func dso_local @ExternCpp_CEmpty() inline(never) { + // CHECK: cir.func no_inline dso_local @ExternCpp_CEmpty() extern "C" void ExternCpp_C_C(){} - // CHECK: cir.func dso_local @ExternCpp_C_C() inline(never) { + // CHECK: cir.func no_inline dso_local @ExternCpp_C_C() extern "C++" void ExternCpp_C_Cpp(){} - // CHECK: cir.func dso_local @_Z15ExternCpp_C_Cppv() inline(never) { + // CHECK: cir.func no_inline dso_local @_Z15ExternCpp_C_Cppv() } } extern "C" { void ExternCEmpty(){} - // CHECK: cir.func dso_local @ExternCEmpty() inline(never) { + // CHECK: cir.func no_inline dso_local @ExternCEmpty() extern "C" void ExternC_C(){} - // CHECK: cir.func dso_local @ExternC_C() inline(never) { + // CHECK: cir.func no_inline dso_local @ExternC_C() extern "C++" void ExternC_Cpp(){} - // CHECK: cir.func dso_local @_Z11ExternC_Cppv() inline(never) { + // CHECK: cir.func no_inline dso_local @_Z11ExternC_Cppv() extern "C++" { void ExternC_CppEmpty(){} - // CHECK: cir.func dso_local @_Z16ExternC_CppEmptyv() inline(never) { + // CHECK: cir.func no_inline dso_local @_Z16ExternC_CppEmptyv() extern "C" void ExternC_Cpp_C(){} - // CHECK: cir.func dso_local @ExternC_Cpp_C() inline(never) { + // CHECK: cir.func no_inline dso_local @ExternC_Cpp_C() extern "C++" void ExternC_Cpp_Cpp(){} - // CHECK: cir.func dso_local @_Z15ExternC_Cpp_Cppv() inline(never) { + // CHECK: cir.func no_inline dso_local @_Z15ExternC_Cpp_Cppv() } } diff --git a/clang/test/CIR/CodeGen/no-prototype.c b/clang/test/CIR/CodeGen/no-prototype.c index 728c4b80b95a2..d266ccb86448a 100644 --- a/clang/test/CIR/CodeGen/no-prototype.c +++ b/clang/test/CIR/CodeGen/no-prototype.c @@ -7,9 +7,9 @@ // No-proto definition followed by a correct call. int noProto0(x) int x; { return x; } -// CHECK: cir.func no_proto dso_local @noProto0(%arg0: !s32i {{.+}}) -> !s32i +// CHECK: cir.func {{.*}} no_proto {{.*}} @noProto0(%arg0: !s32i {{.+}}) -> !s32i int test0(int x) { - // CHECK: cir.func dso_local @test0 + // CHECK: cir.func {{.*}} @test0 return noProto0(x); // We know the definition. Should be a direct call. // CHECK: %{{.+}} = cir.call @noProto0(%{{.+}}) } @@ -21,9 +21,9 @@ int test0(int x) { // definition is not marked as no-proto. int noProto1(); int noProto1(int x) { return x; } -// CHECK: cir.func dso_local @noProto1(%arg0: !s32i {{.+}}) -> !s32i +// CHECK: cir.func {{.*}} @noProto1(%arg0: !s32i {{.+}}) -> !s32i int test1(int x) { - // CHECK: cir.func dso_local @test1 + // CHECK: cir.func {{.*}} @test1 return noProto1(x); // CHECK: %{{.+}} = cir.call @noProto1(%{{[0-9]+}}) : (!s32i) -> !s32i } @@ -39,7 +39,7 @@ int test2(int x) { // CHECK: {{.*}} = cir.call [[GGO]](%{{[0-9]+}}) : (!cir.ptr !s32i>>, !s32i) -> !s32i } int noProto2(int x) { return x; } -// CHECK: cir.func no_proto dso_local @noProto2(%arg0: !s32i {{.+}}) -> !s32i +// CHECK: cir.func {{.*}} no_proto {{.*}} @noProto2(%arg0: !s32i {{.+}}) -> !s32i // No-proto declaration without definition (any call here is "correct"). // @@ -48,7 +48,7 @@ int noProto2(int x) { return x; } int noProto3(); // cir.func private no_proto @noProto3(...) -> !s32i int test3(int x) { -// CHECK: cir.func dso_local @test3 +// CHECK: cir.func {{.*}} @test3 return noProto3(x); // CHECK: [[GGO:%.*]] = cir.get_global @noProto3 : !cir.ptr !s32i>> // CHECK: [[CAST:%.*]] = cir.cast bitcast [[GGO]] : !cir.ptr !s32i>> -> !cir.ptr !s32i>> @@ -64,7 +64,7 @@ int test3(int x) { // No-proto definition followed by an incorrect call due to extra args. int noProto4() { return 0; } -// cir.func private no_proto @noProto4() -> !s32i +// cir.func {{.*}} no_proto {{.*}} @noProto4() -> !s32i int test4(int x) { return noProto4(x); // Even if we know the definition, this should compile. // CHECK: [[GGO:%.*]] = cir.get_global @noProto4 : !cir.ptr !s32i>> @@ -81,4 +81,4 @@ int test5(int x) { // CHECK: {{%.*}} = cir.call [[CAST]]() : (!cir.ptr !s32i>>) -> !s32i } int noProto5(int x) { return x; } -// CHECK: cir.func no_proto dso_local @noProto5(%arg0: !s32i {{.+}}) -> !s32i +// CHECK: cir.func {{.*}} no_proto {{.*}} @noProto5(%arg0: !s32i {{.+}}) -> !s32i diff --git a/clang/test/CIR/CodeGen/placement-new.cpp b/clang/test/CIR/CodeGen/placement-new.cpp index 7ceaa0a359e1f..ccc3548091ef3 100644 --- a/clang/test/CIR/CodeGen/placement-new.cpp +++ b/clang/test/CIR/CodeGen/placement-new.cpp @@ -16,7 +16,7 @@ void test_reserved_placement_new(void *p) { new (p) A(); } -// CIR-LABEL: cir.func dso_local @_Z27test_reserved_placement_newPv( +// CIR-LABEL: cir.func {{.*}} @_Z27test_reserved_placement_newPv( // CIR-SAME: %[[ARG0:.*]]: !cir.ptr // CIR: %[[P:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["p", init] // CIR: cir.store %[[ARG0]], %[[P]] : !cir.ptr, !cir.ptr> diff --git a/clang/test/CIR/CodeGen/ptrdiff.cpp b/clang/test/CIR/CodeGen/ptrdiff.cpp index 34ba0ff725581..5805349b74879 100644 --- a/clang/test/CIR/CodeGen/ptrdiff.cpp +++ b/clang/test/CIR/CodeGen/ptrdiff.cpp @@ -8,7 +8,7 @@ typedef unsigned long size_type; size_type size(unsigned long *_start, unsigned long *_finish) { - // CIR-LABEL: cir.func dso_local @_Z4sizePmS_ + // CIR-LABEL: cir.func {{.*}} @_Z4sizePmS_ // CIR: %[[D:.*]] = cir.ptr_diff {{.*}} : !cir.ptr -> !s64i // CIR: %[[U:.*]] = cir.cast integral %[[D]] : !s64i -> !u64i // CIR: cir.return {{.*}} : !u64i diff --git a/clang/test/CIR/CodeGen/statement-exprs.c b/clang/test/CIR/CodeGen/statement-exprs.c index f917334ade829..2ea4672cbf7f9 100644 --- a/clang/test/CIR/CodeGen/statement-exprs.c +++ b/clang/test/CIR/CodeGen/statement-exprs.c @@ -9,7 +9,7 @@ int f19(void) { return ({ 3;;4; }); } -// CIR: cir.func dso_local @f19() -> !s32i +// CIR: cir.func {{.*}} @f19() -> !s32i // CIR: %[[RETVAL:.+]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: %[[TMP:.+]] = cir.alloca !s32i, !cir.ptr, ["tmp"] // CIR: cir.scope { @@ -47,7 +47,7 @@ void f20(void) { return ({ 3;;4;; }); } -// CIR-LABEL: cir.func dso_local @f20() {{[^-]*}} +// CIR-LABEL: cir.func {{.*}} @f20() {{[^-]*}} // CIR: cir.return {{[^%]*}} // LLVM-LABEL: define{{.*}} void @f20 @@ -61,7 +61,7 @@ int nested(void) { } } -// CIR: cir.func dso_local @nested() -> !s32i +// CIR: cir.func {{.*}} @nested() -> !s32i // CIR: %[[RETVAL:.+]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: %[[TMP_OUTER:.+]] = cir.alloca !s32i, !cir.ptr, ["tmp"] // CIR: cir.scope { @@ -164,7 +164,7 @@ void empty() { return ({;;;;}); } -// CIR: cir.func no_proto dso_local @empty() +// CIR: cir.func {{.*}} @empty() // CIR-NEXT: cir.return // LLVM: define dso_local void @empty() @@ -177,7 +177,7 @@ void empty() { void empty2() { ({ }); } -// CIR: @empty2 +// CIR: cir.func {{.*}} @empty2 // CIR-NEXT: cir.return // LLVM: @empty2() @@ -191,7 +191,7 @@ void empty2() { ({ }); } // Yields an out-of-scope scalar. void test2() { ({int x = 3; x; }); } -// CIR: @test2 +// CIR: cir.func {{.*}} @test2 // CIR: %[[RETVAL:.+]] = cir.alloca !s32i, !cir.ptr // CIR: cir.scope { // CIR: %[[VAR:.+]] = cir.alloca !s32i, !cir.ptr, ["x", init] @@ -226,7 +226,7 @@ void test2() { ({int x = 3; x; }); } // Yields an aggregate. struct S { int x; }; int test3() { return ({ struct S s = {1}; s; }).x; } -// CIR: cir.func no_proto dso_local @test3() -> !s32i +// CIR: cir.func {{.*}} @test3() -> !s32i // CIR: %[[RETVAL:.+]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: cir.scope { // CIR: %[[REF_TMP0:.+]] = cir.alloca !rec_S, !cir.ptr, ["ref.tmp0"] @@ -277,6 +277,6 @@ int test3() { return ({ struct S s = {1}; s; }).x; } // Expression is wrapped in an expression attribute (just ensure it does not crash). void test4(int x) { ({[[gsl::suppress("foo")]] x;}); } -// CIR: @test4 +// CIR: cir.func {{.*}} @test4 // LLVM: @test4 // OGCG: @test4 diff --git a/clang/test/CIR/CodeGen/stmt-expr.cpp b/clang/test/CIR/CodeGen/stmt-expr.cpp index 9e3911f638ba7..f65bf9b7e010f 100644 --- a/clang/test/CIR/CodeGen/stmt-expr.cpp +++ b/clang/test/CIR/CodeGen/stmt-expr.cpp @@ -20,7 +20,7 @@ void test1() { }).Foo(); } -// CIR: cir.func dso_local @_Z5test1v() +// CIR: cir.func {{.*}} @_Z5test1v() // CIR: cir.scope { // CIR: %[[REF_TMP0:.+]] = cir.alloca !rec_A, !cir.ptr, ["ref.tmp0"] // CIR: %[[TMP:.+]] = cir.alloca !rec_A, !cir.ptr, ["tmp"] @@ -67,7 +67,7 @@ void cleanup() { ({ with_dtor wd; }); } -// CIR: cir.func dso_local @_Z7cleanupv() +// CIR: cir.func {{.*}} @_Z7cleanupv() // CIR: cir.scope { // CIR: %[[WD:.+]] = cir.alloca !rec_with_dtor, !cir.ptr, ["wd"] // CIR: cir.call @_ZN9with_dtorD1Ev(%[[WD]]) nothrow : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/var_arg.c b/clang/test/CIR/CodeGen/var_arg.c index f5b92c61e11ad..04a3350d372ee 100644 --- a/clang/test/CIR/CodeGen/var_arg.c +++ b/clang/test/CIR/CodeGen/var_arg.c @@ -17,7 +17,7 @@ int varargs(int count, ...) { return res; } -// CIR-LABEL: cir.func dso_local @varargs( +// CIR-LABEL: cir.func {{.*}} @varargs( // CIR: %[[COUNT_ADDR:.+]] = cir.alloca !s32i, !cir.ptr, ["count", init] // CIR: %[[RET_ADDR:.+]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: %[[VAAREA:.+]] = cir.alloca !cir.array, !cir.ptr>, ["args"] @@ -93,7 +93,7 @@ int stdarg_start(int count, ...) { return res; } -// CIR-LABEL: cir.func dso_local @stdarg_start( +// CIR-LABEL: cir.func {{.*}} @stdarg_start( // CIR: %[[COUNT_ADDR:.+]] = cir.alloca !s32i, !cir.ptr, ["count", init] // CIR: %[[RET_ADDR:.+]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: %[[VAAREA:.+]] = cir.alloca !cir.array, !cir.ptr>, ["args"] diff --git a/clang/test/CIR/CodeGen/variable-decomposition.cpp b/clang/test/CIR/CodeGen/variable-decomposition.cpp index f0e19263cd6db..3ba2fac3151c9 100644 --- a/clang/test/CIR/CodeGen/variable-decomposition.cpp +++ b/clang/test/CIR/CodeGen/variable-decomposition.cpp @@ -16,7 +16,7 @@ float function() { return a + b; } -// CIR-LABEL: cir.func dso_local @_Z8functionv() -> !cir.float +// CIR-LABEL: cir.func {{.*}} @_Z8functionv() -> !cir.float // CIR: %[[RETVAL:.+]] = cir.alloca !cir.float, !cir.ptr, ["__retval"] // CIR: %[[STRUCT:.+]] = cir.alloca !rec_some_struct, !cir.ptr, ["", init] // CIR: %[[CONST:.+]] = cir.const #cir.const_record<{#cir.int<1> : !s32i, #cir.fp<2.000000e+00> : !cir.float}> : !rec_some_struct diff --git a/clang/test/CIR/CodeGen/vbase.cpp b/clang/test/CIR/CodeGen/vbase.cpp index 8fcb2a442cd16..c1f3972b0aed3 100644 --- a/clang/test/CIR/CodeGen/vbase.cpp +++ b/clang/test/CIR/CodeGen/vbase.cpp @@ -128,7 +128,7 @@ void ppp() { B b; } // OGCG: ret void // Constructor for B -// CIR: cir.func comdat linkonce_odr @_ZN1BC1Ev(%arg0: !cir.ptr +// CIR: cir.func {{.*}} @_ZN1BC1Ev(%arg0: !cir.ptr // CIR: %[[THIS_ADDR:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] // CIR: cir.store %arg0, %[[THIS_ADDR]] : !cir.ptr, !cir.ptr> // CIR: %[[THIS:.*]] = cir.load %[[THIS_ADDR]] : !cir.ptr>, !cir.ptr diff --git a/clang/test/CIR/CodeGen/volatile.cpp b/clang/test/CIR/CodeGen/volatile.cpp index df1d3a66733e3..17a7154291692 100644 --- a/clang/test/CIR/CodeGen/volatile.cpp +++ b/clang/test/CIR/CodeGen/volatile.cpp @@ -9,7 +9,7 @@ int test_load(volatile int *ptr) { return *ptr; } -// CIR: cir.func dso_local @_Z9test_loadPVi +// CIR: cir.func {{.*}} @_Z9test_loadPVi // CIR: cir.load volatile // LLVM: define {{.*}} i32 @_Z9test_loadPVi @@ -22,7 +22,7 @@ void test_store(volatile int *ptr) { *ptr = 42; } -// CIR: cir.func dso_local @_Z10test_storePVi +// CIR: cir.func {{.*}} @_Z10test_storePVi // CIR: cir.store volatile // LLVM: define {{.*}} void @_Z10test_storePVi @@ -41,7 +41,7 @@ int test_load_field1(volatile Foo *ptr) { return ptr->x; } -// CIR: cir.func dso_local @_Z16test_load_field1PV3Foo +// CIR: cir.func {{.*}} @_Z16test_load_field1PV3Foo // CIR: %[[MEMBER_ADDR:.*]] = cir.get_member // CIR: %{{.+}} = cir.load volatile{{.*}} %[[MEMBER_ADDR]] @@ -57,7 +57,7 @@ int test_load_field2(Foo *ptr) { return ptr->y; } -// CIR: cir.func dso_local @_Z16test_load_field2P3Foo +// CIR: cir.func {{.*}} @_Z16test_load_field2P3Foo // CIR: %[[MEMBER_ADDR:.*]] = cir.get_member // CIR: %{{.+}} = cir.load volatile{{.*}} %[[MEMBER_ADDR]] @@ -73,7 +73,7 @@ int test_load_field3(Foo *ptr) { return ptr->z; } -// CIR: cir.func dso_local @_Z16test_load_field3P3Foo +// CIR: cir.func {{.*}} @_Z16test_load_field3P3Foo // CIR: %[[MEMBER_ADDR:.*]] = cir.get_member // CIR: %{{.*}} = cir.get_bitfield align(4) (#bfi_z, %[[MEMBER_ADDR:.+]] {is_volatile} : !cir.ptr) -> !s32i @@ -95,7 +95,7 @@ void test_store_field1(volatile Foo *ptr) { ptr->x = 42; } -// CIR: cir.func dso_local @_Z17test_store_field1PV3Foo +// CIR: cir.func {{.*}} @_Z17test_store_field1PV3Foo // CIR: %[[MEMBER_ADDR:.*]] = cir.get_member // CIR: cir.store volatile{{.*}} %{{.+}}, %[[MEMBER_ADDR]] @@ -111,7 +111,7 @@ void test_store_field2(Foo *ptr) { ptr->y = 42; } -// CIR: cir.func dso_local @_Z17test_store_field2P3Foo +// CIR: cir.func {{.*}} @_Z17test_store_field2P3Foo // CIR: %[[MEMBER_ADDR:.*]] = cir.get_member // CIR: cir.store volatile{{.*}} %{{.+}}, %[[MEMBER_ADDR]] @@ -127,7 +127,7 @@ void test_store_field3(Foo *ptr) { ptr->z = 4; } -// CIR: cir.func dso_local @_Z17test_store_field3P3Foo +// CIR: cir.func {{.*}} @_Z17test_store_field3P3Foo // CIR: %[[MEMBER_ADDR:.*]] = cir.get_member // CIR: cir.set_bitfield align(4) (#bfi_z, %[[MEMBER_ADDR:.+]] : !cir.ptr, %1 : !s32i) {is_volatile} @@ -155,7 +155,7 @@ void A::set_x(int val) volatile { x = val; } -// CIR: cir.func dso_local @_ZNV1A5set_xEi +// CIR: cir.func {{.*}} @_ZNV1A5set_xEi // CIR: %[[MEMBER_ADDR:.*]] = cir.get_member %{{.*}}[0] {name = "x"} // CIR: cir.store volatile {{.*}} %{{.*}}, %[[MEMBER_ADDR]] @@ -171,7 +171,7 @@ int A::get_x() volatile { return x; } -// CIR: cir.func dso_local @_ZNV1A5get_xEv +// CIR: cir.func {{.*}} @_ZNV1A5get_xEv // CIR: %[[MEMBER_ADDR:.*]] = cir.get_member %{{.*}}[0] {name = "x"} // CIR: cir.load volatile {{.*}} %[[MEMBER_ADDR]] diff --git a/clang/test/CIR/CodeGen/vtable-emission.cpp b/clang/test/CIR/CodeGen/vtable-emission.cpp index 9a34573b475c3..ceefb2ab31443 100644 --- a/clang/test/CIR/CodeGen/vtable-emission.cpp +++ b/clang/test/CIR/CodeGen/vtable-emission.cpp @@ -32,7 +32,7 @@ void S::key() {} // OGCG: @_ZTV1S = unnamed_addr constant { [4 x ptr] } { [4 x ptr] // OGCG-SAME: [ptr null, ptr null, ptr @_ZN1S3keyEv, ptr @_ZN1S6nonKeyEv] } -// CHECK: cir.func dso_local @_ZN1S3keyEv +// CHECK: cir.func {{.*}} @_ZN1S3keyEv // The reference from the vtable should result in nonKey being emitted. -// CHECK: cir.func comdat linkonce_odr @_ZN1S6nonKeyEv +// CHECK: cir.func no_inline comdat linkonce_odr @_ZN1S6nonKeyEv diff --git a/clang/test/CIR/CodeGenBuiltins/builtin-fcmp-sse.c b/clang/test/CIR/CodeGenBuiltins/builtin-fcmp-sse.c index c273d6b3fca0e..35abd1b57ecb0 100644 --- a/clang/test/CIR/CodeGenBuiltins/builtin-fcmp-sse.c +++ b/clang/test/CIR/CodeGenBuiltins/builtin-fcmp-sse.c @@ -9,8 +9,8 @@ typedef float __m128 __attribute__((__vector_size__(16), __aligned__(16))); typedef double __m128d __attribute__((__vector_size__(16), __aligned__(16))); __m128 test_cmpnleps(__m128 A, __m128 B) { - // CIR-LABEL: cir.func dso_local @test_cmpnleps( - // CIR: %[[ARG0:.*]]: !cir.vector<4 x !cir.float> {{.*}}, %[[ARG1:.*]]: !cir.vector<4 x !cir.float> {{.*}}) -> !cir.vector<4 x !cir.float> inline(never) { + // CIR-LABEL: cir.func no_inline dso_local @test_cmpnleps( + // CIR: %[[ARG0:.*]]: !cir.vector<4 x !cir.float> {{.*}}, %[[ARG1:.*]]: !cir.vector<4 x !cir.float> {{.*}}) -> !cir.vector<4 x !cir.float> { // CIR: %[[ALLOCA_0:.*]] = cir.alloca !cir.vector<4 x !cir.float>, !cir.ptr>, ["A", init] {alignment = 16 : i64} // CIR: %[[ALLOCA_1:.*]] = cir.alloca !cir.vector<4 x !cir.float>, !cir.ptr>, ["B", init] {alignment = 16 : i64} // CIR: %[[ALLOCA_2:.*]] = cir.alloca !cir.vector<4 x !cir.float>, !cir.ptr>, ["__retval"] {alignment = 16 : i64} @@ -60,8 +60,8 @@ __m128 test_cmpnleps(__m128 A, __m128 B) { } __m128d test_cmpnlepd(__m128d A, __m128d B) { - // CIR-LABEL: cir.func dso_local @test_cmpnlepd( - // CIR: %[[ARG0:.*]]: !cir.vector<2 x !cir.double> {{.*}}, %[[ARG1:.*]]: !cir.vector<2 x !cir.double> {{.*}}) -> !cir.vector<2 x !cir.double> inline(never) { + // CIR-LABEL: cir.func no_inline dso_local @test_cmpnlepd( + // CIR: %[[ARG0:.*]]: !cir.vector<2 x !cir.double> {{.*}}, %[[ARG1:.*]]: !cir.vector<2 x !cir.double> {{.*}}) -> !cir.vector<2 x !cir.double> { // CIR: %[[ALLOCA_0:.*]] = cir.alloca !cir.vector<2 x !cir.double>, !cir.ptr>, ["A", init] {alignment = 16 : i64} // CIR: %[[ALLOCA_1:.*]] = cir.alloca !cir.vector<2 x !cir.double>, !cir.ptr>, ["B", init] {alignment = 16 : i64} // CIR: %[[ALLOCA_2:.*]] = cir.alloca !cir.vector<2 x !cir.double>, !cir.ptr>, ["__retval"] {alignment = 16 : i64} @@ -111,8 +111,8 @@ __m128d test_cmpnlepd(__m128d A, __m128d B) { } __m128 test_cmpnltps(__m128 A, __m128 B) { - // CIR-LABEL: cir.func dso_local @test_cmpnltps( - // CIR-SAME: %[[ARG0:.*]]: !cir.vector<4 x !cir.float> {{.*}}, %[[ARG1:.*]]: !cir.vector<4 x !cir.float> {{.*}}) -> !cir.vector<4 x !cir.float> inline(never) { + // CIR-LABEL: cir.func no_inline dso_local @test_cmpnltps( + // CIR: %[[ARG0:.*]]: !cir.vector<4 x !cir.float> {{.*}}, %[[ARG1:.*]]: !cir.vector<4 x !cir.float> {{.*}}) -> !cir.vector<4 x !cir.float> { // CIR: %[[ALLOCA_0:.*]] = cir.alloca !cir.vector<4 x !cir.float>, !cir.ptr>, ["A", init] {alignment = 16 : i64} // CIR: %[[ALLOCA_1:.*]] = cir.alloca !cir.vector<4 x !cir.float>, !cir.ptr>, ["B", init] {alignment = 16 : i64} // CIR: %[[ALLOCA_2:.*]] = cir.alloca !cir.vector<4 x !cir.float>, !cir.ptr>, ["__retval"] {alignment = 16 : i64} @@ -162,8 +162,8 @@ __m128 test_cmpnltps(__m128 A, __m128 B) { } __m128d test_cmpnltpd(__m128d A, __m128d B) { - // CIR-LABEL: cir.func dso_local @test_cmpnltpd( - // CIR: %[[ARG0:.*]]: !cir.vector<2 x !cir.double> {{.*}}, %[[ARG1:.*]]: !cir.vector<2 x !cir.double> {{.*}}) -> !cir.vector<2 x !cir.double> inline(never) { + // CIR-LABEL: cir.func no_inline dso_local @test_cmpnltpd( + // CIR: %[[ARG0:.*]]: !cir.vector<2 x !cir.double> {{.*}}, %[[ARG1:.*]]: !cir.vector<2 x !cir.double> {{.*}}) -> !cir.vector<2 x !cir.double> { // CIR: %[[ALLOCA_0:.*]] = cir.alloca !cir.vector<2 x !cir.double>, !cir.ptr>, ["A", init] {alignment = 16 : i64} // CIR: %[[ALLOCA_1:.*]] = cir.alloca !cir.vector<2 x !cir.double>, !cir.ptr>, ["B", init] {alignment = 16 : i64} // CIR: %[[ALLOCA_2:.*]] = cir.alloca !cir.vector<2 x !cir.double>, !cir.ptr>, ["__retval"] {alignment = 16 : i64} diff --git a/clang/test/CIR/CodeGenBuiltins/builtin_inline.c b/clang/test/CIR/CodeGenBuiltins/builtin_inline.c index 83a3ba6e53f4b..06437ecd6ccd6 100644 --- a/clang/test/CIR/CodeGenBuiltins/builtin_inline.c +++ b/clang/test/CIR/CodeGenBuiltins/builtin_inline.c @@ -20,7 +20,7 @@ void *test_inline_builtin_memcpy(void *a, const void *b, size_t c) { return memcpy(a, b, c); } -// CIR: cir.func internal private{{.*}}@memcpy.inline({{.*}}) -> !cir.ptr inline(always) +// CIR: cir.func always_inline internal private{{.*}}@memcpy.inline({{.*}}) -> !cir.ptr // CIR-LABEL: @test_inline_builtin_memcpy( // CIR: cir.call @memcpy.inline( diff --git a/clang/test/CIR/CodeGenBuiltins/builtin_prefetch.c b/clang/test/CIR/CodeGenBuiltins/builtin_prefetch.c index cfe85b9ba8104..15eb37bb2f88b 100644 --- a/clang/test/CIR/CodeGenBuiltins/builtin_prefetch.c +++ b/clang/test/CIR/CodeGenBuiltins/builtin_prefetch.c @@ -9,7 +9,7 @@ void foo(void *a) { __builtin_prefetch(a, 1, 1); // rw=1, locality=1 } -// CIR-LABEL: cir.func dso_local @foo( +// CIR-LABEL: cir.func {{.*}} @foo( // CIR: %[[ALLOCA:.*]] = cir.alloca !cir.ptr // CIR: cir.store %arg0, %[[ALLOCA]] : !cir.ptr, !cir.ptr> // CIR: %[[P1:.*]] = cir.load{{.*}} %[[ALLOCA]] : !cir.ptr>, !cir.ptr diff --git a/clang/test/CIR/CodeGenBuiltins/builtins-overflow.cpp b/clang/test/CIR/CodeGenBuiltins/builtins-overflow.cpp index 9ee3e7c015209..4e568a865dcbc 100644 --- a/clang/test/CIR/CodeGenBuiltins/builtins-overflow.cpp +++ b/clang/test/CIR/CodeGenBuiltins/builtins-overflow.cpp @@ -9,7 +9,7 @@ bool test_add_overflow_uint_uint_uint(unsigned x, unsigned y, unsigned *res) { return __builtin_add_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z32test_add_overflow_uint_uint_uintjjPj +// CIR: cir.func {{.*}} @_Z32test_add_overflow_uint_uint_uintjjPj // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -27,7 +27,7 @@ bool test_add_overflow_int_int_int(int x, int y, int *res) { return __builtin_add_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z29test_add_overflow_int_int_intiiPi +// CIR: cir.func {{.*}} @_Z29test_add_overflow_int_int_intiiPi // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -39,7 +39,7 @@ bool test_add_overflow_xint31_xint31_xint31(_BitInt(31) x, _BitInt(31) y, _BitIn return __builtin_add_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z38test_add_overflow_xint31_xint31_xint31DB31_S_PS_ +// CIR: cir.func {{.*}} @_Z38test_add_overflow_xint31_xint31_xint31DB31_S_PS_ // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>>, !cir.ptr> @@ -51,7 +51,7 @@ bool test_sub_overflow_uint_uint_uint(unsigned x, unsigned y, unsigned *res) { return __builtin_sub_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z32test_sub_overflow_uint_uint_uintjjPj +// CIR: cir.func {{.*}} @_Z32test_sub_overflow_uint_uint_uintjjPj // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -63,7 +63,7 @@ bool test_sub_overflow_int_int_int(int x, int y, int *res) { return __builtin_sub_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z29test_sub_overflow_int_int_intiiPi +// CIR: cir.func {{.*}} @_Z29test_sub_overflow_int_int_intiiPi // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -75,7 +75,7 @@ bool test_sub_overflow_xint31_xint31_xint31(_BitInt(31) x, _BitInt(31) y, _BitIn return __builtin_sub_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z38test_sub_overflow_xint31_xint31_xint31DB31_S_PS_ +// CIR: cir.func {{.*}} @_Z38test_sub_overflow_xint31_xint31_xint31DB31_S_PS_ // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>>, !cir.ptr> @@ -87,7 +87,7 @@ bool test_mul_overflow_uint_uint_uint(unsigned x, unsigned y, unsigned *res) { return __builtin_mul_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z32test_mul_overflow_uint_uint_uintjjPj +// CIR: cir.func {{.*}} @_Z32test_mul_overflow_uint_uint_uintjjPj // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -99,7 +99,7 @@ bool test_mul_overflow_int_int_int(int x, int y, int *res) { return __builtin_mul_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z29test_mul_overflow_int_int_intiiPi +// CIR: cir.func {{.*}} @_Z29test_mul_overflow_int_int_intiiPi // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -111,7 +111,7 @@ bool test_mul_overflow_xint31_xint31_xint31(_BitInt(31) x, _BitInt(31) y, _BitIn return __builtin_mul_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z38test_mul_overflow_xint31_xint31_xint31DB31_S_PS_ +// CIR: cir.func {{.*}} @_Z38test_mul_overflow_xint31_xint31_xint31DB31_S_PS_ // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>>, !cir.ptr> @@ -123,7 +123,7 @@ bool test_mul_overflow_ulong_ulong_long(unsigned long x, unsigned long y, unsign return __builtin_mul_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z34test_mul_overflow_ulong_ulong_longmmPm +// CIR: cir.func {{.*}} @_Z34test_mul_overflow_ulong_ulong_longmmPm // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -135,7 +135,7 @@ bool test_add_overflow_uint_int_int(unsigned x, int y, int *res) { return __builtin_add_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z30test_add_overflow_uint_int_intjiPi +// CIR: cir.func {{.*}} @_Z30test_add_overflow_uint_int_intjiPi // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -149,7 +149,7 @@ bool test_add_overflow_volatile(int x, int y, volatile int *res) { return __builtin_add_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z26test_add_overflow_volatileiiPVi +// CIR: cir.func {{.*}} @_Z26test_add_overflow_volatileiiPVi // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -161,7 +161,7 @@ bool test_uadd_overflow(unsigned x, unsigned y, unsigned *res) { return __builtin_uadd_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z18test_uadd_overflowjjPj +// CIR: cir.func {{.*}} @_Z18test_uadd_overflowjjPj // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -173,7 +173,7 @@ bool test_uaddl_overflow(unsigned long x, unsigned long y, unsigned long *res) { return __builtin_uaddl_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z19test_uaddl_overflowmmPm +// CIR: cir.func {{.*}} @_Z19test_uaddl_overflowmmPm // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -185,7 +185,7 @@ bool test_uaddll_overflow(unsigned long long x, unsigned long long y, unsigned l return __builtin_uaddll_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z20test_uaddll_overflowyyPy +// CIR: cir.func {{.*}} @_Z20test_uaddll_overflowyyPy // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -197,7 +197,7 @@ bool test_usub_overflow(unsigned x, unsigned y, unsigned *res) { return __builtin_usub_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z18test_usub_overflowjjPj +// CIR: cir.func {{.*}} @_Z18test_usub_overflowjjPj // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -209,7 +209,7 @@ bool test_usubl_overflow(unsigned long x, unsigned long y, unsigned long *res) { return __builtin_usubl_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z19test_usubl_overflowmmPm +// CIR: cir.func {{.*}} @_Z19test_usubl_overflowmmPm // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -221,7 +221,7 @@ bool test_usubll_overflow(unsigned long long x, unsigned long long y, unsigned l return __builtin_usubll_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z20test_usubll_overflowyyPy +// CIR: cir.func {{.*}} @_Z20test_usubll_overflowyyPy // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -233,7 +233,7 @@ bool test_umul_overflow(unsigned x, unsigned y, unsigned *res) { return __builtin_umul_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z18test_umul_overflowjjPj +// CIR: cir.func {{.*}} @_Z18test_umul_overflowjjPj // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -245,7 +245,7 @@ bool test_umull_overflow(unsigned long x, unsigned long y, unsigned long *res) { return __builtin_umull_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z19test_umull_overflowmmPm +// CIR: cir.func {{.*}} @_Z19test_umull_overflowmmPm // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -257,7 +257,7 @@ bool test_umulll_overflow(unsigned long long x, unsigned long long y, unsigned l return __builtin_umulll_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z20test_umulll_overflowyyPy +// CIR: cir.func {{.*}} @_Z20test_umulll_overflowyyPy // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -269,7 +269,7 @@ bool test_sadd_overflow(int x, int y, int *res) { return __builtin_sadd_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z18test_sadd_overflowiiPi +// CIR: cir.func {{.*}} @_Z18test_sadd_overflowiiPi // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -281,7 +281,7 @@ bool test_saddl_overflow(long x, long y, long *res) { return __builtin_saddl_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z19test_saddl_overflowllPl +// CIR: cir.func {{.*}} @_Z19test_saddl_overflowllPl // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -293,7 +293,7 @@ bool test_saddll_overflow(long long x, long long y, long long *res) { return __builtin_saddll_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z20test_saddll_overflowxxPx +// CIR: cir.func {{.*}} @_Z20test_saddll_overflowxxPx // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -305,7 +305,7 @@ bool test_ssub_overflow(int x, int y, int *res) { return __builtin_ssub_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z18test_ssub_overflowiiPi +// CIR: cir.func {{.*}} @_Z18test_ssub_overflowiiPi // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -317,7 +317,7 @@ bool test_ssubl_overflow(long x, long y, long *res) { return __builtin_ssubl_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z19test_ssubl_overflowllPl +// CIR: cir.func {{.*}} @_Z19test_ssubl_overflowllPl // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -329,7 +329,7 @@ bool test_ssubll_overflow(long long x, long long y, long long *res) { return __builtin_ssubll_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z20test_ssubll_overflowxxPx +// CIR: cir.func {{.*}} @_Z20test_ssubll_overflowxxPx // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -341,7 +341,7 @@ bool test_smul_overflow(int x, int y, int *res) { return __builtin_smul_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z18test_smul_overflowiiPi +// CIR: cir.func {{.*}} @_Z18test_smul_overflowiiPi // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -353,7 +353,7 @@ bool test_smull_overflow(long x, long y, long *res) { return __builtin_smull_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z19test_smull_overflowllPl +// CIR: cir.func {{.*}} @_Z19test_smull_overflowllPl // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -365,7 +365,7 @@ bool test_smulll_overflow(long long x, long long y, long long *res) { return __builtin_smulll_overflow(x, y, res); } -// CIR: cir.func dso_local @_Z20test_smulll_overflowxxPx +// CIR: cir.func {{.*}} @_Z20test_smulll_overflowxxPx // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr diff --git a/clang/test/CIR/IR/inline-attrs.cir b/clang/test/CIR/IR/inline-attrs.cir index f525abe240366..b1437a975eb78 100644 --- a/clang/test/CIR/IR/inline-attrs.cir +++ b/clang/test/CIR/IR/inline-attrs.cir @@ -3,31 +3,38 @@ !s32i = !cir.int module { - cir.func @noinline_func(%arg0: !s32i) -> !s32i inline(never) { + // CHECK: cir.func no_inline @noinline_func(%arg0: !s32i) -> !s32i + cir.func no_inline @noinline_func(%arg0: !s32i) -> !s32i { cir.return %arg0 : !s32i } - cir.func @always_inline_func(%arg0: !s32i) -> !s32i inline(always) { + + // CHECK: cir.func always_inline @always_inline_func(%arg0: !s32i) -> !s32i + cir.func always_inline @always_inline_func(%arg0: !s32i) -> !s32i { cir.return %arg0 : !s32i } - cir.func @inline_hint_func(%arg0: !s32i) -> !s32i inline(hint) { + + // CHECK: cir.func inline_hint @inline_hint_func(%arg0: !s32i) -> !s32i + cir.func inline_hint @inline_hint_func(%arg0: !s32i) -> !s32i{ cir.return %arg0 : !s32i } + + // CHECK: cir.func @regular_func(%arg0: !s32i) -> !s32i cir.func @regular_func(%arg0: !s32i) -> !s32i { cir.return %arg0 : !s32i } - cir.func dso_local @noinline_with_attrs(%arg0: !s32i) -> !s32i inline(never) { + + // CHECK: cir.func no_inline dso_local @noinline_with_attrs(%arg0: !s32i) -> !s32i + cir.func no_inline dso_local @noinline_with_attrs(%arg0: !s32i) -> !s32i { cir.return %arg0 : !s32i } - cir.func private @noinline_decl(!s32i) -> !s32i inline(never) - cir.func private @always_inline_decl(!s32i) -> !s32i inline(always) - cir.func private @inline_hint_decl(!s32i) -> !s32i inline(hint) + + // CHECK: cir.func no_inline private @noinline_decl(!s32i) -> !s32i + cir.func no_inline private @noinline_decl(!s32i) -> !s32i + + // CHECK: cir.func always_inline private @always_inline_decl(!s32i) -> !s32i + cir.func always_inline private @always_inline_decl(!s32i) -> !s32i + + // CHECK: cir.func inline_hint private @inline_hint_decl(!s32i) -> !s32i + cir.func inline_hint private @inline_hint_decl(!s32i) -> !s32i } -// CHECK: cir.func @noinline_func(%arg0: !s32i) -> !s32i inline(never) -// CHECK: cir.func @always_inline_func(%arg0: !s32i) -> !s32i inline(always) -// CHECK: cir.func @inline_hint_func(%arg0: !s32i) -> !s32i inline(hint) -// CHECK: cir.func @regular_func(%arg0: !s32i) -> !s32i { -// CHECK: cir.func dso_local @noinline_with_attrs(%arg0: !s32i) -> !s32i inline(never) -// CHECK: cir.func private @noinline_decl(!s32i) -> !s32i inline(never) -// CHECK: cir.func private @always_inline_decl(!s32i) -> !s32i inline(always) -// CHECK: cir.func private @inline_hint_decl(!s32i) -> !s32i inline(hint) diff --git a/clang/test/CIR/func-linkage.cpp b/clang/test/CIR/func-linkage.cpp index d43f7ed273063..c90a69cba105d 100644 --- a/clang/test/CIR/func-linkage.cpp +++ b/clang/test/CIR/func-linkage.cpp @@ -8,7 +8,7 @@ void a() {} -// CIR: cir.func dso_local @_Z1av() +// CIR: cir.func no_inline dso_local @_Z1av() // LLVM: define dso_local void @_Z1av() // OGCG: define dso_local void @_Z1av() @@ -18,12 +18,12 @@ extern void b(); // OGCG: declare void @_Z1bv() static void c() {} -// CIR: cir.func internal private dso_local @_ZL1cv() +// CIR: cir.func no_inline internal private dso_local @_ZL1cv() // LLVM: define internal void @_ZL1cv() // OGCG: define internal void @_ZL1cv() inline void d() {} -// CIR: cir.func comdat linkonce_odr @_Z1dv() +// CIR: cir.func {{.*}} comdat linkonce_odr @_Z1dv() // LLVM: define linkonce_odr void @_Z1dv() // OGCG: define linkonce_odr void @_Z1dv(){{.*}} comdat @@ -31,7 +31,7 @@ namespace { void e() {} } -// CIR: cir.func internal private dso_local @_ZN12_GLOBAL__N_11eEv() +// CIR: cir.func {{.*}} internal private dso_local @_ZN12_GLOBAL__N_11eEv() // LLVM: define internal void @_ZN12_GLOBAL__N_11eEv() // OGCG: define internal void @_ZN12_GLOBAL__N_11eEv()