-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[Clang][AArch64] Include SME attributes in the name mangling of function types #114209
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 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c62f487
[Clang][AArch64] Include SME attributes in the name mangling of funct…
kmclaughlin-arm 153c45e
- Attributes are now encoded as one bitmask, with each of the attributes
kmclaughlin-arm cada212
- Added SMEState enum
kmclaughlin-arm b264d84
- Changed name of SMEState & changed to enum class
kmclaughlin-arm e84a781
- Added LLVM_MARK_AS_BITMASK_ENUM & removed static_casts from encodeA…
kmclaughlin-arm 3a9e2d4
- Changed LargestValue for LLVM_MARK_AS_BITMASK_ENUM and removed more…
kmclaughlin-arm 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sme -target-feature +sme2 %s -emit-llvm -o - | FileCheck %s | ||
|
|
||
| typedef __attribute__((neon_vector_type(2))) int int32x2_t; | ||
|
|
||
| // | ||
| // Streaming-Mode Attributes | ||
| // | ||
|
|
||
| // CHECK: define dso_local void @_Z12fn_streamingP11__SME_ATTRSIFvvELj1EE | ||
| void fn_streaming(void (*foo)() __arm_streaming) { foo(); } | ||
|
|
||
| // CHECK: define dso_local void @_Z23fn_streaming_compatibleP11__SME_ATTRSIFivELj2EE( | ||
| void fn_streaming_compatible(int (*foo)() __arm_streaming_compatible) { foo(); } | ||
|
|
||
| // | ||
| // ZA Attributes | ||
| // | ||
|
|
||
| // CHECK: define dso_local void @_Z15fn_za_preservedP11__SME_ATTRSIF11__Int32x2_tvELj32EE( | ||
| __arm_new("za") void fn_za_preserved(int32x2_t (*foo)() __arm_preserves("za")) { foo(); } | ||
|
|
||
| // CHECK: define dso_local void @_Z8fn_za_inP11__SME_ATTRSIFvu13__SVFloat64_tELj8EES_( | ||
| __arm_new("za") void fn_za_in(void (*foo)(__SVFloat64_t) __arm_in("za"), __SVFloat64_t x) { foo(x); } | ||
|
|
||
| // CHECK: define dso_local noundef i32 @_Z9fn_za_outP11__SME_ATTRSIFivELj16EE( | ||
| __arm_new("za") int fn_za_out(int (*foo)() __arm_out("za")) { return foo(); } | ||
|
|
||
| // CHECK: define dso_local void @_Z11fn_za_inoutP11__SME_ATTRSIFvvELj24EE( | ||
| __arm_new("za") void fn_za_inout(void (*foo)() __arm_inout("za")) { foo(); } | ||
|
|
||
|
|
||
| // | ||
| // ZT0 Attributes | ||
| // | ||
|
|
||
| // CHECK: define dso_local void @_Z16fn_zt0_preservedP11__SME_ATTRSIFivELj256EE( | ||
| __arm_new("zt0") void fn_zt0_preserved(int (*foo)() __arm_preserves("zt0")) { foo(); } | ||
|
|
||
| // CHECK: define dso_local void @_Z9fn_zt0_inP11__SME_ATTRSIFivELj64EE( | ||
| __arm_new("zt0") void fn_zt0_in(int (*foo)() __arm_in("zt0")) { foo(); } | ||
|
|
||
| // CHECK: define dso_local void @_Z10fn_zt0_outP11__SME_ATTRSIFivELj128EE( | ||
| __arm_new("zt0") void fn_zt0_out(int (*foo)() __arm_out("zt0")) { foo(); } | ||
|
|
||
| // CHECK: define dso_local void @_Z12fn_zt0_inoutP11__SME_ATTRSIFivELj192EE( | ||
| __arm_new("zt0") void fn_zt0_inout(int (*foo)() __arm_inout("zt0")) { foo(); } | ||
|
|
||
| // | ||
| // Streaming-mode, ZA & ZT0 Attributes | ||
| // | ||
|
|
||
| // CHECK: define dso_local void @_Z17fn_all_attr_typesP11__SME_ATTRSIFivELj282EE( | ||
| __arm_new("za") __arm_new("zt0") | ||
| void fn_all_attr_types(int (*foo)() __arm_streaming_compatible __arm_inout("za") __arm_preserves("zt0")) | ||
| { foo(); } | ||
|
|
||
| // | ||
| // No SME Attributes | ||
| // | ||
|
|
||
| // CHECK: define dso_local void @_Z12no_sme_attrsPFvvE( | ||
| void no_sme_attrs(void (*foo)()) { foo(); } | ||
|
|
||
| // CHECK: define dso_local void @_Z24locally_streaming_callerPFvvE( | ||
| __arm_locally_streaming void locally_streaming_caller(void (*foo)()) { foo(); } | ||
|
|
||
| // CHECK: define dso_local void @_Z16streaming_callerv( | ||
| void streaming_caller() __arm_streaming {} | ||
|
|
||
| // CHECK: define dso_local void @_Z16za_shared_callerv( | ||
| void za_shared_caller() __arm_in("za") {} | ||
|
|
||
| // CHECK: define dso_local void @_Z17zt0_shared_callerv( | ||
| void zt0_shared_caller() __arm_out("zt0") {} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove the
static_castif you changeBitmasktoAAPCSBitmaskSME. Then the only place that still requires a bitcast is where you printBitmasktoOut.