Skip to content

Use x30 register name with LLVM 23+ - #163062

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
malezjaa:remove-aarch64-x30-asm-workaround
Sep 21, 2026
Merged

rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
malezjaa:remove-aarch64-x30-asm-workaround

Conversation

@malezjaa

@malezjaa malezjaa commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #148900

Thanks to llvm/llvm-project#167783, LLVM now recognizes the x30/x29 register names.

r? @folkertdev

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 20, 2026
@taiki-e

taiki-e commented Sep 20, 2026

Copy link
Copy Markdown
Member

IIUC, the fix is available on LLVM 23+ (llvm/llvm-project@47e142b), but our minimum LLVM version is LLVM 21.

panic!("\n\nbad LLVM version: {version}, need >=21\n\n")

@malezjaa

Copy link
Copy Markdown
Contributor Author

Oh yeah... I didn't think about that, sorry!

@malezjaa malezjaa closed this Sep 20, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 20, 2026
@folkertdev

Copy link
Copy Markdown
Contributor

We can at least update the comments though (same for llvm/llvm-project#179740). And you can make using the new register name conditional on the LLVM version (plenty of code does that), and use 2 revisions to check both > 22 and <= 22. The advantage of that is that we'll definitely clean it up once we drop support for version 22.

@malezjaa malezjaa reopened this Sep 20, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 20, 2026
@malezjaa
malezjaa force-pushed the remove-aarch64-x30-asm-workaround branch from 744fd28 to bca6e26 Compare September 20, 2026 12:01
@malezjaa malezjaa changed the title remove x30 asm workaround on aarch64 Use x30 register name with LLVM 23+ Sep 20, 2026
@malezjaa

malezjaa commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Updated. I guess this shouldn't close the original issue anymore? (#148900)

@folkertdev folkertdev 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.

Do you want to do the arm one (llvm/llvm-project#179740) too? It's the same idea.

View changes since this review

Comment thread tests/codegen-llvm/asm-aarch64-x30.rs Outdated
Comment thread compiler/rustc_codegen_llvm/src/asm.rs Outdated
@malezjaa

Copy link
Copy Markdown
Contributor Author

Okay, I'll do arm too.

@malezjaa
malezjaa force-pushed the remove-aarch64-x30-asm-workaround branch from bca6e26 to 3de0624 Compare September 20, 2026 12:30

@folkertdev folkertdev 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.

@rust-bors

rust-bors Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3de0624 has been approved by folkertdev

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 20, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 21, 2026
…rkaround, r=folkertdev

Use x30 register name with LLVM 23+

Closes rust-lang#148900

Thanks to llvm/llvm-project#167783, LLVM now recognizes the `x30`/`x29` register names.

r? @folkertdev
rust-bors Bot pushed a commit that referenced this pull request Sep 21, 2026
Rollup of 15 pull requests

Successful merges:

 - #161051 (When error from local macro, include macro def span)
 - #162750 (add case mapping fast paths for Latin-1)
 - #162831 (Do not continue past `rustc_resolve` when encountering duplicated items)
 - #162835 (rustdoc: account for nested parens and split text events in bare urls lint)
 - #163044 (Report runtime range endpoints for runtime values)
 - #163062 (Use x30 register name with LLVM 23+)
 - #158102 (When compiling without a specified `--edition`, emit a note)
 - #162984 (Windows: don't error if `access_mode` is set on `OpenOptions`)
 - #163005 (Avoid unreachable integer underflow check in `CStr::count_bytes()`)
 - #163019 (Prepare for the introduction of forced keywords (`k#`))
 - #163020 (Dir: fix fallback impl for remove_dir)
 - #163047 (Use verbose suggestion for `mut binding` instead of `&mut binding`)
 - #163075 (Fix ArgAttributes mismatches in ABI UI tests for LoongArch64 and RiscV64)
 - #163079 (enable `f128` from `u64`/`i64` test)
 - #163082 (Remove `TypeChecker::root_cx`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 21, 2026
…rkaround, r=folkertdev

Use x30 register name with LLVM 23+

Closes rust-lang#148900

Thanks to llvm/llvm-project#167783, LLVM now recognizes the `x30`/`x29` register names.

r? @folkertdev
rust-bors Bot pushed a commit that referenced this pull request Sep 21, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #161051 (When error from local macro, include macro def span)
 - #161629 (Streamline `StateDiffCollector`)
 - #162750 (add case mapping fast paths for Latin-1)
 - #162831 (Do not continue past `rustc_resolve` when encountering duplicated items)
 - #162835 (rustdoc: account for nested parens and split text events in bare urls lint)
 - #162952 (Depend on lockfiles to prevent GC of the current session)
 - #163044 (Report runtime range endpoints for runtime values)
 - #163062 (Use x30 register name with LLVM 23+)
 - #158102 (When compiling without a specified `--edition`, emit a note)
 - #162939 (Declare multi-kind constants for MacroKinds)
 - #162984 (Windows: don't error if `access_mode` is set on `OpenOptions`)
 - #163005 (Avoid unreachable integer underflow check in `CStr::count_bytes()`)
 - #163019 (Prepare for the introduction of forced keywords (`k#`))
 - #163020 (Dir: fix fallback impl for remove_dir)
 - #163047 (Use verbose suggestion for `mut binding` instead of `&mut binding`)
 - #163075 (Fix ArgAttributes mismatches in ABI UI tests for LoongArch64 and RiscV64)
 - #163079 (enable `f128` from `u64`/`i64` test)
 - #163082 (Remove `TypeChecker::root_cx`)
rust-bors Bot pushed a commit that referenced this pull request Sep 21, 2026
…uwer

Rollup of 19 pull requests

Successful merges:

 - #161051 (When error from local macro, include macro def span)
 - #161629 (Streamline `StateDiffCollector`)
 - #162750 (add case mapping fast paths for Latin-1)
 - #162831 (Do not continue past `rustc_resolve` when encountering duplicated items)
 - #162835 (rustdoc: account for nested parens and split text events in bare urls lint)
 - #162952 (Depend on lockfiles to prevent GC of the current session)
 - #163044 (Report runtime range endpoints for runtime values)
 - #163062 (Use x30 register name with LLVM 23+)
 - #163091 (miri subtree update)
 - #162939 (Declare multi-kind constants for MacroKinds)
 - #162984 (Windows: don't error if `access_mode` is set on `OpenOptions`)
 - #163005 (Avoid unreachable integer underflow check in `CStr::count_bytes()`)
 - #163019 (Prepare for the introduction of forced keywords (`k#`))
 - #163020 (Dir: fix fallback impl for remove_dir)
 - #163041 (Be more explicit on suggestion type without changing how they are rendered)
 - #163047 (Use verbose suggestion for `mut binding` instead of `&mut binding`)
 - #163075 (Fix ArgAttributes mismatches in ABI UI tests for LoongArch64 and RiscV64)
 - #163079 (enable `f128` from `u64`/`i64` test)
 - #163082 (Remove `TypeChecker::root_cx`)
@rust-bors
rust-bors Bot merged commit 0e00d84 into rust-lang:main Sep 21, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 21, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 21, 2026
Rollup merge of #163062 - malezjaa:remove-aarch64-x30-asm-workaround, r=folkertdev

Use x30 register name with LLVM 23+

Closes #148900

Thanks to llvm/llvm-project#167783, LLVM now recognizes the `x30`/`x29` register names.

r? @folkertdev
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Sep 22, 2026
…uwer

Rollup of 19 pull requests

Successful merges:

 - rust-lang/rust#161051 (When error from local macro, include macro def span)
 - rust-lang/rust#161629 (Streamline `StateDiffCollector`)
 - rust-lang/rust#162750 (add case mapping fast paths for Latin-1)
 - rust-lang/rust#162831 (Do not continue past `rustc_resolve` when encountering duplicated items)
 - rust-lang/rust#162835 (rustdoc: account for nested parens and split text events in bare urls lint)
 - rust-lang/rust#162952 (Depend on lockfiles to prevent GC of the current session)
 - rust-lang/rust#163044 (Report runtime range endpoints for runtime values)
 - rust-lang/rust#163062 (Use x30 register name with LLVM 23+)
 - rust-lang/rust#163091 (miri subtree update)
 - rust-lang/rust#162939 (Declare multi-kind constants for MacroKinds)
 - rust-lang/rust#162984 (Windows: don't error if `access_mode` is set on `OpenOptions`)
 - rust-lang/rust#163005 (Avoid unreachable integer underflow check in `CStr::count_bytes()`)
 - rust-lang/rust#163019 (Prepare for the introduction of forced keywords (`k#`))
 - rust-lang/rust#163020 (Dir: fix fallback impl for remove_dir)
 - rust-lang/rust#163041 (Be more explicit on suggestion type without changing how they are rendered)
 - rust-lang/rust#163047 (Use verbose suggestion for `mut binding` instead of `&mut binding`)
 - rust-lang/rust#163075 (Fix ArgAttributes mismatches in ABI UI tests for LoongArch64 and RiscV64)
 - rust-lang/rust#163079 (enable `f128` from `u64`/`i64` test)
 - rust-lang/rust#163082 (Remove `TypeChecker::root_cx`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aarch64: remove x30 -> lr translation in inline assembly clobbers

4 participants