-
Notifications
You must be signed in to change notification settings - Fork 14
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
(release 20.x non-upstream patch) [LV] Add initial support for vectorizing literal struct return values #82
base: release/arm-software/20.x
Are you sure you want to change the base?
Conversation
This patch adds initial support for vectorizing literal struct return values. Currently, this is limited to the case where the struct is homogeneous (all elements have the same type) and not packed. The users of the call also must all be `extractvalue` instructions. The intended use case for this is vectorizing intrinsics such as: ``` declare { float, float } @llvm.sincos.f32(float %x) ``` Mapping them to structure-returning library calls such as: ``` declare { <4 x float>, <4 x i32> } @Sleef_sincosf4_u10advsimd(<4 x float>) ``` Or their widened form (such as `@llvm.sincos.v4f32` in this case). Implementing this required two main changes: 1. Supporting widening `extractvalue` 2. Adding support for vectorized struct types in LV * This is mostly limited to parts of the cost model and scalarization Since the supported use case is narrow, the required changes are relatively small.
PR now merged upstream. |
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.
Since this is a downstream change, it should follow the downstream patch policy: https://github.com/arm/arm-toolchain/blob/arm-software/CONTRIBUTING.md#downstream-patch-policy
If it's a critical change that didn't make the upstream release, then please make sure it's tracked appropriately.
Hey @dcandler, I've gone over the requirements and attempted to address them for this PR. The main one that's unclear to me is "source change should be annotated with a comment", which seems slightly impractical for non-trivial changes
PRs include links to LLVM patches, the main release for the patch(es) not being upstream is long review times.
I've created tracking issue #87.
I'm not sure how to go about this one. It seems impractical for non-trivial changes.
N/A (yet)
N/A
N/A
Only #84 should noticeably change behaviour (as sincos calls become vectorizable with |
cc @david-arm |
Thanks - this is the first time attempting to apply the policy, so it's also a bit of a test of the policy itself.
I think the text in the commit message might need to be exactly
I can see it as being a bit of a burden here, but it's also meant to help with the automated scanning of the sources to ensure everything is tracked. Again though, the scripts and infrastructure for those checks is not in place yet - so if we did relax that requirement it might still need adding back in later. |
Just checking: Are PRs to this repo squash merged (like upstream LLVM) -- so only the PR description needs updating to update the commit message?
What do you suggest we do for these PRs? |
Yes, squashing is enabled (and currently the default) so you can use the updated description when merging. For the annotations, I think we should stick to the policy as written since that's what was agreed; if it's not followed then it defeats the purpose of having the policy in the first place. |
I've added the annotations for this PR. Since there are no examples in the guide, I just made up a format for them. |
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.
Formatting of the annotations looks fine to me - we can probably expand the policy with more examples/guidelines once we've gotten to see how it works out in practice (and any automated checking is implemented, if anything stricter is needed).
This reverts commit 8065001.
The corresponding upstream PR has now been merged (llvm/llvm-project#109833), so I've removed the comments as this is now a simple cherry-pick. The other PRs are still downstream. |
A cherry pick to our downstream release branch is still considered a downstream change to which the policy would apply, since it causes our branch to diverge from the upstream version. To avoid making it a downstream change, it would need to be cherry-picked to the upstream release branch, where it could be automerged to ours. |
This reverts commit 199a9ec.
Alright, I've added the comments back 👍 |
This patch adds initial support for vectorizing literal struct return values. Currently, this is limited to the case where the struct is homogeneous (all elements have the same type) and not packed. The users of the call also must all be
extractvalue
instructions.The intended use case for this is vectorizing intrinsics such as:
Mapping them to structure-returning library calls such as:
Or their widened form (such as
@llvm.sincos.v4f32
in this case).Implementing this required two main changes:
extractvalue
Since the supported use case is narrow, the required changes are relatively small.
Downstream issue: #87