rust-lang / rust-lang/rust

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

Open Beginner friendly
#148,900 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-codegen A-LLVM C-cleanup llvm-fixed-upstream O-AArch64 S-waiting-on-LLVM T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Codegen currently has this code:

https://github.com/rust-lang/rust/blob/21cbbdc44de84e3ea99bca239091e5d1c49af654/compiler/rustc_codegen_llvm/src/asm.rs#L487-L490

I hit the same issue in Zig and decided to fix it properly in LLVM, so when the fix gets released, this will no longer be needed:

https://github.com/llvm/llvm-project/pull/167783

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The workaround is in compiler/rustc_codegen_llvm/src/asm.rs at lines 487-490; first check whether the LLVM change in linked PR 167783 is released and supported by Rust’s current LLVM version. Once it is, remove the aarch64 x30-to-lr translation and verify the compiler’s inline-assembly clobber behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.