-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AArch64][SME] Extend Inliner cost-model with custom penalty for calls. #68416
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
[AArch64][SME] Extend Inliner cost-model with custom penalty for calls. #68416
Conversation
@llvm/pr-subscribers-llvm-transforms @llvm/pr-subscribers-backend-aarch64 ChangesThis is a stacked PR following on from #68415 This patch has two purposes: An example of (1) is:
where it wouldn't have inlined the function when foo would be a non-streaming function. An example of (2) is:
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
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.
LGTM
gentle ping |
This patch has two purposes: (1) It tries to make inlining more likely when it can avoid a streaming-mode change. (2) It avoids inlining when inlining causes more streaming-mode changes. An example of (1) is: void streaming_compatible_bar(void); void foo(void) __arm_streaming { /* other code */ streaming_compatible_bar(); /* other code */ } void f(void) { foo(); // expensive streaming mode change } -> void f(void) { /* other code */ streaming_compatible_bar(); /* other code */ } where it wouldn't have inlined the function when foo would be a non-streaming function. An example of (2) is: void streaming_bar(void) __arm_streaming; void foo(void) __arm_streaming { streaming_bar(); streaming_bar(); } void f(void) { foo(); // expensive streaming mode change } -> (do not inline into) void f(void) { streaming_bar(); // these are now two expensive streaming mode changes streaming_bar(); }
e98d96e
to
b2b29af
Compare
|
||
declare void @streaming_compatible_f() "aarch64_pstate_sm_compatible" | ||
|
||
define void @streaming_callee() "aarch64_pstate_sm_enabled" { |
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.
A comment would be helpful here to explain that @streaming_callee
doesn't contain any operations that use ZA state, and therefore can be legally inlined into a normal function.
This is a stacked PR following on from #68415
This patch has two purposes:
(1) It tries to make inlining more likely when it can avoid a streaming-mode change.
(2) It avoids inlining when inlining causes more streaming-mode changes.
An example of (1) is:
where it wouldn't have inlined the function when foo would be a non-streaming function.
An example of (2) is: