Skip to content

[compiler-rt][ARM] Only use bxaut when the target has pacbti #146057

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 1 commit into from
Jun 27, 2025

Conversation

john-brawn-arm
Copy link
Collaborator

Most pacbti instructions are a nop when the target does not have pacbti, and thus safe to execute, but bxaut is an undefined instruction. When we don't have pacbti (e.g. if we're compiling compiler-rt with -mbranch-protection=standard in order to be forward-compatible with pacbti while still working on targets without it) then we need to use separate aut and bx instructions.

Most pacbti instructions are a nop when the target does not have
pacbti, and thus safe to execute, but bxaut is an undefined
instruction. When we don't have pacbti (e.g. if we're compiling
compiler-rt with -mbranch-protection=standard in order to be
forward-compatible with pacbti while still working on targets without
it) then we need to use separate aut and bx instructions.
Copy link
Member

@vhscampos vhscampos left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@smithp35 smithp35 left a comment

Choose a reason for hiding this comment

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

LGTM too. Good to have an option to only use the hint space.

@john-brawn-arm john-brawn-arm merged commit ec1c73b into llvm:main Jun 27, 2025
10 checks passed
@john-brawn-arm john-brawn-arm deleted the bxaut branch June 27, 2025 12:26
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
…6057)

Most pacbti instructions are a nop when the target does not have pacbti,
and thus safe to execute, but bxaut is an undefined instruction. When we
don't have pacbti (e.g. if we're compiling compiler-rt with
-mbranch-protection=standard in order to be forward-compatible with
pacbti while still working on targets without it) then we need to use
separate aut and bx instructions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants