Skip to content
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

[SME] Add support for inserting processor state annotations #16761

Merged
merged 1 commit into from Mar 26, 2024

Conversation

lhutton1
Copy link
Contributor

Execution of SME instructions requires the processor be in a certain state. This functionality can be can be controlled using LLVM function level annotations such as "aarch64_pstate_sm_enabled" or "aarch64_pstate_za_new" (see arm_utils.py for more information).

This commit exposes this functionality for AArch64 schedules where SME intrinsics will be called. The attributes are intended to be added at the block-level around the compute definition. They are prepended with "pragma" to ensure they remain in the lowering.

In order to detect these attributes and convert them to the relevant LLVM function attributes, a new AArch64 LLVM codegen backend is added. This backend extends the functionality of codegen_llvm for AArch64 specific compilation.

Tests to check these attributes propagate correctly have been added.

Execution of SME instructions requires the processor be in a certain
state. This functionality can be can be controlled using LLVM function
level annotations such as "aarch64_pstate_sm_enabled" or
"aarch64_pstate_za_new" (see arm_utils.py for more information).

This commit exposes this functionality for AArch64 schedules where SME
intrinsics will be called. The attributes are intended to be added
at the block-level around the compute definition. They are prepended
with "pragma" to ensure they remain in the lowering.

In order to detect these attributes and convert them to the relevant
LLVM function attributes, a new AArch64 LLVM codegen backend is added.
This backend extends the functionality of `codegen_llvm` for AArch64
specific compilation.

Tests to check these attributes propagate correctly have been added.

Change-Id: I5b848afdeedd395de4650bf06720ea57e50ebd78
Copy link
Contributor

@ekalda ekalda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lhutton1 looks all good to me!

@ekalda ekalda merged commit ac2f478 into apache:main Mar 26, 2024
19 checks passed
@ekalda
Copy link
Contributor

ekalda commented Mar 26, 2024

Thanks @lhutton1!

thaisacs pushed a commit to thaisacs/tvm that referenced this pull request Apr 3, 2024
…6761)

Execution of SME instructions requires the processor be in a certain
state. This functionality can be can be controlled using LLVM function
level annotations such as "aarch64_pstate_sm_enabled" or
"aarch64_pstate_za_new" (see arm_utils.py for more information).

This commit exposes this functionality for AArch64 schedules where SME
intrinsics will be called. The attributes are intended to be added
at the block-level around the compute definition. They are prepended
with "pragma" to ensure they remain in the lowering.

In order to detect these attributes and convert them to the relevant
LLVM function attributes, a new AArch64 LLVM codegen backend is added.
This backend extends the functionality of `codegen_llvm` for AArch64
specific compilation.

Tests to check these attributes propagate correctly have been added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants