Skip to content

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

Merged
ekalda merged 1 commit into
apache:mainfrom
lhutton1:p3-processor-state-annotations
Mar 26, 2024
Merged

ekalda merged 1 commit into
apache:mainfrom
lhutton1:p3-processor-state-annotations

Conversation

@lhutton1

Copy link
Copy Markdown
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

@ekalda ekalda left a comment

Copy link
Copy Markdown
Contributor

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
@ekalda

ekalda commented Mar 26, 2024

Copy link
Copy Markdown
Contributor

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.
@lhutton1
lhutton1 deleted the p3-processor-state-annotations branch June 6, 2024 10:41
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.

2 participants