-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[FMV][AArch64] Emit mangled default version if explicitly specified. #120022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f3997c4
[FMV][AArch64] Emit mangled default version if explicitly specified.
labrinea 7fee7ce
Update clang/lib/Sema/SemaDecl.cpp
labrinea 1e84b67
Merge branch 'main' into fmv-always-emit-mangled-default
labrinea 8973d17
Merge branch 'main' into fmv-always-emit-mangled-default
labrinea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
221 changes: 221 additions & 0 deletions
221
clang/test/CodeGen/AArch64/fmv-mix-explicit-implicit-default.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,221 @@ | ||
| // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -emit-llvm -o - %s | FileCheck %s | ||
| // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature -fmv -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-NOFMV | ||
|
|
||
| int implicit_default_decl_first(void); | ||
| __attribute__((target_version("default"))) int implicit_default_decl_first(void) { return 1; } | ||
| int caller1(void) { return implicit_default_decl_first(); } | ||
|
|
||
| __attribute__((target_version("default"))) int explicit_default_def_first(void) { return 2; } | ||
| int explicit_default_def_first(void); | ||
| int caller2(void) { return explicit_default_def_first(); } | ||
|
|
||
| int implicit_default_def_first(void) { return 3; } | ||
| __attribute__((target_version("default"))) int implicit_default_def_first(void); | ||
| int caller3(void) { return implicit_default_def_first(); } | ||
|
|
||
| __attribute__((target_version("default"))) int explicit_default_decl_first(void); | ||
| int explicit_default_decl_first(void) { return 4; } | ||
| int caller4(void) { return explicit_default_decl_first(); } | ||
|
|
||
| int no_def_implicit_default_first(void); | ||
| __attribute__((target_version("default"))) int no_def_implicit_default_first(void); | ||
| int caller5(void) { return no_def_implicit_default_first(); } | ||
|
|
||
| __attribute__((target_version("default"))) int no_def_explicit_default_first(void); | ||
| int no_def_explicit_default_first(void); | ||
| int caller6(void) { return no_def_explicit_default_first(); } | ||
| //. | ||
| // CHECK: @implicit_default_decl_first = weak_odr ifunc i32 (), ptr @implicit_default_decl_first.resolver | ||
| // CHECK: @explicit_default_def_first = weak_odr ifunc i32 (), ptr @explicit_default_def_first.resolver | ||
| // CHECK: @implicit_default_def_first = weak_odr ifunc i32 (), ptr @implicit_default_def_first.resolver | ||
| // CHECK: @explicit_default_decl_first = weak_odr ifunc i32 (), ptr @explicit_default_decl_first.resolver | ||
| //. | ||
| // CHECK: Function Attrs: noinline nounwind optnone | ||
| // CHECK-LABEL: define {{[^@]+}}@implicit_default_decl_first.default | ||
| // CHECK-SAME: () #[[ATTR0:[0-9]+]] { | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: ret i32 1 | ||
| // | ||
| // | ||
| // CHECK: Function Attrs: noinline nounwind optnone | ||
| // CHECK-LABEL: define {{[^@]+}}@caller1 | ||
| // CHECK-SAME: () #[[ATTR1:[0-9]+]] { | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: [[CALL:%.*]] = call i32 @implicit_default_decl_first() | ||
| // CHECK-NEXT: ret i32 [[CALL]] | ||
| // | ||
| // | ||
| // CHECK: Function Attrs: noinline nounwind optnone | ||
| // CHECK-LABEL: define {{[^@]+}}@explicit_default_def_first.default | ||
| // CHECK-SAME: () #[[ATTR0]] { | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: ret i32 2 | ||
| // | ||
| // | ||
| // CHECK: Function Attrs: noinline nounwind optnone | ||
| // CHECK-LABEL: define {{[^@]+}}@caller2 | ||
| // CHECK-SAME: () #[[ATTR1]] { | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: [[CALL:%.*]] = call i32 @explicit_default_def_first() | ||
| // CHECK-NEXT: ret i32 [[CALL]] | ||
| // | ||
| // | ||
| // CHECK: Function Attrs: noinline nounwind optnone | ||
| // CHECK-LABEL: define {{[^@]+}}@implicit_default_def_first.default | ||
| // CHECK-SAME: () #[[ATTR1]] { | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: ret i32 3 | ||
| // | ||
| // | ||
| // CHECK: Function Attrs: noinline nounwind optnone | ||
| // CHECK-LABEL: define {{[^@]+}}@caller3 | ||
| // CHECK-SAME: () #[[ATTR1]] { | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: [[CALL:%.*]] = call i32 @implicit_default_def_first() | ||
| // CHECK-NEXT: ret i32 [[CALL]] | ||
| // | ||
| // | ||
| // CHECK: Function Attrs: noinline nounwind optnone | ||
| // CHECK-LABEL: define {{[^@]+}}@explicit_default_decl_first.default | ||
| // CHECK-SAME: () #[[ATTR0]] { | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: ret i32 4 | ||
| // | ||
| // | ||
| // CHECK: Function Attrs: noinline nounwind optnone | ||
| // CHECK-LABEL: define {{[^@]+}}@caller4 | ||
| // CHECK-SAME: () #[[ATTR1]] { | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: [[CALL:%.*]] = call i32 @explicit_default_decl_first() | ||
| // CHECK-NEXT: ret i32 [[CALL]] | ||
| // | ||
| // | ||
| // CHECK: declare i32 @no_def_implicit_default_first() #[[ATTR2:[0-9]+]] | ||
| // | ||
| // | ||
| // CHECK: Function Attrs: noinline nounwind optnone | ||
| // CHECK-LABEL: define {{[^@]+}}@caller5 | ||
| // CHECK-SAME: () #[[ATTR1]] { | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: [[CALL:%.*]] = call i32 @no_def_implicit_default_first() | ||
| // CHECK-NEXT: ret i32 [[CALL]] | ||
| // | ||
| // | ||
| // CHECK: declare i32 @no_def_explicit_default_first() #[[ATTR2]] | ||
| // | ||
| // | ||
| // CHECK: Function Attrs: noinline nounwind optnone | ||
| // CHECK-LABEL: define {{[^@]+}}@caller6 | ||
| // CHECK-SAME: () #[[ATTR1]] { | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: [[CALL:%.*]] = call i32 @no_def_explicit_default_first() | ||
| // CHECK-NEXT: ret i32 [[CALL]] | ||
| // | ||
| // | ||
| // CHECK-LABEL: define {{[^@]+}}@implicit_default_decl_first.resolver() comdat { | ||
| // CHECK-NEXT: resolver_entry: | ||
| // CHECK-NEXT: ret ptr @implicit_default_decl_first.default | ||
| // | ||
| // | ||
| // CHECK-LABEL: define {{[^@]+}}@explicit_default_def_first.resolver() comdat { | ||
| // CHECK-NEXT: resolver_entry: | ||
| // CHECK-NEXT: ret ptr @explicit_default_def_first.default | ||
| // | ||
| // | ||
| // CHECK-LABEL: define {{[^@]+}}@implicit_default_def_first.resolver() comdat { | ||
| // CHECK-NEXT: resolver_entry: | ||
| // CHECK-NEXT: ret ptr @implicit_default_def_first.default | ||
| // | ||
| // | ||
| // CHECK-LABEL: define {{[^@]+}}@explicit_default_decl_first.resolver() comdat { | ||
| // CHECK-NEXT: resolver_entry: | ||
| // CHECK-NEXT: ret ptr @explicit_default_decl_first.default | ||
| // | ||
| // | ||
| // CHECK: declare i32 @no_def_implicit_default_first.default() #[[ATTR2]] | ||
| // | ||
| // | ||
| // CHECK: declare i32 @no_def_explicit_default_first.default() #[[ATTR2]] | ||
| // | ||
| // | ||
| // CHECK-NOFMV: Function Attrs: noinline nounwind optnone | ||
| // CHECK-NOFMV-LABEL: define {{[^@]+}}@caller1 | ||
| // CHECK-NOFMV-SAME: () #[[ATTR0:[0-9]+]] { | ||
| // CHECK-NOFMV-NEXT: entry: | ||
| // CHECK-NOFMV-NEXT: [[CALL:%.*]] = call i32 @implicit_default_decl_first() | ||
| // CHECK-NOFMV-NEXT: ret i32 [[CALL]] | ||
| // | ||
| // | ||
| // CHECK-NOFMV: Function Attrs: noinline nounwind optnone | ||
| // CHECK-NOFMV-LABEL: define {{[^@]+}}@implicit_default_decl_first | ||
| // CHECK-NOFMV-SAME: () #[[ATTR1:[0-9]+]] { | ||
| // CHECK-NOFMV-NEXT: entry: | ||
| // CHECK-NOFMV-NEXT: ret i32 1 | ||
| // | ||
| // | ||
| // CHECK-NOFMV: Function Attrs: noinline nounwind optnone | ||
| // CHECK-NOFMV-LABEL: define {{[^@]+}}@caller2 | ||
| // CHECK-NOFMV-SAME: () #[[ATTR0]] { | ||
| // CHECK-NOFMV-NEXT: entry: | ||
| // CHECK-NOFMV-NEXT: [[CALL:%.*]] = call i32 @explicit_default_def_first() | ||
| // CHECK-NOFMV-NEXT: ret i32 [[CALL]] | ||
| // | ||
| // | ||
| // CHECK-NOFMV: Function Attrs: noinline nounwind optnone | ||
| // CHECK-NOFMV-LABEL: define {{[^@]+}}@explicit_default_def_first | ||
| // CHECK-NOFMV-SAME: () #[[ATTR1]] { | ||
| // CHECK-NOFMV-NEXT: entry: | ||
| // CHECK-NOFMV-NEXT: ret i32 2 | ||
| // | ||
| // | ||
| // CHECK-NOFMV: Function Attrs: noinline nounwind optnone | ||
| // CHECK-NOFMV-LABEL: define {{[^@]+}}@implicit_default_def_first | ||
| // CHECK-NOFMV-SAME: () #[[ATTR0]] { | ||
| // CHECK-NOFMV-NEXT: entry: | ||
| // CHECK-NOFMV-NEXT: ret i32 3 | ||
| // | ||
| // | ||
| // CHECK-NOFMV: Function Attrs: noinline nounwind optnone | ||
| // CHECK-NOFMV-LABEL: define {{[^@]+}}@caller3 | ||
| // CHECK-NOFMV-SAME: () #[[ATTR0]] { | ||
| // CHECK-NOFMV-NEXT: entry: | ||
| // CHECK-NOFMV-NEXT: [[CALL:%.*]] = call i32 @implicit_default_def_first() | ||
| // CHECK-NOFMV-NEXT: ret i32 [[CALL]] | ||
| // | ||
| // | ||
| // CHECK-NOFMV: Function Attrs: noinline nounwind optnone | ||
| // CHECK-NOFMV-LABEL: define {{[^@]+}}@caller4 | ||
| // CHECK-NOFMV-SAME: () #[[ATTR0]] { | ||
| // CHECK-NOFMV-NEXT: entry: | ||
| // CHECK-NOFMV-NEXT: [[CALL:%.*]] = call i32 @explicit_default_decl_first() | ||
| // CHECK-NOFMV-NEXT: ret i32 [[CALL]] | ||
| // | ||
| // | ||
| // CHECK-NOFMV: Function Attrs: noinline nounwind optnone | ||
| // CHECK-NOFMV-LABEL: define {{[^@]+}}@explicit_default_decl_first | ||
| // CHECK-NOFMV-SAME: () #[[ATTR1]] { | ||
| // CHECK-NOFMV-NEXT: entry: | ||
| // CHECK-NOFMV-NEXT: ret i32 4 | ||
| // | ||
| // | ||
| // CHECK-NOFMV: Function Attrs: noinline nounwind optnone | ||
| // CHECK-NOFMV-LABEL: define {{[^@]+}}@caller5 | ||
| // CHECK-NOFMV-SAME: () #[[ATTR0]] { | ||
| // CHECK-NOFMV-NEXT: entry: | ||
| // CHECK-NOFMV-NEXT: [[CALL:%.*]] = call i32 @no_def_implicit_default_first() | ||
| // CHECK-NOFMV-NEXT: ret i32 [[CALL]] | ||
| // | ||
| // | ||
| // CHECK-NOFMV: declare i32 @no_def_implicit_default_first() #[[ATTR2:[0-9]+]] | ||
| // | ||
| // | ||
| // CHECK-NOFMV: Function Attrs: noinline nounwind optnone | ||
| // CHECK-NOFMV-LABEL: define {{[^@]+}}@caller6 | ||
| // CHECK-NOFMV-SAME: () #[[ATTR0]] { | ||
| // CHECK-NOFMV-NEXT: entry: | ||
| // CHECK-NOFMV-NEXT: [[CALL:%.*]] = call i32 @no_def_explicit_default_first() | ||
| // CHECK-NOFMV-NEXT: ret i32 [[CALL]] | ||
| // | ||
| // | ||
| // CHECK-NOFMV: declare i32 @no_def_explicit_default_first() #[[ATTR2]] | ||
| //. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.