rust/src/test/mir-opt
bors cca80b9a81 Auto merge of #103957 - JakobDegen:drop-retag, r=RalfJung
Retag as FnEntry on `drop_in_place`

This commit changes the mir drop shim to always retag its argument as if it were a `&mut`.

cc rust-lang/unsafe-code-guidelines#373
2022-12-22 17:48:43 +00:00
..
building Clarify that raw retags are not permitted in Mir 2022-12-21 10:32:01 -08:00
const_prop Disable NormalizeArrayLen 2022-12-19 17:38:18 -08:00
dataflow-const-prop Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
dead-store-elimination Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
deref-patterns Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
dest-prop Remove dead code after destination propagation 2022-12-16 00:00:00 +00:00
inline Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
issues Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
nll Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
76803_regression.encode.SimplifyBranchSame.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
76803_regression.rs
address_of.address_of_reborrow.SimplifyCfg-initial.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
address_of.borrow_and_cast.SimplifyCfg-initial.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
address_of.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
array_index_is_temporary.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir bless mir opt tests 2022-07-28 14:24:44 +02:00
asm_unwind_panic_abort.rs Update the minimum external LLVM to 13 2022-08-14 13:46:51 -07:00
basic_assignment.main.SimplifyCfg-initial.after.mir bless mir opt tests 2022-07-28 14:24:44 +02:00
basic_assignment.rs
bool_compare.opt1.InstCombine.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
bool_compare.opt2.InstCombine.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
bool_compare.opt3.InstCombine.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
bool_compare.opt4.InstCombine.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
bool_compare.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
box_expr.main.ElaborateDrops.before.mir bless mir opt tests 2022-07-28 14:24:44 +02:00
box_expr.rs
byte_slice.main.SimplifyCfg-elaborate-drops.after.mir bless mir opt tests 2022-07-28 14:24:44 +02:00
byte_slice.rs
combine_array_len.norm2.InstCombine.diff Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
combine_array_len.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff address review 2022-09-26 14:21:39 +02:00
combine_clone_of_primitives.rs
const_allocation2.main.ConstProp.after.32bit.mir bless mir opt tests 2022-07-28 14:24:44 +02:00
const_allocation2.main.ConstProp.after.64bit.mir bless mir opt tests 2022-07-28 14:24:44 +02:00
const_allocation2.rs
const_allocation3.main.ConstProp.after.32bit.mir bless mir opt tests 2022-07-28 14:24:44 +02:00
const_allocation3.main.ConstProp.after.64bit.mir bless mir opt tests 2022-07-28 14:24:44 +02:00
const_allocation3.rs
const_allocation.main.ConstProp.after.32bit.mir bless mir opt tests 2022-07-28 14:24:44 +02:00
const_allocation.main.ConstProp.after.64bit.mir bless mir opt tests 2022-07-28 14:24:44 +02:00
const_allocation.rs
const_debuginfo.main.ConstDebugInfo.diff Flatten aggregates into locals. 2022-11-15 17:55:11 +00:00
const_debuginfo.rs
const_goto_const_eval_fail.f.ConstGoto.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
const_goto_const_eval_fail.rs
const_goto_storage.match_nested_if.ConstGoto.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
const_goto_storage.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
const_goto.issue_77355_opt.ConstGoto.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
const_goto.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
const_promotion_extern_static.BAR.PromoteTemps.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
const_promotion_extern_static.BOP.built.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
const_promotion_extern_static.FOO.PromoteTemps.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
const_promotion_extern_static.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
const_prop_miscompile.bar.ConstProp.diff bless mir opt tests 2022-07-28 14:24:44 +02:00
const_prop_miscompile.foo.ConstProp.diff bless mir opt tests 2022-07-28 14:24:44 +02:00
const_prop_miscompile.rs
coverage_graphviz.bar.InstrumentCoverage.0.dot Bless graphviz tests 2022-11-14 15:11:30 +01:00
coverage_graphviz.main.InstrumentCoverage.0.dot Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
coverage_graphviz.rs
deaggregator_test_enum_2.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
deaggregator_test_enum_2.test1.Deaggregator.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
deaggregator_test_enum.bar.Deaggregator.diff bless mir opt tests 2022-07-28 14:24:44 +02:00
deaggregator_test_enum.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
deaggregator_test_multiple.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
deaggregator_test_multiple.test.Deaggregator.diff bless mir opt tests 2022-07-28 14:24:44 +02:00
deaggregator_test.bar.Deaggregator.diff bless mir opt tests 2022-07-28 14:24:44 +02:00
deaggregator_test.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
deduplicate_blocks.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
derefer_complex_case.main.Derefer.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
derefer_complex_case.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
derefer_inline_test.main.Derefer.diff Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
derefer_inline_test.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
derefer_terminator_test.main.Derefer.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
derefer_terminator_test.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
derefer_test_multiple.main.Derefer.diff ./x.py test --bless 2022-08-23 00:00:00 +00:00
derefer_test_multiple.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
derefer_test.main.Derefer.diff ./x.py test --bless 2022-08-23 00:00:00 +00:00
derefer_test.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
early_otherwise_branch_3_element_tuple.rs
early_otherwise_branch_68867.rs Simplify MIR opt tests 2022-09-01 23:01:53 -07:00
early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
early_otherwise_branch_noopt.rs
early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
early_otherwise_branch_soundness.rs
early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
early_otherwise_branch.rs
equal_true.opt.InstCombine.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
equal_true.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
exponential_or.match_tuple.SimplifyCfg-initial.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
exponential_or.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
fn_ptr_shim.core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir bless mir opt tests 2022-07-28 14:24:44 +02:00
fn_ptr_shim.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
funky_arms.float_to_exponential_common.ConstProp.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
funky_arms.rs
generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
generator_drop_cleanup.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
generator_storage_dead_unwind.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
generator_tiny.main-{closure#0}.generator_resume.0.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
generator_tiny.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
graphviz.main.built.after.dot Replace mir_map.0 dump with built phase change dump 2022-10-27 00:21:57 -07:00
graphviz.rs Replace mir_map.0 dump with built phase change dump 2022-10-27 00:21:57 -07:00
if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
if_condition_int.opt_char.SimplifyComparisonIntegral.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
if_condition_int.opt_i8.SimplifyComparisonIntegral.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
if_condition_int.opt_negative.SimplifyComparisonIntegral.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
if_condition_int.opt_u32.SimplifyComparisonIntegral.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
if_condition_int.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
instrument_coverage.bar.InstrumentCoverage.diff Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
instrument_coverage.main.InstrumentCoverage.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
instrument_coverage.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
issue_38669.main.SimplifyCfg-initial.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
issue_38669.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_41110.main.ElaborateDrops.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
issue_41110.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_41110.test.ElaborateDrops.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_41697.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_41888.main.ElaborateDrops.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
issue_41888.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_62289.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_62289.test.ElaborateDrops.before.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
issue_72181_1.f.built.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_72181_1.main.built.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_72181_1.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_72181.bar.built.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_72181.foo.built.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_72181.main.built.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_72181.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_73223.main.SimplifyArmIdentity.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
issue_73223.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_76432.rs
issue_76432.test.SimplifyComparisonIntegral.diff Disable NormalizeArrayLen 2022-12-19 17:38:18 -08:00
issue_78192.f.InstCombine.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_78192.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_91633.bar.built.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_91633.foo.built.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_91633.fun.built.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_91633.hey.built.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_91633.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_99325.main.built.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
issue_99325.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
issue_101973.inner.ConstProp.diff Rewrite dest prop. 2022-11-26 18:04:54 -08:00
issue_101973.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
loop_test.main.SimplifyCfg-promote-consts.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
loop_test.rs
lower_array_len_e2e.array_bound_mut.PreCodegen.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
lower_array_len_e2e.array_bound.PreCodegen.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
lower_array_len_e2e.array_len_by_value.PreCodegen.after.mir Simplify MIR opt tests 2022-09-01 23:01:53 -07:00
lower_array_len_e2e.array_len.PreCodegen.after.mir Simplify MIR opt tests 2022-09-01 23:01:53 -07:00
lower_array_len_e2e.rs Disable NormalizeArrayLen 2022-12-19 17:38:18 -08:00
lower_array_len.array_bound_mut.NormalizeArrayLen.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
lower_array_len.array_bound.NormalizeArrayLen.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
lower_array_len.array_len_by_value.NormalizeArrayLen.diff bless mir opt tests 2022-07-28 14:24:44 +02:00
lower_array_len.array_len.NormalizeArrayLen.diff bless mir opt tests 2022-07-28 14:24:44 +02:00
lower_array_len.rs Simplify MIR opt tests 2022-09-01 23:01:53 -07:00
lower_intrinsics_e2e.f_u64.PreCodegen.after.mir Rebase onto master 2022-11-07 10:35:13 +01:00
lower_intrinsics_e2e.f_unit.PreCodegen.after.mir Rewrite dest prop. 2022-11-26 18:04:54 -08:00
lower_intrinsics_e2e.rs Simplify MIR opt tests 2022-09-01 23:01:53 -07:00
lower_intrinsics.align_of.LowerIntrinsics.diff Simplify MIR opt tests 2022-09-01 23:01:53 -07:00
lower_intrinsics.assume.LowerIntrinsics.diff Test bump 2022-09-06 14:59:46 +00:00
lower_intrinsics.discriminant.LowerIntrinsics.diff address review 2022-09-26 14:21:39 +02:00
lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff Remove mir::CastKind::Misc 2022-10-06 15:32:41 +03:00
lower_intrinsics.forget.LowerIntrinsics.diff Simplify MIR opt tests 2022-09-01 23:01:53 -07:00
lower_intrinsics.non_const.LowerIntrinsics.diff Simplify MIR opt tests 2022-09-01 23:01:53 -07:00
lower_intrinsics.rs Lower the assume intrinsic to a MIR statement 2022-09-06 14:18:32 +00:00
lower_intrinsics.size_of.LowerIntrinsics.diff Simplify MIR opt tests 2022-09-01 23:01:53 -07:00
lower_intrinsics.unreachable.LowerIntrinsics.diff Simplify MIR opt tests 2022-09-01 23:01:53 -07:00
lower_intrinsics.wrapping.LowerIntrinsics.diff Simplify MIR opt tests 2022-09-01 23:01:53 -07:00
lower_slice_len.bound.LowerSliceLenCalls.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
lower_slice_len.rs
match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
match_arm_scopes.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
match_test.main.SimplifyCfg-initial.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
match_test.rs
matches_reduce_branches.bar.MatchBranchSimplification.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
matches_reduce_branches.foo.MatchBranchSimplification.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
matches_reduce_branches.rs Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTH 2022-09-04 23:25:25 -07:00
matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
matches_u8.exhaustive_match.MatchBranchSimplification.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
matches_u8.rs Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTH 2022-09-04 23:25:25 -07:00
multiple_return_terminators.rs
multiple_return_terminators.test.MultipleReturnTerminators.diff bless mir opt tests 2022-07-28 14:24:44 +02:00
no_drop_for_inactive_variant.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
no_spurious_drop_after_call.main.ElaborateDrops.before.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
no_spurious_drop_after_call.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
not_equal_false.opt.InstCombine.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
not_equal_false.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
nrvo_simple.nrvo.RenameReturnPlace.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
nrvo_simple.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
packed_struct_drop_aligned.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
README.md Mention unit-test in MIR opt test README 2022-08-09 09:58:46 -07:00
remove_fake_borrows.match_guard.CleanupPostBorrowck.diff ./x.py test --bless 2022-12-17 19:34:45 +01:00
remove_fake_borrows.rs Rename CleanupNonCodegenStatements to CleanupPostBorrowck 2022-12-17 19:34:45 +01:00
remove_never_const.no_codegen.PreCodegen.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
remove_never_const.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
remove_storage_markers.main.RemoveStorageMarkers.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
remove_storage_markers.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff bless mir opt tests 2022-07-28 14:24:44 +02:00
remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff bless mir opt tests 2022-07-28 14:24:44 +02:00
remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff Avoid invalidating the CFG in MirPatch. 2022-08-02 18:57:54 -07:00
remove_unneeded_drops.opt.RemoveUnneededDrops.diff Avoid invalidating the CFG in MirPatch. 2022-08-02 18:57:54 -07:00
remove_unneeded_drops.rs
remove_zsts.get_union.PreCodegen.after.mir Re-enable removal of ZST writes to unions 2022-12-03 19:17:45 -05:00
remove_zsts.get_union.RemoveZsts.diff Re-enable removal of ZST writes to unions 2022-12-03 19:17:45 -05:00
remove_zsts.rs Re-enable removal of ZST writes to unions 2022-12-03 19:17:45 -05:00
retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir Use the declaration's SourceInfo for FnEntry retags, not the outermost 2022-08-28 11:40:10 -04:00
retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir make retagging work even with 'unstable' places 2022-12-06 10:33:34 +01:00
retag.array_casts.SimplifyCfg-elaborate-drops.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir Retag as FnEntry on drop_in_place 2022-12-21 14:59:55 -08:00
retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir make retagging work even with 'unstable' places 2022-12-06 10:33:34 +01:00
retag.main.SimplifyCfg-elaborate-drops.after.mir make retagging work even with 'unstable' places 2022-12-06 10:33:34 +01:00
retag.rs Add more // unit-tests to MIR opt tests 2022-08-09 17:32:50 -07:00
return_an_array.rs
separate_const_switch.identity.SeparateConstSwitch.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
separate_const_switch.rs Simplify MIR opt tests 2022-09-01 23:01:53 -07:00
separate_const_switch.too_complex.SeparateConstSwitch.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
simplify_arm_identity.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_arm.id_try.SimplifyArmIdentity.diff bless mir-opt tests 2022-08-22 15:19:40 +02:00
simplify_arm.id_try.SimplifyBranchSame.diff bless mir-opt tests 2022-08-22 15:19:40 +02:00
simplify_arm.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_cfg.main.SimplifyCfg-early-opt.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
simplify_cfg.main.SimplifyCfg-initial.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
simplify_cfg.rs
simplify_if.main.SimplifyConstCondition-after-const-prop.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
simplify_if.rs
simplify_locals_fixedpoint.foo.SimplifyLocals.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
simplify_locals_fixedpoint.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_locals_removes_unused_consts.main.SimplifyLocals.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_locals_removes_unused_consts.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
simplify_locals_removes_unused_discriminant_reads.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_locals.c.SimplifyLocals.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_locals.d1.SimplifyLocals.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_locals.d2.SimplifyLocals.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_locals.expose_addr.SimplifyLocals.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_locals.r.SimplifyLocals.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_locals.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_locals.t1.SimplifyLocals.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_locals.t2.SimplifyLocals.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_locals.t3.SimplifyLocals.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_locals.t4.SimplifyLocals.diff Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
simplify_match.main.ConstProp.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
simplify_match.rs
simplify_try_if_let.{impl#0}-append.SimplifyArmIdentity.diff
simplify_try_if_let.rs
slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
slice_drop_shim.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
spanview_block.main.built.after.html Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
spanview_block.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
spanview_statement.main.built.after.html Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
spanview_statement.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
spanview_terminator.main.built.after.html Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
spanview_terminator.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
sroa.dropping.ScalarReplacementOfAggregates.diff Mark test as panic=abort. 2022-11-15 18:06:45 +00:00
sroa.enums.ScalarReplacementOfAggregates.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
sroa.escaping.ScalarReplacementOfAggregates.diff Mark test as panic=abort. 2022-11-15 18:06:45 +00:00
sroa.flat.ScalarReplacementOfAggregates.diff Mark test as panic=abort. 2022-11-15 18:06:45 +00:00
sroa.rs Mark test as panic=abort. 2022-11-15 18:06:45 +00:00
sroa.structs.ScalarReplacementOfAggregates.diff Flatten aggregates into locals. 2022-11-15 17:55:11 +00:00
sroa.unions.ScalarReplacementOfAggregates.diff Flatten aggregates into locals. 2022-11-15 17:55:11 +00:00
storage_ranges.main.nll.0.mir Remove ReEmpty 2022-09-08 20:55:55 -04:00
storage_ranges.rs
tls_access.main.PreCodegen.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
tls_access.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
try_identity_e2e.new.PreCodegen.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
try_identity_e2e.old.PreCodegen.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
try_identity_e2e.rs Simplify MIR opt tests 2022-09-01 23:01:53 -07:00
uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
uninhabited_enum_branching2.rs
uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
uninhabited_enum_branching.main.UninhabitedEnumBranching.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
uninhabited_enum_branching.rs
uninhabited_enum.process_never.SimplifyLocals.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
uninhabited_enum.process_void.SimplifyLocals.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
uninhabited_enum.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
uninhabited_fallthrough_elimination.rs
unreachable_diverging.main.UnreachablePropagation.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
unreachable_diverging.rs
unreachable.main.UnreachablePropagation.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
unreachable.rs
unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.built.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir address review 2022-09-26 14:21:39 +02:00
unusual_item_types.E-V-{constant#0}.built.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
unusual_item_types.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
unusual_item_types.Test-X-{constructor#0}.built.after.mir Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
while_let_loops.change_loop_body.ConstProp.diff Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
while_let_loops.change_loop_body.PreCodegen.after.mir Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTH 2022-09-04 23:25:25 -07:00
while_let_loops.rs Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTH 2022-09-04 23:25:25 -07:00
while_storage.rs Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
while_storage.while_loop.PreCodegen.after.mir Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00

This folder contains tests for MIR optimizations.

The mir-opt test format emits MIR to extra files that you can automatically update by specifying --bless on the command line (just like ui tests updating .stderr files).

--blessable test format

By default 32 bit and 64 bit targets use the same dump files, which can be problematic in the presence of pointers in constants or other bit width dependent things. In that case you can add

// EMIT_MIR_FOR_EACH_BIT_WIDTH

to your test, causing separate files to be generated for 32bit and 64bit systems.

Unit testing

If you are only testing the behavior of a particular mir-opt pass on some specific input (as is usually the case), you should add

// unit-test: PassName

to the top of the file. This makes sure that other passes don't run which means you'll get the input you expected and your test won't break when other code changes.

Emit a diff of the mir for a specific optimization

This is what you want most often when you want to see how an optimization changes the MIR.

// EMIT_MIR $file_name_of_some_mir_dump.diff

Emit mir after a specific optimization

Use this if you are just interested in the final state after an optimization.

// EMIT_MIR $file_name_of_some_mir_dump.after.mir

Emit mir before a specific optimization

This exists mainly for completeness and is rarely useful.

// EMIT_MIR $file_name_of_some_mir_dump.before.mir