1
Fork 0
rust/compiler/rustc_mir_transform/src
Trevor Gross 5d818914af Always inline functions signatures containing f16 or f128
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: https://github.com/rust-lang/rust/issues/133035
Closes: https://github.com/rust-lang/rust/pull/133037
2024-11-14 16:18:41 -06:00
..
coroutine compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
coverage Rollup merge of #132675 - Zalathar:empty-spans, r=jieyouxu 2024-11-10 17:43:07 +01:00
inline Remove #[macro_use] extern crate tracing from rustc_mir_transform. 2024-08-30 10:01:34 +10:00
shim compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
abort_unwinding_calls.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
add_call_guards.rs Inline and remove some functions. 2024-09-10 08:54:17 +10:00
add_moves_for_packed_drops.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
add_retag.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
add_subtyping_projections.rs Inline and remove some functions. 2024-09-10 08:54:17 +10:00
check_alignment.rs Rename and reorder lots of lifetimes. 2024-09-13 15:46:20 +10:00
check_const_item_mutation.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
check_packed_ref.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
check_undefined_transmutes.rs Add a Lint for Pointer to Integer Transmutes in Consts 2024-10-05 12:48:02 +00:00
cleanup_post_borrowck.rs be even more precise about "cast" vs "coercion" 2024-09-24 23:12:02 +02:00
copy_prop.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
coroutine.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
cost_checker.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
cross_crate_inline.rs Always inline functions signatures containing f16 or f128 2024-11-14 16:18:41 -06:00
ctfe_limit.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
dataflow_const_prop.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
dead_store_elimination.rs Remove Analysis::into_engine. 2024-10-30 09:41:46 +11:00
deduce_param_attrs.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
deduplicate_blocks.rs Rename and reorder lots of lifetimes. 2024-09-13 15:46:20 +10:00
deref_separator.rs Use LocalDecls in a couple of places. 2024-09-09 15:15:44 +10:00
dest_prop.rs Remove Analysis::into_engine. 2024-10-30 09:41:46 +11:00
dump_mir.rs Dogfood feature(file_buffered) 2024-09-24 14:25:16 -07:00
early_otherwise_branch.rs Revert "Auto merge of #129047 - DianQK:early_otherwise_branch_scalar, r=cjgillot" 2024-09-24 08:44:26 +00:00
elaborate_box_derefs.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
elaborate_drops.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
errors.rs Validate and test -Zmir-enable-passes 2024-11-12 13:28:05 +00:00
ffi_unwind_calls.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
function_item_references.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
gvn.rs Mark simplify_aggregate_to_copy mir-opt as unsound 2024-10-31 13:48:06 +08:00
inline.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
instsimplify.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
jump_threading.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
known_panics_lint.rs compiler: rustc_abi::Abi => BackendRepr 2024-10-29 14:56:00 -07:00
large_enums.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
lib.rs Store known passes as an IndexSet 2024-11-12 13:28:05 +00:00
lint.rs Remove Analysis::into_engine. 2024-10-30 09:41:46 +11:00
lower_intrinsics.rs Improve consistency in LowerIntrinsics. 2024-09-09 15:15:44 +10:00
lower_slice_len.rs Inline and remove some functions. 2024-09-10 08:54:17 +10:00
match_branches.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
mentioned_items.rs be even more precise about "cast" vs "coercion" 2024-09-24 23:12:02 +02:00
multiple_return_terminators.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
nrvo.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
pass_manager.rs Rename PASS_NAMES to disambiguate 2024-11-12 13:28:05 +00:00
post_drop_elaboration.rs Make check_live_drops into a MirLint. 2024-09-10 09:11:17 +10:00
prettify.rs Improve comment formatting. 2024-09-10 08:42:30 +10:00
promote_consts.rs tcx.is_const_fn doesn't work the way it is described, remove it 2024-10-25 20:52:39 +02:00
ref_prop.rs Remove Analysis::into_engine. 2024-10-30 09:41:46 +11:00
remove_noop_landing_pads.rs Inline and remove some functions. 2024-09-10 08:54:17 +10:00
remove_place_mention.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
remove_storage_markers.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
remove_uninit_drops.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
remove_unneeded_drops.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
remove_zsts.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
required_consts.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
reveal_all.rs Improve comment formatting. 2024-09-10 08:42:30 +10:00
sanity_check.rs Move MirPass to rustc_mir_transform. 2024-09-03 16:03:46 +10:00
shim.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
simplify.rs Inline and remove some functions. 2024-09-10 08:54:17 +10:00
simplify_branches.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
simplify_comparison_integral.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
single_use_consts.rs cleanup: don't clone types that are Copy 2024-09-29 13:31:30 +02:00
sroa.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
ssa.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
unreachable_enum_branching.rs compiler: Add is_uninhabited and use LayoutS accessors 2024-10-28 09:58:30 -07:00
unreachable_prop.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
validate.rs compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00