Skip to content

LLVM 24: configure float-abi via module flag - #161317

Open
TimNN wants to merge 1 commit into
rust-lang:mainfrom
TimNN:float-abi-flag
Open

LLVM 24: configure float-abi via module flag#161317
TimNN wants to merge 1 commit into
rust-lang:mainfrom
TimNN:float-abi-flag

Conversation

@TimNN

@TimNN TimNN commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

TargetOptions::FloatABIType was removed in llvm/llvm-project#215796

See llvm/llvm-project#212985 for the corresponding clang change.

The ModuleFlagMergeBehavior::Error was copied from the clang implementation.

This currently relies on the string representation of Rust's FloatAbi "target_spec_enum" matching LLVM. This seemed reasonable to me since the representation is quite straightforward ("soft" and "hard"), but let me know if you'd like an explicit to_llvm_float_abi_str, either defined in Rust or forwarding to llvm::FloatABI::getABITypeName.

Contrary to the clang implementation which only sets the module flag if it differs from the target default, we set it whenever the Rust target has an explicit float ABI set. See also discussion in #t-compiler/llvm > float-abi module flag behavior.

The added test won't actually run on Rust's own CI until that updates to LLVM 24.

@rustbot label llvm-main

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. llvm-main Marks PRs that are making Rust work with LLVM main (this label is consumed by CI tooling) labels Aug 18, 2026
@TimNN TimNN changed the title WIP: LLVM 24: configure float-abi via module flag LLVM 24: configure float-abi via module flag Aug 19, 2026
@TimNN
TimNN marked this pull request as ready for review August 19, 2026 05:11
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 19, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 19, 2026
@rustbot

rustbot commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

r? @khyperia

rustbot has assigned @khyperia.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 16 candidates

@TimNN

TimNN commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot author

I noticed that I was a bit inconsistent with the LLVM version conditions - I think there's no real issue with applying the flag on LLVM versions that don't explicitly check it, but want to verify on Zulip.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 19, 2026
@rustbot

rustbot commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@TimNN

TimNN commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

Based on the Zulip thread, I've updated the PR to only apply the float-abi module flag on LLVM 24+.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 19, 2026
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. llvm-main Marks PRs that are making Rust work with LLVM main (this label is consumed by CI tooling) 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants