rust/compiler/rustc_mir_transform/src
bors 7e4077d06f Auto merge of #135274 - saethlin:array-repeats, r=compiler-errors
Add an InstSimplify for repetitive array expressions

I noticed in https://github.com/rust-lang/rust/pull/135068#issuecomment-2569955426 that GVN's implementation of this same transform was quite profitable on the deep-vector benchmark. But of course GVN doesn't run in unoptimized builds, so this is my attempt to write a version of this transform that benefits the deep-vector case and is fast enough to run in InstSimplify.

The benchmark suite indicates that this is effective.
2025-01-11 06:33:55 +00:00
..
coroutine Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
coverage remove more redundant into() conversions 2025-01-10 07:08:28 +01:00
inline use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
shim mir: require is_cleanup when creating BasicBlockData 2024-12-18 20:43:54 +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 use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01: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 move fn is_item_raw to TypingEnv 2024-11-19 18:06:20 +01: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 use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01: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 move fn is_item_raw to TypingEnv 2024-11-19 18:06:20 +01:00
coroutine.rs remove unused function params 2025-01-03 13:30:26 +01:00
cost_checker.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
cross_crate_inline.rs mir_transform: implement forced inlining 2025-01-10 18:37:54 +00:00
ctfe_limit.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
dataflow_const_prop.rs Auto merge of #134625 - compiler-errors:unsafe-binders-ty, r=oli-obk 2024-12-24 00:51:51 +00:00
dead_store_elimination.rs reduce false positives of tail-expr-drop-order from consumed values 2024-11-20 20:53:11 +08:00
deduce_param_attrs.rs move fn is_item_raw to TypingEnv 2024-11-19 18:06:20 +01: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 Delete Rvalue::Len 2024-12-22 06:12:39 -08:00
dump_mir.rs Dogfood feature(file_buffered) 2024-09-24 14:25:16 -07:00
early_otherwise_branch.rs mir-opt: Do not handle the cleanup BB in the EarlyOtherwiseBranch 2024-12-18 20:43:55 +08:00
elaborate_box_derefs.rs Transmute from NonNull to pointer when elaborating a box deref (MCP807) 2025-01-06 18:43:40 -08:00
elaborate_drops.rs Improve terminology in elaborate_drops.rs. 2024-12-10 12:06:03 +11:00
errors.rs mir_transform: implement forced inlining 2025-01-10 18:37:54 +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 Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
gvn.rs Make the aggregate-then-transmute handling more general 2025-01-08 18:46:31 -08:00
inline.rs mir_build: check annotated functions w/out callers 2025-01-10 18:37:57 +00:00
instsimplify.rs Auto merge of #135274 - saethlin:array-repeats, r=compiler-errors 2025-01-11 06:33:55 +00:00
jump_threading.rs Variants::Single: do not use invalid VariantIdx for uninhabited enums 2024-12-18 11:00:21 +01:00
known_panics_lint.rs Delete Rvalue::Len 2024-12-22 06:12:39 -08:00
large_enums.rs make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00
lib.rs mir_transform: implement forced inlining 2025-01-10 18:37:54 +00:00
lint_tail_expr_drop_order.rs remove more redundant into() conversions 2025-01-10 07:08:28 +01:00
lint.rs Move always_storage_live_locals. 2024-11-26 12:05:57 +11:00
lower_intrinsics.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
lower_slice_len.rs Inline and remove some functions. 2024-09-10 08:54:17 +10:00
match_branches.rs MatchBranchSimplification: Consider empty-unreachable otherwise branch 2024-12-27 10:57:46 +00:00
mentioned_items.rs be even more precise about "cast" vs "coercion" 2024-09-24 23:12:02 +02:00
multiple_return_terminators.rs Remove -Zfuel. 2024-11-26 10:45:21 +00:00
nrvo.rs Remove -Zfuel. 2024-11-26 10:45:21 +00:00
pass_manager.rs mir_transform: implement forced inlining 2025-01-10 18:37:54 +00:00
post_analysis_normalize.rs rebase 2024-11-23 13:52:57 +01: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 Delete Rvalue::Len 2024-12-22 06:12:39 -08:00
ref_prop.rs Move always_storage_live_locals. 2024-11-26 12:05:57 +11:00
remove_noop_landing_pads.rs reduce false positives of tail-expr-drop-order from consumed values 2024-11-20 20:53:11 +08: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 Change ChunkedBitSet<MovePathIndex>s to MixedBitSet. 2024-12-05 20:07:26 +11:00
remove_unneeded_drops.rs Remove -Zfuel. 2024-11-26 10:45:21 +00:00
remove_zsts.rs Remove -Zfuel. 2024-11-26 10:45:21 +00:00
required_consts.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
sanity_check.rs Move MirPass to rustc_mir_transform. 2024-09-03 16:03:46 +10:00
shim.rs inline: force inlining shims 2025-01-10 18:37:55 +00:00
simplify_branches.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
simplify_comparison_integral.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
simplify.rs reduce false positives of tail-expr-drop-order from consumed values 2024-11-20 20:53:11 +08:00
single_use_consts.rs cleanup: don't clone types that are Copy 2024-09-29 13:31:30 +02:00
sroa.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
ssa.rs move fn is_item_raw to TypingEnv 2024-11-19 18:06:20 +01:00
strip_debuginfo.rs We don't need NonNull::as_ptr debuginfo 2024-12-10 01:29:43 -08:00
unreachable_enum_branching.rs make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00
unreachable_prop.rs Remove -Zfuel. 2024-11-26 10:45:21 +00:00
validate.rs validator: move force inline check 2025-01-10 18:37:56 +00:00