rust/tests/mir-opt/pre-codegen
bors 9aa232ecc7 Auto merge of #120405 - cjgillot:gvn-pointer, r=oli-obk
Fold pointer operations in GVN

This PR proposes 2 combinations of cast operations in MIR GVN:
- a chain of `PtrToPtr` or `MutToConstPointer` casts can be folded together into a single `PtrToPtr` cast;
- we attempt to evaluate more ptr ops when there is no provenance.

In particular, this allows to read from static slices.

This is not yet sufficient to see through slice operations that use `PtrComponents` (because that's a union), but still a step forward.

r? `@ghost`
2024-02-11 04:24:40 +00:00
..
chained_comparison.bitand.PreCodegen.after.mir
chained_comparison.naive.PreCodegen.after.mir
chained_comparison.returning.PreCodegen.after.mir
chained_comparison.rs
checked_ops.checked_shl.PreCodegen.after.mir
checked_ops.rs
checked_ops.step_forward.PreCodegen.after.mir Enable by default. 2024-02-09 21:13:51 +00:00
duplicate_switch_targets.rs
duplicate_switch_targets.ub_if_b.PreCodegen.after.mir Bless/fix tests 2024-02-08 19:56:30 -05:00
intrinsics.f_u64.PreCodegen.after.mir
intrinsics.f_unit.PreCodegen.after.mir
intrinsics.rs
issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff Fold consecutive PtrToPtr casts. 2024-02-09 21:01:56 +00:00
issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff Fold consecutive PtrToPtr casts. 2024-02-09 21:01:56 +00:00
issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff Fold consecutive PtrToPtr casts. 2024-02-09 21:01:56 +00:00
issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff Fold consecutive PtrToPtr casts. 2024-02-09 21:01:56 +00:00
issue_117368_print_invalid_constant.rs
loops.filter_mapped.PreCodegen.after.mir
loops.int_range.PreCodegen.after.mir Enable by default. 2024-02-09 21:13:51 +00:00
loops.mapped.PreCodegen.after.mir
loops.rs
loops.vec_move.PreCodegen.after.mir
matches_macro.issue_77355_opt.PreCodegen.after.mir Remove ConstGoto and SeparateConstSwitch. 2024-02-09 21:13:53 +00:00
matches_macro.rs Remove ConstGoto and SeparateConstSwitch. 2024-02-09 21:13:53 +00:00
mem_replace.manual_replace.PreCodegen.after.panic-abort.mir Bless/fix tests 2024-02-08 19:56:30 -05:00
mem_replace.manual_replace.PreCodegen.after.panic-unwind.mir Bless/fix tests 2024-02-08 19:56:30 -05:00
mem_replace.mem_replace.PreCodegen.after.panic-abort.mir Bless/fix tests 2024-02-08 19:56:30 -05:00
mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir Bless/fix tests 2024-02-08 19:56:30 -05:00
mem_replace.rs Bless/fix tests 2024-02-08 19:56:30 -05:00
optimizes_into_variable.main.GVN.32bit.panic-abort.diff
optimizes_into_variable.main.GVN.32bit.panic-unwind.diff
optimizes_into_variable.main.GVN.64bit.panic-abort.diff
optimizes_into_variable.main.GVN.64bit.panic-unwind.diff
optimizes_into_variable.main.PreCodegen.after.32bit.panic-abort.mir
optimizes_into_variable.main.PreCodegen.after.32bit.panic-unwind.mir
optimizes_into_variable.main.PreCodegen.after.64bit.panic-abort.mir
optimizes_into_variable.main.PreCodegen.after.64bit.panic-unwind.mir
optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff
optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff
optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff
optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff
optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-abort.mir
optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-unwind.mir
optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-abort.mir
optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-unwind.mir
optimizes_into_variable.rs
range_iter.forward_loop.PreCodegen.after.panic-abort.mir Enable by default. 2024-02-09 21:13:51 +00:00
range_iter.forward_loop.PreCodegen.after.panic-unwind.mir Enable by default. 2024-02-09 21:13:51 +00:00
range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir
range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir
range_iter.range_inclusive_iter_next.PreCodegen.after.panic-abort.mir
range_iter.range_inclusive_iter_next.PreCodegen.after.panic-unwind.mir
range_iter.range_iter_next.PreCodegen.after.panic-abort.mir
range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir
range_iter.rs
README.md
simple_option_map.ezmap.PreCodegen.after.mir
simple_option_map.rs
slice_filter.rs
slice_filter.variant_a-{closure#0}.PreCodegen.after.mir
slice_filter.variant_b-{closure#0}.PreCodegen.after.mir
slice_index.rs
slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir
slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir
slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir Fold consecutive PtrToPtr casts. 2024-02-09 21:01:56 +00:00
slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir Fold consecutive PtrToPtr casts. 2024-02-09 21:01:56 +00:00
slice_index.slice_index_range.PreCodegen.after.panic-abort.mir
slice_index.slice_index_range.PreCodegen.after.panic-unwind.mir
slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir
slice_index.slice_index_usize.PreCodegen.after.panic-unwind.mir
slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir Fold consecutive PtrToPtr casts. 2024-02-09 21:01:56 +00:00
slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir Fold consecutive PtrToPtr casts. 2024-02-09 21:01:56 +00:00
slice_iter.forward_loop.PreCodegen.after.panic-abort.mir Fold consecutive PtrToPtr casts. 2024-02-09 21:01:56 +00:00
slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir Fold consecutive PtrToPtr casts. 2024-02-09 21:01:56 +00:00
slice_iter.range_loop.PreCodegen.after.panic-abort.mir Enable by default. 2024-02-09 21:13:51 +00:00
slice_iter.range_loop.PreCodegen.after.panic-unwind.mir Enable by default. 2024-02-09 21:13:51 +00:00
slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir Fold consecutive PtrToPtr casts. 2024-02-09 21:01:56 +00:00
slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir Fold consecutive PtrToPtr casts. 2024-02-09 21:01:56 +00:00
slice_iter.rs
slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-abort.mir
slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-unwind.mir
slice_iter.slice_iter_next.PreCodegen.after.panic-abort.mir
slice_iter.slice_iter_next.PreCodegen.after.panic-unwind.mir
spans.outer.PreCodegen.after.panic-abort.mir
spans.outer.PreCodegen.after.panic-unwind.mir
spans.rs
try_identity.new.PreCodegen.after.mir Enable by default. 2024-02-09 21:13:51 +00:00
try_identity.old.PreCodegen.after.mir
try_identity.rs

The goal of this directory is to track the quality of MIR that is given to codegen in a standard -O condiguration.

As such, feel free to --bless whatever changes you get here, so long as doing so doesn't add substantially more MIR.