Skip to content

Always inline functions signatures containing f16 or f128#133050

Merged
bors merged 2 commits intorust-lang:masterfrom
tgross35:inline-f16-f128
Nov 15, 2024
Merged

Always inline functions signatures containing f16 or f128#133050
bors merged 2 commits intorust-lang:masterfrom
tgross35:inline-f16-f128

Conversation

@tgross35
Copy link
Copy Markdown
Contributor

@tgross35 tgross35 commented Nov 14, 2024

There are a handful of tier 2 and tier 3 targets that cause a LLVM crash or linker error when generating code that contains f16 or f128. The cranelift backend also does not support these types. To work around this, every function in std or core that contains these types must be marked #[inline] in order to avoid sending any code to the backend unless specifically requested.

However, this is inconvenient and easy to forget. Introduce a check for these types in the frontend that automatically inlines any function signatures that take or return f16 or f128.

Note that this is not a perfect fix because it does not account for the types being passed by reference or as members of aggregate types, but this is sufficient for what is currently needed in the standard library.

Fixes: #133035
Closes: #133037

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-f16_and_f128 `#![feature(f16)]`, `#![feature(f128)]` 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.

LLVM ERROR about f128 on AIX and SPARC32 when building core without optimization

8 participants