Always inline functions signatures containing f16 or f128#133050
Merged
bors merged 2 commits intorust-lang:masterfrom Nov 15, 2024
Merged
Always inline functions signatures containing f16 or f128#133050bors merged 2 commits intorust-lang:masterfrom
f16 or f128#133050bors merged 2 commits intorust-lang:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are a handful of tier 2 and tier 3 targets that cause a LLVM crash or linker error when generating code that contains
f16orf128. The cranelift backend also does not support these types. To work around this, every function instdorcorethat 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
f16orf128.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