diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/mir-opt | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/mir-opt/76803_regression.encode.SimplifyBranchSame.diff (renamed from src/test/mir-opt/76803_regression.encode.SimplifyBranchSame.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/76803_regression.rs (renamed from src/test/mir-opt/76803_regression.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/README.md (renamed from src/test/mir-opt/README.md) | 0 | ||||
-rw-r--r-- | tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir (renamed from src/test/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir (renamed from src/test/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/address_of.rs (renamed from src/test/mir-opt/address_of.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir (renamed from src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/array_index_is_temporary.rs (renamed from src/test/mir-opt/array_index_is_temporary.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir (renamed from src/test/mir-opt/asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/asm_unwind_panic_abort.rs (renamed from src/test/mir-opt/asm_unwind_panic_abort.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir (renamed from src/test/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/basic_assignment.rs (renamed from src/test/mir-opt/basic_assignment.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/bool_compare.opt1.InstCombine.diff (renamed from src/test/mir-opt/bool_compare.opt1.InstCombine.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/bool_compare.opt2.InstCombine.diff (renamed from src/test/mir-opt/bool_compare.opt2.InstCombine.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/bool_compare.opt3.InstCombine.diff (renamed from src/test/mir-opt/bool_compare.opt3.InstCombine.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/bool_compare.opt4.InstCombine.diff (renamed from src/test/mir-opt/bool_compare.opt4.InstCombine.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/bool_compare.rs (renamed from src/test/mir-opt/bool_compare.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/box_expr.main.ElaborateDrops.before.mir (renamed from src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/box_expr.rs (renamed from src/test/mir-opt/box_expr.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir | 41 | ||||
-rw-r--r-- | tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir | 337 | ||||
-rw-r--r-- | tests/mir-opt/building/async_await.rs | 17 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir (renamed from src/test/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/arbitrary_let.rs (renamed from src/test/mir-opt/building/custom/arbitrary_let.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/consts.consts.built.after.mir (renamed from src/test/mir-opt/building/custom/consts.consts.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/consts.rs (renamed from src/test/mir-opt/building/custom/consts.rs) | 4 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/consts.statics.built.after.mir (renamed from src/test/mir-opt/building/custom/consts.statics.built.after.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/enums.rs | 120 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/enums.set_discr.built.after.mir | 10 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir | 10 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/enums.switch_bool.built.after.mir | 19 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/enums.switch_option.built.after.mir | 21 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir | 21 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/projections.rs | 85 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/projections.set.built.after.mir | 10 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/projections.simple_index.built.after.mir | 13 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/projections.tuples.built.after.mir | 13 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/projections.unions.built.after.mir | 10 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/projections.unwrap.built.after.mir | 10 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir | 10 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/references.immut_ref.built.after.mir (renamed from src/test/mir-opt/building/custom/references.immut_ref.built.after.mir) | 7 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/references.mut_ref.built.after.mir (renamed from src/test/mir-opt/building/custom/references.mut_ref.built.after.mir) | 7 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/references.raw_pointer.built.after.mir | 10 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/references.rs | 55 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/simple_assign.rs (renamed from src/test/mir-opt/building/custom/simple_assign.rs) | 2 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/simple_assign.simple.built.after.mir | 20 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir (renamed from src/test/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir | 17 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/terminators.direct_call.built.after.mir | 16 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/terminators.drop_first.built.after.mir | 13 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/terminators.drop_second.built.after.mir | 13 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir | 13 | ||||
-rw-r--r-- | tests/mir-opt/building/custom/terminators.rs | 108 | ||||
-rw-r--r-- | tests/mir-opt/building/enum_cast.bar.built.after.mir (renamed from src/test/mir-opt/building/enum_cast.bar.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/enum_cast.boo.built.after.mir (renamed from src/test/mir-opt/building/enum_cast.boo.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/enum_cast.droppy.built.after.mir (renamed from src/test/mir-opt/building/enum_cast.droppy.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/enum_cast.foo.built.after.mir (renamed from src/test/mir-opt/building/enum_cast.foo.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/enum_cast.rs (renamed from src/test/mir-opt/building/enum_cast.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/issue_101867.main.built.after.mir (renamed from src/test/mir-opt/building/issue_101867.main.built.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/building/issue_101867.rs (renamed from src/test/mir-opt/building/issue_101867.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/issue_49232.main.built.after.mir (renamed from src/test/mir-opt/building/issue_49232.main.built.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/building/issue_49232.rs (renamed from src/test/mir-opt/building/issue_49232.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir (renamed from src/test/mir-opt/building/match_false_edges.full_tested_match.built.after.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir (renamed from src/test/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/building/match_false_edges.main.built.after.mir (renamed from src/test/mir-opt/building/match_false_edges.main.built.after.mir) | 8 | ||||
-rw-r--r-- | tests/mir-opt/building/match_false_edges.rs (renamed from src/test/mir-opt/building/match_false_edges.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir (renamed from src/test/mir-opt/building/receiver_ptr_mutability.main.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/receiver_ptr_mutability.rs (renamed from src/test/mir-opt/building/receiver_ptr_mutability.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/simple_match.match_bool.built.after.mir (renamed from src/test/mir-opt/building/simple_match.match_bool.built.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/building/simple_match.rs (renamed from src/test/mir-opt/building/simple_match.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir (renamed from src/test/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/storage_live_dead_in_statics.rs (renamed from src/test/mir-opt/building/storage_live_dead_in_statics.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir (renamed from src/test/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir (renamed from src/test/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/building/uniform_array_move_out.rs (renamed from src/test/mir-opt/building/uniform_array_move_out.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir (renamed from src/test/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/byte_slice.rs (renamed from src/test/mir-opt/byte_slice.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/combine_array_len.norm2.InstCombine.diff (renamed from src/test/mir-opt/combine_array_len.norm2.InstCombine.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/combine_array_len.rs (renamed from src/test/mir-opt/combine_array_len.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/combine_clone_of_primitives.rs (renamed from src/test/mir-opt/combine_clone_of_primitives.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff (renamed from src/test/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_allocation.main.ConstProp.after.32bit.mir (renamed from src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/const_allocation.main.ConstProp.after.64bit.mir (renamed from src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/const_allocation.rs (renamed from src/test/mir-opt/const_allocation.rs) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir (renamed from src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir (renamed from src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/const_allocation2.rs (renamed from src/test/mir-opt/const_allocation2.rs) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir (renamed from src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir (renamed from src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/const_allocation3.rs (renamed from src/test/mir-opt/const_allocation3.rs) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff | 126 | ||||
-rw-r--r-- | tests/mir-opt/const_debuginfo.rs (renamed from src/test/mir-opt/const_debuginfo.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff (renamed from src/test/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff) | 6 | ||||
-rw-r--r-- | tests/mir-opt/const_goto.rs (renamed from src/test/mir-opt/const_goto.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_goto_const_eval_fail.f.ConstGoto.diff (renamed from src/test/mir-opt/const_goto_const_eval_fail.f.ConstGoto.diff) | 6 | ||||
-rw-r--r-- | tests/mir-opt/const_goto_const_eval_fail.rs (renamed from src/test/mir-opt/const_goto_const_eval_fail.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff (renamed from src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff) | 10 | ||||
-rw-r--r-- | tests/mir-opt/const_goto_storage.rs (renamed from src/test/mir-opt/const_goto_storage.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir (renamed from src/test/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff (renamed from src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_promotion_extern_static.BOP.built.after.mir (renamed from src/test/mir-opt/const_promotion_extern_static.BOP.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir (renamed from src/test/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff (renamed from src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_promotion_extern_static.rs (renamed from src/test/mir-opt/const_promotion_extern_static.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/aggregate.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/aggregate.main.ConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir (renamed from src/test/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/aggregate.rs (renamed from src/test/mir-opt/const_prop/aggregate.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff (renamed from src/test/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff (renamed from src/test/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/array_index.rs (renamed from src/test/mir-opt/const_prop/array_index.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/bad_op_div_by_zero.rs (renamed from src/test/mir-opt/const_prop/bad_op_div_by_zero.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/bad_op_mod_by_zero.rs (renamed from src/test/mir-opt/const_prop/bad_op_mod_by_zero.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff | 54 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff | 54 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs (renamed from src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/boolean_identities.rs (renamed from src/test/mir-opt/const_prop/boolean_identities.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/boolean_identities.test.ConstProp.diff (renamed from src/test/mir-opt/const_prop/boolean_identities.test.ConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/boxes.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/boxes.main.ConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/boxes.rs (renamed from src/test/mir-opt/const_prop/boxes.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/cast.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/cast.main.ConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/cast.rs (renamed from src/test/mir-opt/const_prop/cast.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/checked_add.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/checked_add.main.ConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/checked_add.rs (renamed from src/test/mir-opt/const_prop/checked_add.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/const_prop_fails_gracefully.rs (renamed from src/test/mir-opt/const_prop/const_prop_fails_gracefully.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff (renamed from src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff) | 5 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir (renamed from src/test/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/control_flow_simplification.rs (renamed from src/test/mir-opt/const_prop/control_flow_simplification.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff (renamed from src/test/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff) | 6 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff (renamed from src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff) | 6 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/discriminant.rs (renamed from src/test/mir-opt/const_prop/discriminant.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/indirect.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/indirect.main.ConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/indirect.rs (renamed from src/test/mir-opt/const_prop/indirect.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/invalid_constant.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/invalid_constant.main.ConstProp.diff) | 19 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/invalid_constant.rs (renamed from src/test/mir-opt/const_prop/invalid_constant.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/issue_66971.main.ConstProp.diff | 27 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/issue_66971.rs (renamed from src/test/mir-opt/const_prop/issue_66971.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/issue_67019.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/issue_67019.main.ConstProp.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/issue_67019.rs (renamed from src/test/mir-opt/const_prop/issue_67019.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff (renamed from src/test/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff (renamed from src/test/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/large_array_index.rs (renamed from src/test/mir-opt/const_prop/large_array_index.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mult_by_zero.rs (renamed from src/test/mir-opt/const_prop/mult_by_zero.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mult_by_zero.test.ConstProp.diff (renamed from src/test/mir-opt/const_prop/mult_by_zero.test.ConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/mutable_variable.main.ConstProp.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mutable_variable.rs (renamed from src/test/mir-opt/const_prop/mutable_variable.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mutable_variable_aggregate.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/mutable_variable_aggregate.main.ConstProp.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mutable_variable_aggregate.rs (renamed from src/test/mir-opt/const_prop/mutable_variable_aggregate.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.ConstProp.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs (renamed from src/test/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs (renamed from src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff | 43 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mutable_variable_no_prop.rs (renamed from src/test/mir-opt/const_prop/mutable_variable_no_prop.rs) | 2 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff | 57 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs (renamed from src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.32bit.diff (renamed from src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.32bit.diff) | 19 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.64bit.diff (renamed from src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.64bit.diff) | 19 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/optimizes_into_variable.main.PreCodegen.after.32bit.mir (renamed from src/test/mir-opt/const_prop/optimizes_into_variable.main.PreCodegen.after.32bit.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/optimizes_into_variable.main.PreCodegen.after.64bit.mir (renamed from src/test/mir-opt/const_prop/optimizes_into_variable.main.PreCodegen.after.64bit.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.diff (renamed from src/test/mir-opt/const_prop/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.diff (renamed from src/test/mir-opt/const_prop/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.mir | 27 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.mir | 27 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/optimizes_into_variable.rs (renamed from src/test/mir-opt/const_prop/optimizes_into_variable.rs) | 2 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/read_immutable_static.rs (renamed from src/test/mir-opt/const_prop/read_immutable_static.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/ref_deref.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff (renamed from src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/ref_deref.rs | 7 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff (renamed from src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/ref_deref_project.rs | 7 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff | 24 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/reify_fn_ptr.rs (renamed from src/test/mir-opt/const_prop/reify_fn_ptr.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff (renamed from src/test/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff (renamed from src/test/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/repeat.rs (renamed from src/test/mir-opt/const_prop/repeat.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/return_place.add.ConstProp.diff (renamed from src/test/mir-opt/const_prop/return_place.add.ConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/return_place.add.PreCodegen.before.mir (renamed from src/test/mir-opt/const_prop/return_place.add.PreCodegen.before.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/return_place.rs (renamed from src/test/mir-opt/const_prop/return_place.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/scalar_literal_propagation.rs (renamed from src/test/mir-opt/const_prop/scalar_literal_propagation.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff (renamed from src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff) | 9 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff (renamed from src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff) | 9 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/slice_len.rs | 7 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/switch_int.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/switch_int.main.ConstProp.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.diff (renamed from src/test/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/switch_int.rs (renamed from src/test/mir-opt/const_prop/switch_int.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff (renamed from src/test/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop/tuple_literal_propagation.rs (renamed from src/test/mir-opt/const_prop/tuple_literal_propagation.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/const_prop_miscompile.bar.ConstProp.diff | 37 | ||||
-rw-r--r-- | tests/mir-opt/const_prop_miscompile.foo.ConstProp.diff (renamed from src/test/mir-opt/const_prop_miscompile.foo.ConstProp.diff) | 1 | ||||
-rw-r--r-- | tests/mir-opt/const_prop_miscompile.rs (renamed from src/test/mir-opt/const_prop_miscompile.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/coverage_graphviz.bar.InstrumentCoverage.0.dot (renamed from src/test/mir-opt/coverage_graphviz.bar.InstrumentCoverage.0.dot) | 0 | ||||
-rw-r--r-- | tests/mir-opt/coverage_graphviz.main.InstrumentCoverage.0.dot (renamed from src/test/mir-opt/coverage_graphviz.main.InstrumentCoverage.0.dot) | 2 | ||||
-rw-r--r-- | tests/mir-opt/coverage_graphviz.rs (renamed from src/test/mir-opt/coverage_graphviz.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/cast.rs (renamed from src/test/mir-opt/dataflow-const-prop/cast.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/checked.rs (renamed from src/test/mir-opt/dataflow-const-prop/checked.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/enum.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/enum.main.DataflowConstProp.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/enum.rs (renamed from src/test/mir-opt/dataflow-const-prop/enum.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff) | 8 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/if.rs (renamed from src/test/mir-opt/dataflow-const-prop/if.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff | 39 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/inherit_overflow.rs (renamed from src/test/mir-opt/dataflow-const-prop/inherit_overflow.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/issue_81605.rs (renamed from src/test/mir-opt/dataflow-const-prop/issue_81605.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/ref_without_sb.rs (renamed from src/test/mir-opt/dataflow-const-prop/ref_without_sb.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/repr_transparent.rs (renamed from src/test/mir-opt/dataflow-const-prop/repr_transparent.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/self_assign.rs (renamed from src/test/mir-opt/dataflow-const-prop/self_assign.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/self_assign_add.rs (renamed from src/test/mir-opt/dataflow-const-prop/self_assign_add.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/sibling_ptr.rs (renamed from src/test/mir-opt/dataflow-const-prop/sibling_ptr.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/struct.rs (renamed from src/test/mir-opt/dataflow-const-prop/struct.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/terminator.rs (renamed from src/test/mir-opt/dataflow-const-prop/terminator.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/tuple.rs (renamed from src/test/mir-opt/dataflow-const-prop/tuple.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff (renamed from src/test/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff) | 12 | ||||
-rw-r--r-- | tests/mir-opt/dead-store-elimination/cycle.rs (renamed from src/test/mir-opt/dead-store-elimination/cycle.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination.diff (renamed from src/test/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff (renamed from src/test/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dead-store-elimination/provenance_soundness.rs (renamed from src/test/mir-opt/dead-store-elimination/provenance_soundness.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/deaggregator_test.bar.Deaggregator.diff (renamed from src/test/mir-opt/deaggregator_test.bar.Deaggregator.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/deaggregator_test.rs (renamed from src/test/mir-opt/deaggregator_test.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/deaggregator_test_enum.bar.Deaggregator.diff (renamed from src/test/mir-opt/deaggregator_test_enum.bar.Deaggregator.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/deaggregator_test_enum.rs (renamed from src/test/mir-opt/deaggregator_test_enum.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/deaggregator_test_enum_2.rs (renamed from src/test/mir-opt/deaggregator_test_enum_2.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff (renamed from src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/deaggregator_test_multiple.rs (renamed from src/test/mir-opt/deaggregator_test_multiple.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/deaggregator_test_multiple.test.Deaggregator.diff (renamed from src/test/mir-opt/deaggregator_test_multiple.test.Deaggregator.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff (renamed from src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff) | 22 | ||||
-rw-r--r-- | tests/mir-opt/deduplicate_blocks.rs (renamed from src/test/mir-opt/deduplicate_blocks.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir (renamed from src/test/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir) | 6 | ||||
-rw-r--r-- | tests/mir-opt/deref-patterns/string.rs (renamed from src/test/mir-opt/deref-patterns/string.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/derefer_complex_case.main.Derefer.diff (renamed from src/test/mir-opt/derefer_complex_case.main.Derefer.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/derefer_complex_case.rs (renamed from src/test/mir-opt/derefer_complex_case.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/derefer_inline_test.main.Derefer.diff (renamed from src/test/mir-opt/derefer_inline_test.main.Derefer.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/derefer_inline_test.rs (renamed from src/test/mir-opt/derefer_inline_test.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/derefer_terminator_test.main.Derefer.diff (renamed from src/test/mir-opt/derefer_terminator_test.main.Derefer.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/derefer_terminator_test.rs (renamed from src/test/mir-opt/derefer_terminator_test.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/derefer_test.main.Derefer.diff (renamed from src/test/mir-opt/derefer_test.main.Derefer.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/derefer_test.rs (renamed from src/test/mir-opt/derefer_test.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/derefer_test_multiple.main.Derefer.diff (renamed from src/test/mir-opt/derefer_test_multiple.main.Derefer.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/derefer_test_multiple.rs (renamed from src/test/mir-opt/derefer_test_multiple.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff (renamed from src/test/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/branch.rs (renamed from src/test/mir-opt/dest-prop/branch.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.diff (renamed from src/test/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff (renamed from src/test/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.diff (renamed from src/test/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.diff (renamed from src/test/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/copy_propagation_arg.rs (renamed from src/test/mir-opt/dest-prop/copy_propagation_arg.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff (renamed from src/test/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/cycle.rs (renamed from src/test/mir-opt/dest-prop/cycle.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.mir (renamed from src/test/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/dead_stores_79191.rs (renamed from src/test/mir-opt/dest-prop/dead_stores_79191.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.mir (renamed from src/test/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.mir) | 1 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/dead_stores_better.rs (renamed from src/test/mir-opt/dest-prop/dead_stores_better.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff (renamed from src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/simple.rs (renamed from src/test/mir-opt/dest-prop/simple.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/union.main.DestinationPropagation.diff (renamed from src/test/mir-opt/dest-prop/union.main.DestinationPropagation.diff) | 3 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/union.rs (renamed from src/test/mir-opt/dest-prop/union.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.diff | 86 | ||||
-rw-r--r-- | tests/mir-opt/dest-prop/unreachable.rs | 18 | ||||
-rw-r--r-- | tests/mir-opt/div_overflow.const_dividend.PreCodegen.after.mir | 17 | ||||
-rw-r--r-- | tests/mir-opt/div_overflow.const_divisor.PreCodegen.after.mir | 11 | ||||
-rw-r--r-- | tests/mir-opt/div_overflow.rs | 18 | ||||
-rw-r--r-- | tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff (renamed from src/test/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff) | 8 | ||||
-rw-r--r-- | tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff (renamed from src/test/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff) | 10 | ||||
-rw-r--r-- | tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff (renamed from src/test/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff) | 8 | ||||
-rw-r--r-- | tests/mir-opt/early_otherwise_branch.rs (renamed from src/test/mir-opt/early_otherwise_branch.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff (renamed from src/test/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff) | 12 | ||||
-rw-r--r-- | tests/mir-opt/early_otherwise_branch_3_element_tuple.rs (renamed from src/test/mir-opt/early_otherwise_branch_3_element_tuple.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/early_otherwise_branch_68867.rs (renamed from src/test/mir-opt/early_otherwise_branch_68867.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff (renamed from src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff) | 10 | ||||
-rw-r--r-- | tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff (renamed from src/test/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff) | 6 | ||||
-rw-r--r-- | tests/mir-opt/early_otherwise_branch_noopt.rs (renamed from src/test/mir-opt/early_otherwise_branch_noopt.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff (renamed from src/test/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff (renamed from src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/early_otherwise_branch_soundness.rs (renamed from src/test/mir-opt/early_otherwise_branch_soundness.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/equal_true.opt.InstCombine.diff (renamed from src/test/mir-opt/equal_true.opt.InstCombine.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/equal_true.rs (renamed from src/test/mir-opt/equal_true.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir (renamed from src/test/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir) | 14 | ||||
-rw-r--r-- | tests/mir-opt/exponential_or.rs (renamed from src/test/mir-opt/exponential_or.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/fn_ptr_shim.core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir (renamed from src/test/mir-opt/fn_ptr_shim.core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/fn_ptr_shim.rs (renamed from src/test/mir-opt/fn_ptr_shim.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff (renamed from src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/funky_arms.rs (renamed from src/test/mir-opt/funky_arms.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir (renamed from src/test/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/generator_drop_cleanup.rs (renamed from src/test/mir-opt/generator_drop_cleanup.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir (renamed from src/test/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/generator_storage_dead_unwind.rs (renamed from src/test/mir-opt/generator_storage_dead_unwind.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir (renamed from src/test/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/generator_tiny.rs (renamed from src/test/mir-opt/generator_tiny.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/graphviz.main.built.after.dot (renamed from src/test/mir-opt/graphviz.main.built.after.dot) | 0 | ||||
-rw-r--r-- | tests/mir-opt/graphviz.rs (renamed from src/test/mir-opt/graphviz.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff (renamed from src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff (renamed from src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff (renamed from src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff (renamed from src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff (renamed from src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff (renamed from src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff) | 8 | ||||
-rw-r--r-- | tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff (renamed from src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff (renamed from src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/if_condition_int.rs (renamed from src/test/mir-opt/if_condition_int.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/asm_unwind.main.Inline.diff (renamed from src/test/mir-opt/inline/asm_unwind.main.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/asm_unwind.rs (renamed from src/test/mir-opt/inline/asm_unwind.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff (renamed from src/test/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/caller_with_trivial_bound.rs (renamed from src/test/mir-opt/inline/caller_with_trivial_bound.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/cycle.f.Inline.diff (renamed from src/test/mir-opt/inline/cycle.f.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/cycle.g.Inline.diff (renamed from src/test/mir-opt/inline/cycle.g.Inline.diff) | 23 | ||||
-rw-r--r-- | tests/mir-opt/inline/cycle.main.Inline.diff (renamed from src/test/mir-opt/inline/cycle.main.Inline.diff) | 23 | ||||
-rw-r--r-- | tests/mir-opt/inline/cycle.rs (renamed from src/test/mir-opt/inline/cycle.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/dyn_trait.get_query.Inline.diff (renamed from src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff (renamed from src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/dyn_trait.rs (renamed from src/test/mir-opt/inline/dyn_trait.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff (renamed from src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/exponential_runtime.main.Inline.diff | 75 | ||||
-rw-r--r-- | tests/mir-opt/inline/exponential_runtime.rs (renamed from src/test/mir-opt/inline/exponential_runtime.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir (renamed from src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_any_operand.rs (renamed from src/test/mir-opt/inline/inline_any_operand.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_async.rs (renamed from src/test/mir-opt/inline/inline_async.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_closure.foo.Inline.after.mir (renamed from src/test/mir-opt/inline/inline_closure.foo.Inline.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_closure.rs (renamed from src/test/mir-opt/inline/inline_closure.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir (renamed from src/test/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_closure_borrows_arg.rs (renamed from src/test/mir-opt/inline/inline_closure_borrows_arg.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir (renamed from src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_closure_captures.rs (renamed from src/test/mir-opt/inline/inline_closure_captures.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff (renamed from src/test/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff (renamed from src/test/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff (renamed from src/test/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff (renamed from src/test/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff (renamed from src/test/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_compatibility.rs (renamed from src/test/mir-opt/inline/inline_compatibility.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_cycle.one.Inline.diff | 30 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_cycle.rs (renamed from src/test/mir-opt/inline/inline_cycle.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_cycle.two.Inline.diff (renamed from src/test/mir-opt/inline/inline_cycle.two.Inline.diff) | 7 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff (renamed from src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff) | 9 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_cycle_generic.rs (renamed from src/test/mir-opt/inline/inline_cycle_generic.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_diverging.f.Inline.diff (renamed from src/test/mir-opt/inline/inline_diverging.f.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_diverging.g.Inline.diff (renamed from src/test/mir-opt/inline/inline_diverging.g.Inline.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_diverging.h.Inline.diff (renamed from src/test/mir-opt/inline/inline_diverging.h.Inline.diff) | 43 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_diverging.rs (renamed from src/test/mir-opt/inline/inline_diverging.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_generator.main.Inline.diff (renamed from src/test/mir-opt/inline/inline_generator.main.Inline.diff) | 14 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_generator.rs (renamed from src/test/mir-opt/inline/inline_generator.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_instruction_set.default.Inline.diff (renamed from src/test/mir-opt/inline/inline_instruction_set.default.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_instruction_set.rs (renamed from src/test/mir-opt/inline/inline_instruction_set.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_instruction_set.t32.Inline.diff (renamed from src/test/mir-opt/inline/inline_instruction_set.t32.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_into_box_place.main.Inline.diff (renamed from src/test/mir-opt/inline/inline_into_box_place.main.Inline.diff) | 18 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_into_box_place.rs (renamed from src/test/mir-opt/inline/inline_into_box_place.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_options.main.Inline.after.mir (renamed from src/test/mir-opt/inline/inline_options.main.Inline.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_options.rs (renamed from src/test/mir-opt/inline/inline_options.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_retag.bar.Inline.after.mir (renamed from src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_retag.rs (renamed from src/test/mir-opt/inline/inline_retag.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_shims.clone.Inline.diff (renamed from src/test/mir-opt/inline/inline_shims.clone.Inline.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_shims.drop.Inline.diff (renamed from src/test/mir-opt/inline/inline_shims.drop.Inline.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_shims.rs (renamed from src/test/mir-opt/inline/inline_shims.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_specialization.main.Inline.diff (renamed from src/test/mir-opt/inline/inline_specialization.main.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_specialization.rs (renamed from src/test/mir-opt/inline/inline_specialization.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_trait_method.rs (renamed from src/test/mir-opt/inline/inline_trait_method.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_trait_method.test.Inline.after.mir (renamed from src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_trait_method_2.rs (renamed from src/test/mir-opt/inline/inline_trait_method_2.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir (renamed from src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/issue_106141.outer.Inline.diff | 55 | ||||
-rw-r--r-- | tests/mir-opt/inline/issue_106141.rs | 24 | ||||
-rw-r--r-- | tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir (renamed from src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir (renamed from src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir (renamed from src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir (renamed from src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs (renamed from src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir (renamed from src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/issue_76997_inline_scopes_parenting.rs (renamed from src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/issue_78442.bar.Inline.diff (renamed from src/test/mir-opt/inline/issue_78442.bar.Inline.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/issue_78442.bar.RevealAll.diff (renamed from src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/issue_78442.rs (renamed from src/test/mir-opt/inline/issue_78442.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/inline/polymorphic_recursion.rs (renamed from src/test/mir-opt/inline/polymorphic_recursion.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff (renamed from src/test/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff (renamed from src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/instrument_coverage.rs (renamed from src/test/mir-opt/instrument_coverage.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_101973.inner.ConstProp.diff (renamed from src/test/mir-opt/issue_101973.inner.ConstProp.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/issue_101973.rs (renamed from src/test/mir-opt/issue_101973.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir (renamed from src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/issue_38669.rs (renamed from src/test/mir-opt/issue_38669.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_41110.main.ElaborateDrops.after.mir (renamed from src/test/mir-opt/issue_41110.main.ElaborateDrops.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/issue_41110.rs (renamed from src/test/mir-opt/issue_41110.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_41110.test.ElaborateDrops.after.mir (renamed from src/test/mir-opt/issue_41110.test.ElaborateDrops.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/issue_41697.rs (renamed from src/test/mir-opt/issue_41697.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir (renamed from src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_41888.main.ElaborateDrops.after.mir (renamed from src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir) | 12 | ||||
-rw-r--r-- | tests/mir-opt/issue_41888.rs (renamed from src/test/mir-opt/issue_41888.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_62289.rs (renamed from src/test/mir-opt/issue_62289.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_62289.test.ElaborateDrops.before.mir (renamed from src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/issue_72181.bar.built.after.mir (renamed from src/test/mir-opt/issue_72181.bar.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_72181.foo.built.after.mir (renamed from src/test/mir-opt/issue_72181.foo.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_72181.main.built.after.mir (renamed from src/test/mir-opt/issue_72181.main.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_72181.rs (renamed from src/test/mir-opt/issue_72181.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_72181_1.f.built.after.mir (renamed from src/test/mir-opt/issue_72181_1.f.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_72181_1.main.built.after.mir (renamed from src/test/mir-opt/issue_72181_1.main.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_72181_1.rs (renamed from src/test/mir-opt/issue_72181_1.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_73223.main.SimplifyArmIdentity.diff | 156 | ||||
-rw-r--r-- | tests/mir-opt/issue_73223.rs (renamed from src/test/mir-opt/issue_73223.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_76432.rs (renamed from src/test/mir-opt/issue_76432.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff | 84 | ||||
-rw-r--r-- | tests/mir-opt/issue_78192.f.InstCombine.diff (renamed from src/test/mir-opt/issue_78192.f.InstCombine.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_78192.rs (renamed from src/test/mir-opt/issue_78192.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_91633.bar.built.after.mir (renamed from src/test/mir-opt/issue_91633.bar.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_91633.foo.built.after.mir (renamed from src/test/mir-opt/issue_91633.foo.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_91633.fun.built.after.mir (renamed from src/test/mir-opt/issue_91633.fun.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_91633.hey.built.after.mir (renamed from src/test/mir-opt/issue_91633.hey.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_91633.rs (renamed from src/test/mir-opt/issue_91633.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issue_99325.main.built.after.mir (renamed from src/test/mir-opt/issue_99325.main.built.after.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/issue_99325.rs (renamed from src/test/mir-opt/issue_99325.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir (renamed from src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir) | 14 | ||||
-rw-r--r-- | tests/mir-opt/issues/issue_59352.rs (renamed from src/test/mir-opt/issues/issue_59352.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff (renamed from src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff) | 10 | ||||
-rw-r--r-- | tests/mir-opt/issues/issue_75439.rs (renamed from src/test/mir-opt/issues/issue_75439.rs) | 1 | ||||
-rw-r--r-- | tests/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir (renamed from src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/loop_test.rs (renamed from src/test/mir-opt/loop_test.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff (renamed from src/test/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff (renamed from src/test/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.diff (renamed from src/test/mir-opt/lower_array_len.array_len.NormalizeArrayLen.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.diff (renamed from src/test/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_array_len.rs (renamed from src/test/mir-opt/lower_array_len.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_array_len_e2e.array_bound.PreCodegen.after.mir (renamed from src/test/mir-opt/lower_array_len_e2e.array_bound.PreCodegen.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/lower_array_len_e2e.array_bound_mut.PreCodegen.after.mir (renamed from src/test/mir-opt/lower_array_len_e2e.array_bound_mut.PreCodegen.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir (renamed from src/test/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_array_len_e2e.array_len_by_value.PreCodegen.after.mir (renamed from src/test/mir-opt/lower_array_len_e2e.array_len_by_value.PreCodegen.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_array_len_e2e.rs (renamed from src/test/mir-opt/lower_array_len_e2e.rs) | 2 | ||||
-rw-r--r-- | tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff (renamed from src/test/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff (renamed from src/test/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff (renamed from src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff (renamed from src/test/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff (renamed from src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff (renamed from src/test/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_intrinsics.rs (renamed from src/test/mir-opt/lower_intrinsics.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff (renamed from src/test/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff (renamed from src/test/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff (renamed from src/test/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir (renamed from src/test/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir (renamed from src/test/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_intrinsics_e2e.rs (renamed from src/test/mir-opt/lower_intrinsics_e2e.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff (renamed from src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/lower_slice_len.rs (renamed from src/test/mir-opt/lower_slice_len.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff (renamed from src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff) | 28 | ||||
-rw-r--r-- | tests/mir-opt/match_arm_scopes.rs (renamed from src/test/mir-opt/match_arm_scopes.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/match_test.main.SimplifyCfg-initial.after.mir (renamed from src/test/mir-opt/match_test.main.SimplifyCfg-initial.after.mir) | 12 | ||||
-rw-r--r-- | tests/mir-opt/match_test.rs (renamed from src/test/mir-opt/match_test.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff (renamed from src/test/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff (renamed from src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff) | 6 | ||||
-rw-r--r-- | tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff (renamed from src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff) | 8 | ||||
-rw-r--r-- | tests/mir-opt/matches_reduce_branches.rs (renamed from src/test/mir-opt/matches_reduce_branches.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff (renamed from src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff (renamed from src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/matches_u8.rs (renamed from src/test/mir-opt/matches_u8.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/multiple_return_terminators.rs (renamed from src/test/mir-opt/multiple_return_terminators.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff (renamed from src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/nll/named_lifetimes_basic.rs (renamed from src/test/mir-opt/nll/named_lifetimes_basic.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir (renamed from src/test/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir (renamed from src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir (renamed from src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/nll/region_subtyping_basic.rs (renamed from src/test/mir-opt/nll/region_subtyping_basic.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/no_drop_for_inactive_variant.rs (renamed from src/test/mir-opt/no_drop_for_inactive_variant.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir (renamed from src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir (renamed from src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/no_spurious_drop_after_call.rs (renamed from src/test/mir-opt/no_spurious_drop_after_call.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/not_equal_false.opt.InstCombine.diff (renamed from src/test/mir-opt/not_equal_false.opt.InstCombine.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/not_equal_false.rs (renamed from src/test/mir-opt/not_equal_false.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff (renamed from src/test/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/nrvo_simple.rs (renamed from src/test/mir-opt/nrvo_simple.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir (renamed from src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/packed_struct_drop_aligned.rs (renamed from src/test/mir-opt/packed_struct_drop_aligned.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.diff | 74 | ||||
-rw-r--r-- | tests/mir-opt/remove_fake_borrows.rs (renamed from src/test/mir-opt/remove_fake_borrows.rs) | 2 | ||||
-rw-r--r-- | tests/mir-opt/remove_never_const.no_codegen.PreCodegen.after.mir (renamed from src/test/mir-opt/remove_never_const.no_codegen.PreCodegen.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/remove_never_const.rs (renamed from src/test/mir-opt/remove_never_const.rs) | 2 | ||||
-rw-r--r-- | tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff (renamed from src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/remove_storage_markers.rs (renamed from src/test/mir-opt/remove_storage_markers.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff (renamed from src/test/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff (renamed from src/test/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff (renamed from src/test/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff (renamed from src/test/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/remove_unneeded_drops.rs (renamed from src/test/mir-opt/remove_unneeded_drops.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/remove_zsts.get_union.PreCodegen.after.mir (renamed from src/test/mir-opt/remove_zsts.get_union.PreCodegen.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/remove_zsts.get_union.RemoveZsts.diff (renamed from src/test/mir-opt/remove_zsts.get_union.RemoveZsts.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/remove_zsts.rs (renamed from src/test/mir-opt/remove_zsts.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir (renamed from src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir | 22 | ||||
-rw-r--r-- | tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir (renamed from src/test/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir (renamed from src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/retag.rs (renamed from src/test/mir-opt/retag.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir (renamed from src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir (renamed from src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/return_an_array.rs (renamed from src/test/mir-opt/return_an_array.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff (renamed from src/test/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff) | 45 | ||||
-rw-r--r-- | tests/mir-opt/separate_const_switch.rs (renamed from src/test/mir-opt/separate_const_switch.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff (renamed from src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff) | 8 | ||||
-rw-r--r-- | tests/mir-opt/simple_option_map_e2e.ezmap.PreCodegen.after.mir | 52 | ||||
-rw-r--r-- | tests/mir-opt/simple_option_map_e2e.rs | 19 | ||||
-rw-r--r-- | tests/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff (renamed from src/test/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff (renamed from src/test/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/simplify_arm.rs (renamed from src/test/mir-opt/simplify_arm.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/simplify_arm_identity.rs (renamed from src/test/mir-opt/simplify_arm_identity.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff (renamed from src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff (renamed from src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/simplify_cfg.rs (renamed from src/test/mir-opt/simplify_cfg.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff (renamed from src/test/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/simplify_if.rs (renamed from src/test/mir-opt/simplify_if.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals.c.SimplifyLocals-before-const-prop.diff | 33 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals.d1.SimplifyLocals-before-const-prop.diff | 19 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals.d2.SimplifyLocals-before-const-prop.diff | 29 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals.expose_addr.SimplifyLocals-before-const-prop.diff | 21 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals.r.SimplifyLocals-before-const-prop.diff | 31 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals.rs | 81 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff | 22 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals.t2.SimplifyLocals-before-const-prop.diff | 22 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff | 26 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff | 22 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.diff | 62 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals_fixedpoint.rs | 15 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.diff | 109 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals_removes_unused_consts.rs (renamed from src/test/mir-opt/simplify_locals_removes_unused_consts.rs) | 4 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals-before-const-prop.diff | 52 | ||||
-rw-r--r-- | tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs | 14 | ||||
-rw-r--r-- | tests/mir-opt/simplify_match.main.ConstProp.diff (renamed from src/test/mir-opt/simplify_match.main.ConstProp.diff) | 5 | ||||
-rw-r--r-- | tests/mir-opt/simplify_match.rs (renamed from src/test/mir-opt/simplify_match.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/simplify_try_if_let.rs (renamed from src/test/mir-opt/simplify_try_if_let.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/simplify_try_if_let.{impl#0}-append.SimplifyArmIdentity.diff (renamed from src/test/mir-opt/simplify_try_if_let.{impl#0}-append.SimplifyArmIdentity.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir (renamed from src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir) | 10 | ||||
-rw-r--r-- | tests/mir-opt/slice_drop_shim.rs (renamed from src/test/mir-opt/slice_drop_shim.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/spanview_block.main.built.after.html (renamed from src/test/mir-opt/spanview_block.main.built.after.html) | 0 | ||||
-rw-r--r-- | tests/mir-opt/spanview_block.rs (renamed from src/test/mir-opt/spanview_block.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/spanview_statement.main.built.after.html (renamed from src/test/mir-opt/spanview_statement.main.built.after.html) | 0 | ||||
-rw-r--r-- | tests/mir-opt/spanview_statement.rs (renamed from src/test/mir-opt/spanview_statement.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/spanview_terminator.main.built.after.html (renamed from src/test/mir-opt/spanview_terminator.main.built.after.html) | 0 | ||||
-rw-r--r-- | tests/mir-opt/spanview_terminator.rs (renamed from src/test/mir-opt/spanview_terminator.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/sroa.dropping.ScalarReplacementOfAggregates.diff (renamed from src/test/mir-opt/sroa.dropping.ScalarReplacementOfAggregates.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/sroa.enums.ScalarReplacementOfAggregates.diff (renamed from src/test/mir-opt/sroa.enums.ScalarReplacementOfAggregates.diff) | 2 | ||||
-rw-r--r-- | tests/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff (renamed from src/test/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/sroa.flat.ScalarReplacementOfAggregates.diff (renamed from src/test/mir-opt/sroa.flat.ScalarReplacementOfAggregates.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/sroa.rs (renamed from src/test/mir-opt/sroa.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/sroa.structs.ScalarReplacementOfAggregates.diff (renamed from src/test/mir-opt/sroa.structs.ScalarReplacementOfAggregates.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/sroa.unions.ScalarReplacementOfAggregates.diff (renamed from src/test/mir-opt/sroa.unions.ScalarReplacementOfAggregates.diff) | 0 | ||||
-rw-r--r-- | tests/mir-opt/storage_ranges.main.nll.0.mir (renamed from src/test/mir-opt/storage_ranges.main.nll.0.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/storage_ranges.rs (renamed from src/test/mir-opt/storage_ranges.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/tls_access.main.PreCodegen.after.mir (renamed from src/test/mir-opt/tls_access.main.PreCodegen.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/tls_access.rs (renamed from src/test/mir-opt/tls_access.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir (renamed from src/test/mir-opt/try_identity_e2e.new.PreCodegen.after.mir) | 6 | ||||
-rw-r--r-- | tests/mir-opt/try_identity_e2e.old.PreCodegen.after.mir (renamed from src/test/mir-opt/try_identity_e2e.old.PreCodegen.after.mir) | 2 | ||||
-rw-r--r-- | tests/mir-opt/try_identity_e2e.rs (renamed from src/test/mir-opt/try_identity_e2e.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/uninhabited_enum.process_never.SimplifyLocals-final.after.mir | 16 | ||||
-rw-r--r-- | tests/mir-opt/uninhabited_enum.process_void.SimplifyLocals-final.after.mir | 18 | ||||
-rw-r--r-- | tests/mir-opt/uninhabited_enum.rs | 19 | ||||
-rw-r--r-- | tests/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir (renamed from src/test/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff (renamed from src/test/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff) | 6 | ||||
-rw-r--r-- | tests/mir-opt/uninhabited_enum_branching.rs (renamed from src/test/mir-opt/uninhabited_enum_branching.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir (renamed from src/test/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir) | 4 | ||||
-rw-r--r-- | tests/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff (renamed from src/test/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff) | 8 | ||||
-rw-r--r-- | tests/mir-opt/uninhabited_enum_branching2.rs (renamed from src/test/mir-opt/uninhabited_enum_branching2.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff (renamed from src/test/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff (renamed from src/test/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/uninhabited_fallthrough_elimination.rs (renamed from src/test/mir-opt/uninhabited_fallthrough_elimination.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/unreachable.main.UnreachablePropagation.diff (renamed from src/test/mir-opt/unreachable.main.UnreachablePropagation.diff) | 6 | ||||
-rw-r--r-- | tests/mir-opt/unreachable.rs (renamed from src/test/mir-opt/unreachable.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff (renamed from src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff) | 4 | ||||
-rw-r--r-- | tests/mir-opt/unreachable_diverging.rs (renamed from src/test/mir-opt/unreachable_diverging.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/unusual_item_types.E-V-{constant#0}.built.after.mir (renamed from src/test/mir-opt/unusual_item_types.E-V-{constant#0}.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/unusual_item_types.Test-X-{constructor#0}.built.after.mir (renamed from src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir (renamed from src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/unusual_item_types.rs (renamed from src/test/mir-opt/unusual_item_types.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.built.after.mir (renamed from src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.built.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/while_let_loops.change_loop_body.ConstProp.diff | 46 | ||||
-rw-r--r-- | tests/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.mir (renamed from src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.mir) | 0 | ||||
-rw-r--r-- | tests/mir-opt/while_let_loops.rs (renamed from src/test/mir-opt/while_let_loops.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/while_storage.rs (renamed from src/test/mir-opt/while_storage.rs) | 0 | ||||
-rw-r--r-- | tests/mir-opt/while_storage.while_loop.PreCodegen.after.mir (renamed from src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir) | 10 |
584 files changed, 3341 insertions, 458 deletions
diff --git a/src/test/mir-opt/76803_regression.encode.SimplifyBranchSame.diff b/tests/mir-opt/76803_regression.encode.SimplifyBranchSame.diff index 57e298625..9780332d8 100644 --- a/src/test/mir-opt/76803_regression.encode.SimplifyBranchSame.diff +++ b/tests/mir-opt/76803_regression.encode.SimplifyBranchSame.diff @@ -8,7 +8,7 @@ bb0: { _2 = discriminant(_1); // scope 0 at $DIR/76803_regression.rs:+1:11: +1:12 - switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/76803_regression.rs:+1:5: +1:12 + switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/76803_regression.rs:+1:5: +1:12 } bb1: { diff --git a/src/test/mir-opt/76803_regression.rs b/tests/mir-opt/76803_regression.rs index 05dc3c978..05dc3c978 100644 --- a/src/test/mir-opt/76803_regression.rs +++ b/tests/mir-opt/76803_regression.rs diff --git a/src/test/mir-opt/README.md b/tests/mir-opt/README.md index 0721d9f70..0721d9f70 100644 --- a/src/test/mir-opt/README.md +++ b/tests/mir-opt/README.md diff --git a/src/test/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir b/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir index 5f8b2f931..5f8b2f931 100644 --- a/src/test/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir diff --git a/src/test/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir b/tests/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir index 4c67376b5..4c67376b5 100644 --- a/src/test/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/address_of.borrow_and_cast.SimplifyCfg-initial.after.mir diff --git a/src/test/mir-opt/address_of.rs b/tests/mir-opt/address_of.rs index c4bea5613..c4bea5613 100644 --- a/src/test/mir-opt/address_of.rs +++ b/tests/mir-opt/address_of.rs diff --git a/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir index af5178d40..af5178d40 100644 --- a/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir diff --git a/src/test/mir-opt/array_index_is_temporary.rs b/tests/mir-opt/array_index_is_temporary.rs index e7bde81d4..e7bde81d4 100644 --- a/src/test/mir-opt/array_index_is_temporary.rs +++ b/tests/mir-opt/array_index_is_temporary.rs diff --git a/src/test/mir-opt/asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir b/tests/mir-opt/asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir index 2487ef5c2..2487ef5c2 100644 --- a/src/test/mir-opt/asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir +++ b/tests/mir-opt/asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir diff --git a/src/test/mir-opt/asm_unwind_panic_abort.rs b/tests/mir-opt/asm_unwind_panic_abort.rs index ad8f9398e..ad8f9398e 100644 --- a/src/test/mir-opt/asm_unwind_panic_abort.rs +++ b/tests/mir-opt/asm_unwind_panic_abort.rs diff --git a/src/test/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir b/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir index 1f099cd5e..1f099cd5e 100644 --- a/src/test/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir diff --git a/src/test/mir-opt/basic_assignment.rs b/tests/mir-opt/basic_assignment.rs index ac350271e..ac350271e 100644 --- a/src/test/mir-opt/basic_assignment.rs +++ b/tests/mir-opt/basic_assignment.rs diff --git a/src/test/mir-opt/bool_compare.opt1.InstCombine.diff b/tests/mir-opt/bool_compare.opt1.InstCombine.diff index 9c5a9fa9a..0af5d82d3 100644 --- a/src/test/mir-opt/bool_compare.opt1.InstCombine.diff +++ b/tests/mir-opt/bool_compare.opt1.InstCombine.diff @@ -14,7 +14,7 @@ - _2 = Ne(move _3, const true); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17 + _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17 StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:+1:16: +1:17 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17 + switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17 } bb1: { diff --git a/src/test/mir-opt/bool_compare.opt2.InstCombine.diff b/tests/mir-opt/bool_compare.opt2.InstCombine.diff index 58c52c4b7..f5d1febd9 100644 --- a/src/test/mir-opt/bool_compare.opt2.InstCombine.diff +++ b/tests/mir-opt/bool_compare.opt2.InstCombine.diff @@ -14,7 +14,7 @@ - _2 = Ne(const true, move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17 + _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17 StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:+1:16: +1:17 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17 + switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:17 } bb1: { diff --git a/src/test/mir-opt/bool_compare.opt3.InstCombine.diff b/tests/mir-opt/bool_compare.opt3.InstCombine.diff index 676428c95..e7432adac 100644 --- a/src/test/mir-opt/bool_compare.opt3.InstCombine.diff +++ b/tests/mir-opt/bool_compare.opt3.InstCombine.diff @@ -14,7 +14,7 @@ - _2 = Eq(move _3, const false); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18 + _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18 StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:+1:17: +1:18 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18 + switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18 } bb1: { diff --git a/src/test/mir-opt/bool_compare.opt4.InstCombine.diff b/tests/mir-opt/bool_compare.opt4.InstCombine.diff index addfcd769..6b3e27772 100644 --- a/src/test/mir-opt/bool_compare.opt4.InstCombine.diff +++ b/tests/mir-opt/bool_compare.opt4.InstCombine.diff @@ -14,7 +14,7 @@ - _2 = Eq(const false, move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18 + _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18 StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:+1:17: +1:18 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18 + switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:+1:8: +1:18 } bb1: { diff --git a/src/test/mir-opt/bool_compare.rs b/tests/mir-opt/bool_compare.rs index 4435bf5b0..4435bf5b0 100644 --- a/src/test/mir-opt/bool_compare.rs +++ b/tests/mir-opt/bool_compare.rs diff --git a/src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir b/tests/mir-opt/box_expr.main.ElaborateDrops.before.mir index 49133138d..49133138d 100644 --- a/src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir +++ b/tests/mir-opt/box_expr.main.ElaborateDrops.before.mir diff --git a/src/test/mir-opt/box_expr.rs b/tests/mir-opt/box_expr.rs index a214504f6..a214504f6 100644 --- a/src/test/mir-opt/box_expr.rs +++ b/tests/mir-opt/box_expr.rs diff --git a/tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir b/tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir new file mode 100644 index 000000000..2a7f90fe9 --- /dev/null +++ b/tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir @@ -0,0 +1,41 @@ +// MIR for `a::{closure#0}` 0 generator_resume +/* generator_layout = GeneratorLayout { + field_tys: {}, + variant_fields: { + Unresumed(0): [], + Returned (1): [], + Panicked (2): [], + }, + storage_conflicts: BitMatrix(0x0) {}, +} */ + +fn a::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:11:14: 11:16]>, _2: &mut Context<'_>) -> Poll<()> { + debug _task_context => _4; // in scope 0 at $DIR/async_await.rs:+0:14: +0:16 + let mut _0: std::task::Poll<()>; // return place in scope 0 at $DIR/async_await.rs:+0:14: +0:16 + let mut _3: (); // in scope 0 at $DIR/async_await.rs:+0:14: +0:16 + let mut _4: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+0:14: +0:16 + let mut _5: u32; // in scope 0 at $DIR/async_await.rs:+0:14: +0:16 + + bb0: { + _5 = discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:11:14: 11:16]))); // scope 0 at $DIR/async_await.rs:+0:14: +0:16 + switchInt(move _5) -> [0: bb1, 1: bb2, otherwise: bb3]; // scope 0 at $DIR/async_await.rs:+0:14: +0:16 + } + + bb1: { + _4 = move _2; // scope 0 at $DIR/async_await.rs:+0:14: +0:16 + _3 = const (); // scope 0 at $DIR/async_await.rs:+0:14: +0:16 + Deinit(_0); // scope 0 at $DIR/async_await.rs:+0:16: +0:16 + ((_0 as Ready).0: ()) = move _3; // scope 0 at $DIR/async_await.rs:+0:16: +0:16 + discriminant(_0) = 0; // scope 0 at $DIR/async_await.rs:+0:16: +0:16 + discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:11:14: 11:16]))) = 1; // scope 0 at $DIR/async_await.rs:+0:16: +0:16 + return; // scope 0 at $DIR/async_await.rs:+0:16: +0:16 + } + + bb2: { + assert(const false, "`async fn` resumed after completion") -> bb2; // scope 0 at $DIR/async_await.rs:+0:14: +0:16 + } + + bb3: { + unreachable; // scope 0 at $DIR/async_await.rs:+0:14: +0:16 + } +} diff --git a/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir b/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir new file mode 100644 index 000000000..05edc4797 --- /dev/null +++ b/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir @@ -0,0 +1,337 @@ +// MIR for `b::{closure#0}` 0 generator_resume +/* generator_layout = GeneratorLayout { + field_tys: { + _0: impl std::future::Future<Output = ()>, + _1: impl std::future::Future<Output = ()>, + }, + variant_fields: { + Unresumed(0): [], + Returned (1): [], + Panicked (2): [], + Suspend0 (3): [_0], + Suspend1 (4): [_1], + }, + storage_conflicts: BitMatrix(2x2) { + (_0, _0), + (_1, _1), + }, +} */ + +fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>, _2: &mut Context<'_>) -> Poll<()> { + debug _task_context => _38; // in scope 0 at $DIR/async_await.rs:+0:18: +3:2 + let mut _0: std::task::Poll<()>; // return place in scope 0 at $DIR/async_await.rs:+0:18: +3:2 + let _3: (); // in scope 0 at $DIR/async_await.rs:+1:5: +1:14 + let mut _4: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:8: +1:14 + let mut _5: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:5: +1:8 + let mut _6: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:8: +1:14 + let mut _7: (); // in scope 0 at $DIR/async_await.rs:+0:18: +3:2 + let _8: (); // in scope 0 at $DIR/async_await.rs:+1:8: +1:14 + let mut _9: std::task::Poll<()>; // in scope 0 at $DIR/async_await.rs:+1:8: +1:14 + let mut _10: std::pin::Pin<&mut impl std::future::Future<Output = ()>>; // in scope 0 at $DIR/async_await.rs:+1:8: +1:14 + let mut _11: &mut impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:8: +1:14 + let mut _12: &mut impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:8: +1:14 + let mut _13: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+1:5: +1:14 + let mut _14: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+1:5: +1:14 + let mut _15: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+1:8: +1:14 + let mut _16: isize; // in scope 0 at $DIR/async_await.rs:+1:8: +1:14 + let mut _18: !; // in scope 0 at $DIR/async_await.rs:+1:5: +1:14 + let mut _19: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+1:8: +1:14 + let mut _20: (); // in scope 0 at $DIR/async_await.rs:+1:8: +1:14 + let mut _21: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:8: +2:14 + let mut _22: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:5: +2:8 + let mut _23: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:8: +2:14 + let _24: (); // in scope 0 at $DIR/async_await.rs:+2:8: +2:14 + let mut _25: std::task::Poll<()>; // in scope 0 at $DIR/async_await.rs:+2:8: +2:14 + let mut _26: std::pin::Pin<&mut impl std::future::Future<Output = ()>>; // in scope 0 at $DIR/async_await.rs:+2:8: +2:14 + let mut _27: &mut impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:8: +2:14 + let mut _28: &mut impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:8: +2:14 + let mut _29: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+2:5: +2:14 + let mut _30: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+2:5: +2:14 + let mut _31: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+2:8: +2:14 + let mut _32: isize; // in scope 0 at $DIR/async_await.rs:+2:8: +2:14 + let mut _34: !; // in scope 0 at $DIR/async_await.rs:+2:5: +2:14 + let mut _35: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+2:8: +2:14 + let mut _36: (); // in scope 0 at $DIR/async_await.rs:+2:8: +2:14 + let mut _37: (); // in scope 0 at $DIR/async_await.rs:+0:18: +3:2 + let mut _38: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+0:18: +3:2 + let mut _39: u32; // in scope 0 at $DIR/async_await.rs:+0:18: +3:2 + scope 1 { + debug __awaitee => (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>); // in scope 1 at $DIR/async_await.rs:+1:8: +1:14 + let _17: (); // in scope 1 at $DIR/async_await.rs:+1:5: +1:14 + scope 2 { + } + scope 3 { + debug result => _17; // in scope 3 at $DIR/async_await.rs:+1:5: +1:14 + } + } + scope 4 { + debug __awaitee => (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>); // in scope 4 at $DIR/async_await.rs:+2:8: +2:14 + let _33: (); // in scope 4 at $DIR/async_await.rs:+2:5: +2:14 + scope 5 { + } + scope 6 { + debug result => _33; // in scope 6 at $DIR/async_await.rs:+2:5: +2:14 + } + } + + bb0: { + _39 = discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))); // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + switchInt(move _39) -> [0: bb1, 1: bb29, 3: bb27, 4: bb28, otherwise: bb30]; // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + } + + bb1: { + _38 = move _2; // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + StorageLive(_3); // scope 0 at $DIR/async_await.rs:+1:5: +1:14 + StorageLive(_4); // scope 0 at $DIR/async_await.rs:+1:8: +1:14 + StorageLive(_5); // scope 0 at $DIR/async_await.rs:+1:5: +1:8 + _5 = a() -> bb2; // scope 0 at $DIR/async_await.rs:+1:5: +1:8 + // mir::Constant + // + span: $DIR/async_await.rs:15:5: 15:6 + // + literal: Const { ty: fn() -> impl Future<Output = ()> {a}, val: Value(<ZST>) } + } + + bb2: { + _4 = <impl Future<Output = ()> as IntoFuture>::into_future(move _5) -> bb3; // scope 0 at $DIR/async_await.rs:+1:8: +1:14 + // mir::Constant + // + span: $DIR/async_await.rs:15:8: 15:14 + // + literal: Const { ty: fn(impl Future<Output = ()>) -> <impl Future<Output = ()> as IntoFuture>::IntoFuture {<impl Future<Output = ()> as IntoFuture>::into_future}, val: Value(<ZST>) } + } + + bb3: { + StorageDead(_5); // scope 0 at $DIR/async_await.rs:+1:13: +1:14 + nop; // scope 0 at $DIR/async_await.rs:+1:8: +1:14 + (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>) = move _4; // scope 0 at $DIR/async_await.rs:+1:8: +1:14 + goto -> bb4; // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + } + + bb4: { + StorageLive(_8); // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + StorageLive(_9); // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + StorageLive(_10); // scope 2 at $DIR/async_await.rs:+1:8: +1:14 + StorageLive(_11); // scope 2 at $DIR/async_await.rs:+1:8: +1:14 + StorageLive(_12); // scope 2 at $DIR/async_await.rs:+1:8: +1:14 + _12 = &mut (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>); // scope 2 at $DIR/async_await.rs:+1:8: +1:14 + _11 = &mut (*_12); // scope 2 at $DIR/async_await.rs:+1:8: +1:14 + _10 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _11) -> bb5; // scope 2 at $DIR/async_await.rs:+1:8: +1:14 + // mir::Constant + // + span: $DIR/async_await.rs:15:8: 15:14 + // + literal: Const { ty: unsafe fn(&mut impl Future<Output = ()>) -> Pin<&mut impl Future<Output = ()>> {Pin::<&mut impl Future<Output = ()>>::new_unchecked}, val: Value(<ZST>) } + } + + bb5: { + StorageDead(_11); // scope 2 at $DIR/async_await.rs:+1:13: +1:14 + StorageLive(_13); // scope 2 at $DIR/async_await.rs:+1:5: +1:14 + StorageLive(_14); // scope 2 at $DIR/async_await.rs:+1:5: +1:14 + StorageLive(_15); // scope 2 at $DIR/async_await.rs:+1:8: +1:14 + _15 = _38; // scope 2 at $DIR/async_await.rs:+1:8: +1:14 + _14 = move _15; // scope 2 at $DIR/async_await.rs:+1:5: +1:14 + goto -> bb6; // scope 2 at $DIR/async_await.rs:+1:5: +1:14 + } + + bb6: { + _13 = &mut (*_14); // scope 2 at $DIR/async_await.rs:+1:5: +1:14 + StorageDead(_15); // scope 2 at $DIR/async_await.rs:+1:13: +1:14 + _9 = <impl Future<Output = ()> as Future>::poll(move _10, move _13) -> bb7; // scope 2 at $DIR/async_await.rs:+1:8: +1:14 + // mir::Constant + // + span: $DIR/async_await.rs:15:8: 15:14 + // + literal: Const { ty: for<'a, 'b, 'c> fn(Pin<&'a mut impl Future<Output = ()>>, &'b mut Context<'c>) -> Poll<<impl Future<Output = ()> as Future>::Output> {<impl Future<Output = ()> as Future>::poll}, val: Value(<ZST>) } + } + + bb7: { + StorageDead(_13); // scope 2 at $DIR/async_await.rs:+1:13: +1:14 + StorageDead(_10); // scope 2 at $DIR/async_await.rs:+1:13: +1:14 + _16 = discriminant(_9); // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + switchInt(move _16) -> [0: bb10, 1: bb8, otherwise: bb9]; // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + } + + bb8: { + _8 = const (); // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + StorageDead(_14); // scope 1 at $DIR/async_await.rs:+1:13: +1:14 + StorageDead(_12); // scope 1 at $DIR/async_await.rs:+1:13: +1:14 + StorageDead(_9); // scope 1 at $DIR/async_await.rs:+1:13: +1:14 + StorageDead(_8); // scope 1 at $DIR/async_await.rs:+1:13: +1:14 + StorageLive(_19); // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + StorageLive(_20); // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + _20 = (); // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + Deinit(_0); // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + discriminant(_0) = 1; // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 3; // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + return; // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + } + + bb9: { + unreachable; // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + } + + bb10: { + StorageLive(_17); // scope 1 at $DIR/async_await.rs:+1:5: +1:14 + _17 = ((_9 as Ready).0: ()); // scope 1 at $DIR/async_await.rs:+1:5: +1:14 + _3 = _17; // scope 3 at $DIR/async_await.rs:+1:5: +1:14 + StorageDead(_17); // scope 1 at $DIR/async_await.rs:+1:13: +1:14 + StorageDead(_14); // scope 1 at $DIR/async_await.rs:+1:13: +1:14 + StorageDead(_12); // scope 1 at $DIR/async_await.rs:+1:13: +1:14 + StorageDead(_9); // scope 1 at $DIR/async_await.rs:+1:13: +1:14 + StorageDead(_8); // scope 1 at $DIR/async_await.rs:+1:13: +1:14 + goto -> bb12; // scope 0 at $DIR/async_await.rs:+1:13: +1:14 + } + + bb11: { + StorageDead(_20); // scope 1 at $DIR/async_await.rs:+1:13: +1:14 + _38 = move _19; // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + StorageDead(_19); // scope 1 at $DIR/async_await.rs:+1:13: +1:14 + _7 = const (); // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + goto -> bb4; // scope 1 at $DIR/async_await.rs:+1:8: +1:14 + } + + bb12: { + nop; // scope 0 at $DIR/async_await.rs:+1:13: +1:14 + goto -> bb13; // scope 0 at $DIR/async_await.rs:+1:14: +1:15 + } + + bb13: { + StorageDead(_4); // scope 0 at $DIR/async_await.rs:+1:14: +1:15 + StorageDead(_3); // scope 0 at $DIR/async_await.rs:+1:14: +1:15 + StorageLive(_21); // scope 0 at $DIR/async_await.rs:+2:8: +2:14 + StorageLive(_22); // scope 0 at $DIR/async_await.rs:+2:5: +2:8 + _22 = a() -> bb14; // scope 0 at $DIR/async_await.rs:+2:5: +2:8 + // mir::Constant + // + span: $DIR/async_await.rs:16:5: 16:6 + // + literal: Const { ty: fn() -> impl Future<Output = ()> {a}, val: Value(<ZST>) } + } + + bb14: { + _21 = <impl Future<Output = ()> as IntoFuture>::into_future(move _22) -> bb15; // scope 0 at $DIR/async_await.rs:+2:8: +2:14 + // mir::Constant + // + span: $DIR/async_await.rs:16:8: 16:14 + // + literal: Const { ty: fn(impl Future<Output = ()>) -> <impl Future<Output = ()> as IntoFuture>::IntoFuture {<impl Future<Output = ()> as IntoFuture>::into_future}, val: Value(<ZST>) } + } + + bb15: { + StorageDead(_22); // scope 0 at $DIR/async_await.rs:+2:13: +2:14 + nop; // scope 0 at $DIR/async_await.rs:+2:8: +2:14 + (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>) = move _21; // scope 0 at $DIR/async_await.rs:+2:8: +2:14 + goto -> bb16; // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + } + + bb16: { + StorageLive(_24); // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + StorageLive(_25); // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + StorageLive(_26); // scope 5 at $DIR/async_await.rs:+2:8: +2:14 + StorageLive(_27); // scope 5 at $DIR/async_await.rs:+2:8: +2:14 + StorageLive(_28); // scope 5 at $DIR/async_await.rs:+2:8: +2:14 + _28 = &mut (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>); // scope 5 at $DIR/async_await.rs:+2:8: +2:14 + _27 = &mut (*_28); // scope 5 at $DIR/async_await.rs:+2:8: +2:14 + _26 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _27) -> bb17; // scope 5 at $DIR/async_await.rs:+2:8: +2:14 + // mir::Constant + // + span: $DIR/async_await.rs:16:8: 16:14 + // + literal: Const { ty: unsafe fn(&mut impl Future<Output = ()>) -> Pin<&mut impl Future<Output = ()>> {Pin::<&mut impl Future<Output = ()>>::new_unchecked}, val: Value(<ZST>) } + } + + bb17: { + StorageDead(_27); // scope 5 at $DIR/async_await.rs:+2:13: +2:14 + StorageLive(_29); // scope 5 at $DIR/async_await.rs:+2:5: +2:14 + StorageLive(_30); // scope 5 at $DIR/async_await.rs:+2:5: +2:14 + StorageLive(_31); // scope 5 at $DIR/async_await.rs:+2:8: +2:14 + _31 = _38; // scope 5 at $DIR/async_await.rs:+2:8: +2:14 + _30 = move _31; // scope 5 at $DIR/async_await.rs:+2:5: +2:14 + goto -> bb18; // scope 5 at $DIR/async_await.rs:+2:5: +2:14 + } + + bb18: { + _29 = &mut (*_30); // scope 5 at $DIR/async_await.rs:+2:5: +2:14 + StorageDead(_31); // scope 5 at $DIR/async_await.rs:+2:13: +2:14 + _25 = <impl Future<Output = ()> as Future>::poll(move _26, move _29) -> bb19; // scope 5 at $DIR/async_await.rs:+2:8: +2:14 + // mir::Constant + // + span: $DIR/async_await.rs:16:8: 16:14 + // + literal: Const { ty: for<'a, 'b, 'c> fn(Pin<&'a mut impl Future<Output = ()>>, &'b mut Context<'c>) -> Poll<<impl Future<Output = ()> as Future>::Output> {<impl Future<Output = ()> as Future>::poll}, val: Value(<ZST>) } + } + + bb19: { + StorageDead(_29); // scope 5 at $DIR/async_await.rs:+2:13: +2:14 + StorageDead(_26); // scope 5 at $DIR/async_await.rs:+2:13: +2:14 + _32 = discriminant(_25); // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + switchInt(move _32) -> [0: bb22, 1: bb20, otherwise: bb21]; // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + } + + bb20: { + _24 = const (); // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + StorageDead(_30); // scope 4 at $DIR/async_await.rs:+2:13: +2:14 + StorageDead(_28); // scope 4 at $DIR/async_await.rs:+2:13: +2:14 + StorageDead(_25); // scope 4 at $DIR/async_await.rs:+2:13: +2:14 + StorageDead(_24); // scope 4 at $DIR/async_await.rs:+2:13: +2:14 + StorageLive(_35); // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + StorageLive(_36); // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + _36 = (); // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + Deinit(_0); // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + discriminant(_0) = 1; // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 4; // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + return; // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + } + + bb21: { + unreachable; // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + } + + bb22: { + StorageLive(_33); // scope 4 at $DIR/async_await.rs:+2:5: +2:14 + _33 = ((_25 as Ready).0: ()); // scope 4 at $DIR/async_await.rs:+2:5: +2:14 + _37 = _33; // scope 6 at $DIR/async_await.rs:+2:5: +2:14 + StorageDead(_33); // scope 4 at $DIR/async_await.rs:+2:13: +2:14 + StorageDead(_30); // scope 4 at $DIR/async_await.rs:+2:13: +2:14 + StorageDead(_28); // scope 4 at $DIR/async_await.rs:+2:13: +2:14 + StorageDead(_25); // scope 4 at $DIR/async_await.rs:+2:13: +2:14 + StorageDead(_24); // scope 4 at $DIR/async_await.rs:+2:13: +2:14 + goto -> bb24; // scope 0 at $DIR/async_await.rs:+2:13: +2:14 + } + + bb23: { + StorageDead(_36); // scope 4 at $DIR/async_await.rs:+2:13: +2:14 + _38 = move _35; // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + StorageDead(_35); // scope 4 at $DIR/async_await.rs:+2:13: +2:14 + _7 = const (); // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + goto -> bb16; // scope 4 at $DIR/async_await.rs:+2:8: +2:14 + } + + bb24: { + nop; // scope 0 at $DIR/async_await.rs:+2:13: +2:14 + goto -> bb25; // scope 0 at $DIR/async_await.rs:+3:1: +3:2 + } + + bb25: { + StorageDead(_21); // scope 0 at $DIR/async_await.rs:+3:1: +3:2 + goto -> bb26; // scope 0 at $DIR/async_await.rs:+3:1: +3:2 + } + + bb26: { + Deinit(_0); // scope 0 at $DIR/async_await.rs:+3:2: +3:2 + ((_0 as Ready).0: ()) = move _37; // scope 0 at $DIR/async_await.rs:+3:2: +3:2 + discriminant(_0) = 0; // scope 0 at $DIR/async_await.rs:+3:2: +3:2 + discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 1; // scope 0 at $DIR/async_await.rs:+3:2: +3:2 + return; // scope 0 at $DIR/async_await.rs:+3:2: +3:2 + } + + bb27: { + StorageLive(_3); // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + StorageLive(_4); // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + StorageLive(_19); // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + StorageLive(_20); // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + _19 = move _2; // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + goto -> bb11; // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + } + + bb28: { + StorageLive(_21); // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + StorageLive(_35); // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + StorageLive(_36); // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + _35 = move _2; // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + goto -> bb23; // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + } + + bb29: { + assert(const false, "`async fn` resumed after completion") -> bb29; // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + } + + bb30: { + unreachable; // scope 0 at $DIR/async_await.rs:+0:18: +3:2 + } +} diff --git a/tests/mir-opt/building/async_await.rs b/tests/mir-opt/building/async_await.rs new file mode 100644 index 000000000..0b991e3b8 --- /dev/null +++ b/tests/mir-opt/building/async_await.rs @@ -0,0 +1,17 @@ +// This test makes sure that the generator MIR pass eliminates all calls to +// `get_context`, and that the MIR argument type for an async fn and all locals +// related to `yield` are `&mut Context`, and its return type is `Poll`. + +// edition:2018 +// compile-flags: -C panic=abort + +#![crate_type = "lib"] + +// EMIT_MIR async_await.a-{closure#0}.generator_resume.0.mir +async fn a() {} + +// EMIT_MIR async_await.b-{closure#0}.generator_resume.0.mir +pub async fn b() { + a().await; + a().await +} diff --git a/src/test/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir b/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir index 20dd251e7..20dd251e7 100644 --- a/src/test/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir +++ b/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir diff --git a/src/test/mir-opt/building/custom/arbitrary_let.rs b/tests/mir-opt/building/custom/arbitrary_let.rs index 776df3151..776df3151 100644 --- a/src/test/mir-opt/building/custom/arbitrary_let.rs +++ b/tests/mir-opt/building/custom/arbitrary_let.rs diff --git a/src/test/mir-opt/building/custom/consts.consts.built.after.mir b/tests/mir-opt/building/custom/consts.consts.built.after.mir index ba753cfc2..ba753cfc2 100644 --- a/src/test/mir-opt/building/custom/consts.consts.built.after.mir +++ b/tests/mir-opt/building/custom/consts.consts.built.after.mir diff --git a/src/test/mir-opt/building/custom/consts.rs b/tests/mir-opt/building/custom/consts.rs index ff4fe1a93..16d10eb59 100644 --- a/src/test/mir-opt/building/custom/consts.rs +++ b/tests/mir-opt/building/custom/consts.rs @@ -18,8 +18,8 @@ fn consts<const C: u32>() { }) } -static S: i32 = 5; -static mut T: i32 = 10; +static S: i32 = 0x05050505; +static mut T: i32 = 0x0a0a0a0a; // EMIT_MIR consts.statics.built.after.mir #[custom_mir(dialect = "built")] fn statics() { diff --git a/src/test/mir-opt/building/custom/consts.statics.built.after.mir b/tests/mir-opt/building/custom/consts.statics.built.after.mir index ee768e263..bfef976aa 100644 --- a/src/test/mir-opt/building/custom/consts.statics.built.after.mir +++ b/tests/mir-opt/building/custom/consts.statics.built.after.mir @@ -19,9 +19,9 @@ fn statics() -> () { } alloc2 (static: T, size: 4, align: 4) { - 0a 00 00 00 │ .... + 0a 0a 0a 0a │ .... } alloc1 (static: S, size: 4, align: 4) { - 05 00 00 00 │ .... + 05 05 05 05 │ .... } diff --git a/tests/mir-opt/building/custom/enums.rs b/tests/mir-opt/building/custom/enums.rs new file mode 100644 index 000000000..e5cd45637 --- /dev/null +++ b/tests/mir-opt/building/custom/enums.rs @@ -0,0 +1,120 @@ +#![feature(custom_mir, core_intrinsics)] + +extern crate core; +use core::intrinsics::mir::*; + +// EMIT_MIR enums.switch_bool.built.after.mir +#[custom_mir(dialect = "built")] +pub fn switch_bool(b: bool) -> u32 { + mir!( + { + match b { + true => t, + false => f, + _ => f, + } + } + + t = { + RET = 5; + Return() + } + + f = { + RET = 10; + Return() + } + ) +} + +// EMIT_MIR enums.switch_option.built.after.mir +#[custom_mir(dialect = "built")] +pub fn switch_option(option: Option<()>) -> bool { + mir!( + { + let discr = Discriminant(option); + match discr { + 0 => n, + 1 => s, + _ => s, + } + } + + n = { + RET = false; + Return() + } + + s = { + RET = true; + Return() + } + ) +} + +#[repr(u8)] +enum Bool { + False = 0, + True = 1, +} + +// EMIT_MIR enums.switch_option_repr.built.after.mir +#[custom_mir(dialect = "built")] +fn switch_option_repr(option: Bool) -> bool { + mir!( + { + let discr = Discriminant(option); + match discr { + 0 => f, + _ => t, + } + } + + t = { + RET = true; + Return() + } + + f = { + RET = false; + Return() + } + ) +} + +// EMIT_MIR enums.set_discr.built.after.mir +#[custom_mir(dialect = "runtime", phase = "initial")] +fn set_discr(option: &mut Option<()>) { + mir!({ + SetDiscriminant(*option, 0); + Return() + }) +} + +// EMIT_MIR enums.set_discr_repr.built.after.mir +#[custom_mir(dialect = "runtime", phase = "initial")] +fn set_discr_repr(b: &mut Bool) { + mir!({ + SetDiscriminant(*b, 0); + Return() + }) +} + +fn main() { + assert_eq!(switch_bool(true), 5); + assert_eq!(switch_bool(false), 10); + + assert_eq!(switch_option(Some(())), true); + assert_eq!(switch_option(None), false); + + assert_eq!(switch_option_repr(Bool::True), true); + assert_eq!(switch_option_repr(Bool::False), false); + + let mut opt = Some(()); + set_discr(&mut opt); + assert_eq!(opt, None); + + let mut b = Bool::True; + set_discr_repr(&mut b); + assert!(matches!(b, Bool::False)); +} diff --git a/tests/mir-opt/building/custom/enums.set_discr.built.after.mir b/tests/mir-opt/building/custom/enums.set_discr.built.after.mir new file mode 100644 index 000000000..7de9ed098 --- /dev/null +++ b/tests/mir-opt/building/custom/enums.set_discr.built.after.mir @@ -0,0 +1,10 @@ +// MIR for `set_discr` after built + +fn set_discr(_1: &mut Option<()>) -> () { + let mut _0: (); // return place in scope 0 at $DIR/enums.rs:+0:39: +0:39 + + bb0: { + discriminant((*_1)) = 0; // scope 0 at $DIR/enums.rs:+2:9: +2:36 + return; // scope 0 at $DIR/enums.rs:+3:9: +3:17 + } +} diff --git a/tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir b/tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir new file mode 100644 index 000000000..6fdc3d0f4 --- /dev/null +++ b/tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir @@ -0,0 +1,10 @@ +// MIR for `set_discr_repr` after built + +fn set_discr_repr(_1: &mut Bool) -> () { + let mut _0: (); // return place in scope 0 at $DIR/enums.rs:+0:33: +0:33 + + bb0: { + discriminant((*_1)) = 0; // scope 0 at $DIR/enums.rs:+2:9: +2:31 + return; // scope 0 at $DIR/enums.rs:+3:9: +3:17 + } +} diff --git a/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir b/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir new file mode 100644 index 000000000..95c57d2dc --- /dev/null +++ b/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir @@ -0,0 +1,19 @@ +// MIR for `switch_bool` after built + +fn switch_bool(_1: bool) -> u32 { + let mut _0: u32; // return place in scope 0 at $DIR/enums.rs:+0:32: +0:35 + + bb0: { + switchInt(_1) -> [1: bb1, 0: bb2, otherwise: bb2]; // scope 0 at $DIR/enums.rs:+3:13: +7:14 + } + + bb1: { + _0 = const 5_u32; // scope 0 at $DIR/enums.rs:+11:13: +11:20 + return; // scope 0 at $DIR/enums.rs:+12:13: +12:21 + } + + bb2: { + _0 = const 10_u32; // scope 0 at $DIR/enums.rs:+16:13: +16:21 + return; // scope 0 at $DIR/enums.rs:+17:13: +17:21 + } +} diff --git a/tests/mir-opt/building/custom/enums.switch_option.built.after.mir b/tests/mir-opt/building/custom/enums.switch_option.built.after.mir new file mode 100644 index 000000000..a659ba7c1 --- /dev/null +++ b/tests/mir-opt/building/custom/enums.switch_option.built.after.mir @@ -0,0 +1,21 @@ +// MIR for `switch_option` after built + +fn switch_option(_1: Option<()>) -> bool { + let mut _0: bool; // return place in scope 0 at $DIR/enums.rs:+0:45: +0:49 + let mut _2: isize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL + + bb0: { + _2 = discriminant(_1); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL + switchInt(_2) -> [0: bb1, 1: bb2, otherwise: bb2]; // scope 0 at $DIR/enums.rs:+4:13: +8:14 + } + + bb1: { + _0 = const false; // scope 0 at $DIR/enums.rs:+12:13: +12:24 + return; // scope 0 at $DIR/enums.rs:+13:13: +13:21 + } + + bb2: { + _0 = const true; // scope 0 at $DIR/enums.rs:+17:13: +17:23 + return; // scope 0 at $DIR/enums.rs:+18:13: +18:21 + } +} diff --git a/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir b/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir new file mode 100644 index 000000000..d60e4b1b7 --- /dev/null +++ b/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir @@ -0,0 +1,21 @@ +// MIR for `switch_option_repr` after built + +fn switch_option_repr(_1: Bool) -> bool { + let mut _0: bool; // return place in scope 0 at $DIR/enums.rs:+0:40: +0:44 + let mut _2: u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL + + bb0: { + _2 = discriminant(_1); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL + switchInt(_2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/enums.rs:+4:13: +7:14 + } + + bb1: { + _0 = const true; // scope 0 at $DIR/enums.rs:+11:13: +11:23 + return; // scope 0 at $DIR/enums.rs:+12:13: +12:21 + } + + bb2: { + _0 = const false; // scope 0 at $DIR/enums.rs:+16:13: +16:24 + return; // scope 0 at $DIR/enums.rs:+17:13: +17:21 + } +} diff --git a/tests/mir-opt/building/custom/projections.rs b/tests/mir-opt/building/custom/projections.rs new file mode 100644 index 000000000..5e472e531 --- /dev/null +++ b/tests/mir-opt/building/custom/projections.rs @@ -0,0 +1,85 @@ +#![feature(custom_mir, core_intrinsics)] + +extern crate core; +use core::intrinsics::mir::*; + +union U { + a: i32, + b: u32, +} + +// EMIT_MIR projections.unions.built.after.mir +#[custom_mir(dialect = "built")] +fn unions(u: U) -> i32 { + mir!({ + RET = u.a; + Return() + }) +} + +// EMIT_MIR projections.tuples.built.after.mir +#[custom_mir(dialect = "analysis", phase = "post-cleanup")] +fn tuples(i: (u32, i32)) -> (u32, i32) { + mir!( + // FIXME(JakobDegen): This is necessary because we can't give type hints for `RET` + let temp: (u32, i32); + { + temp.0 = i.0; + temp.1 = i.1; + + RET = temp; + Return() + } + ) +} + +// EMIT_MIR projections.unwrap.built.after.mir +#[custom_mir(dialect = "built")] +fn unwrap(opt: Option<i32>) -> i32 { + mir!({ + RET = Field(Variant(opt, 1), 0); + Return() + }) +} + +// EMIT_MIR projections.unwrap_deref.built.after.mir +#[custom_mir(dialect = "built")] +fn unwrap_deref(opt: Option<&i32>) -> i32 { + mir!({ + RET = *Field::<&i32>(Variant(opt, 1), 0); + Return() + }) +} + +// EMIT_MIR projections.set.built.after.mir +#[custom_mir(dialect = "built")] +fn set(opt: &mut Option<i32>) { + mir!({ + place!(Field(Variant(*opt, 1), 0)) = 10; + Return() + }) +} + +// EMIT_MIR projections.simple_index.built.after.mir +#[custom_mir(dialect = "built")] +fn simple_index(a: [i32; 10], b: &[i32]) -> i32 { + mir!({ + let temp = 3; + RET = a[temp]; + RET = (*b)[temp]; + Return() + }) +} + +fn main() { + assert_eq!(unions(U { a: 5 }), 5); + assert_eq!(tuples((5, 6)), (5, 6)); + + assert_eq!(unwrap(Some(5)), 5); + assert_eq!(unwrap_deref(Some(&5)), 5); + let mut o = Some(5); + set(&mut o); + assert_eq!(o, Some(10)); + + assert_eq!(simple_index([0; 10], &[0; 10]), 0); +} diff --git a/tests/mir-opt/building/custom/projections.set.built.after.mir b/tests/mir-opt/building/custom/projections.set.built.after.mir new file mode 100644 index 000000000..2f15176a6 --- /dev/null +++ b/tests/mir-opt/building/custom/projections.set.built.after.mir @@ -0,0 +1,10 @@ +// MIR for `set` after built + +fn set(_1: &mut Option<i32>) -> () { + let mut _0: (); // return place in scope 0 at $DIR/projections.rs:+0:31: +0:31 + + bb0: { + (((*_1) as variant#1).0: i32) = const 10_i32; // scope 0 at $DIR/projections.rs:+2:9: +2:48 + return; // scope 0 at $DIR/projections.rs:+3:9: +3:17 + } +} diff --git a/tests/mir-opt/building/custom/projections.simple_index.built.after.mir b/tests/mir-opt/building/custom/projections.simple_index.built.after.mir new file mode 100644 index 000000000..fc422e4b3 --- /dev/null +++ b/tests/mir-opt/building/custom/projections.simple_index.built.after.mir @@ -0,0 +1,13 @@ +// MIR for `simple_index` after built + +fn simple_index(_1: [i32; 10], _2: &[i32]) -> i32 { + let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:45: +0:48 + let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL + + bb0: { + _3 = const 3_usize; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL + _0 = _1[_3]; // scope 0 at $DIR/projections.rs:+3:9: +3:22 + _0 = (*_2)[_3]; // scope 0 at $DIR/projections.rs:+4:9: +4:25 + return; // scope 0 at $DIR/projections.rs:+5:9: +5:17 + } +} diff --git a/tests/mir-opt/building/custom/projections.tuples.built.after.mir b/tests/mir-opt/building/custom/projections.tuples.built.after.mir new file mode 100644 index 000000000..65487d3c9 --- /dev/null +++ b/tests/mir-opt/building/custom/projections.tuples.built.after.mir @@ -0,0 +1,13 @@ +// MIR for `tuples` after built + +fn tuples(_1: (u32, i32)) -> (u32, i32) { + let mut _0: (u32, i32); // return place in scope 0 at $DIR/projections.rs:+0:29: +0:39 + let mut _2: (u32, i32); // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL + + bb0: { + (_2.0: u32) = (_1.0: u32); // scope 0 at $DIR/projections.rs:+5:13: +5:25 + (_2.1: i32) = (_1.1: i32); // scope 0 at $DIR/projections.rs:+6:13: +6:25 + _0 = _2; // scope 0 at $DIR/projections.rs:+8:13: +8:23 + return; // scope 0 at $DIR/projections.rs:+9:13: +9:21 + } +} diff --git a/tests/mir-opt/building/custom/projections.unions.built.after.mir b/tests/mir-opt/building/custom/projections.unions.built.after.mir new file mode 100644 index 000000000..922538a5f --- /dev/null +++ b/tests/mir-opt/building/custom/projections.unions.built.after.mir @@ -0,0 +1,10 @@ +// MIR for `unions` after built + +fn unions(_1: U) -> i32 { + let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:20: +0:23 + + bb0: { + _0 = (_1.0: i32); // scope 0 at $DIR/projections.rs:+2:9: +2:18 + return; // scope 0 at $DIR/projections.rs:+3:9: +3:17 + } +} diff --git a/tests/mir-opt/building/custom/projections.unwrap.built.after.mir b/tests/mir-opt/building/custom/projections.unwrap.built.after.mir new file mode 100644 index 000000000..75b03a3c3 --- /dev/null +++ b/tests/mir-opt/building/custom/projections.unwrap.built.after.mir @@ -0,0 +1,10 @@ +// MIR for `unwrap` after built + +fn unwrap(_1: Option<i32>) -> i32 { + let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:32: +0:35 + + bb0: { + _0 = ((_1 as variant#1).0: i32); // scope 0 at $DIR/projections.rs:+2:9: +2:40 + return; // scope 0 at $DIR/projections.rs:+3:9: +3:17 + } +} diff --git a/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir b/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir new file mode 100644 index 000000000..c6b0f7efa --- /dev/null +++ b/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir @@ -0,0 +1,10 @@ +// MIR for `unwrap_deref` after built + +fn unwrap_deref(_1: Option<&i32>) -> i32 { + let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:39: +0:42 + + bb0: { + _0 = (*((_1 as variant#1).0: &i32)); // scope 0 at $DIR/projections.rs:+2:9: +2:49 + return; // scope 0 at $DIR/projections.rs:+3:9: +3:17 + } +} diff --git a/src/test/mir-opt/building/custom/references.immut_ref.built.after.mir b/tests/mir-opt/building/custom/references.immut_ref.built.after.mir index 4d38d45c0..f5ee11262 100644 --- a/src/test/mir-opt/building/custom/references.immut_ref.built.after.mir +++ b/tests/mir-opt/building/custom/references.immut_ref.built.after.mir @@ -6,9 +6,8 @@ fn immut_ref(_1: &i32) -> &i32 { bb0: { _2 = &raw const (*_1); // scope 0 at $DIR/references.rs:+5:13: +5:29 - Retag([raw] _2); // scope 0 at $DIR/references.rs:+6:13: +6:24 - _0 = &(*_2); // scope 0 at $DIR/references.rs:+7:13: +7:23 - Retag(_0); // scope 0 at $DIR/references.rs:+8:13: +8:23 - return; // scope 0 at $DIR/references.rs:+9:13: +9:21 + _0 = &(*_2); // scope 0 at $DIR/references.rs:+6:13: +6:23 + Retag(_0); // scope 0 at $DIR/references.rs:+7:13: +7:23 + return; // scope 0 at $DIR/references.rs:+8:13: +8:21 } } diff --git a/src/test/mir-opt/building/custom/references.mut_ref.built.after.mir b/tests/mir-opt/building/custom/references.mut_ref.built.after.mir index 01bc8a9cd..8e2ffc33b 100644 --- a/src/test/mir-opt/building/custom/references.mut_ref.built.after.mir +++ b/tests/mir-opt/building/custom/references.mut_ref.built.after.mir @@ -6,9 +6,8 @@ fn mut_ref(_1: &mut i32) -> &mut i32 { bb0: { _2 = &raw mut (*_1); // scope 0 at $DIR/references.rs:+5:13: +5:33 - Retag([raw] _2); // scope 0 at $DIR/references.rs:+6:13: +6:24 - _0 = &mut (*_2); // scope 0 at $DIR/references.rs:+7:13: +7:26 - Retag(_0); // scope 0 at $DIR/references.rs:+8:13: +8:23 - return; // scope 0 at $DIR/references.rs:+9:13: +9:21 + _0 = &mut (*_2); // scope 0 at $DIR/references.rs:+6:13: +6:26 + Retag(_0); // scope 0 at $DIR/references.rs:+7:13: +7:23 + return; // scope 0 at $DIR/references.rs:+8:13: +8:21 } } diff --git a/tests/mir-opt/building/custom/references.raw_pointer.built.after.mir b/tests/mir-opt/building/custom/references.raw_pointer.built.after.mir new file mode 100644 index 000000000..775e5e3ad --- /dev/null +++ b/tests/mir-opt/building/custom/references.raw_pointer.built.after.mir @@ -0,0 +1,10 @@ +// MIR for `raw_pointer` after built + +fn raw_pointer(_1: *const i32) -> *const i32 { + let mut _0: *const i32; // return place in scope 0 at $DIR/references.rs:+0:38: +0:48 + + bb0: { + _0 = &raw const (*_1); // scope 0 at $DIR/references.rs:+4:9: +4:27 + return; // scope 0 at $DIR/references.rs:+5:9: +5:17 + } +} diff --git a/tests/mir-opt/building/custom/references.rs b/tests/mir-opt/building/custom/references.rs new file mode 100644 index 000000000..a1c896de0 --- /dev/null +++ b/tests/mir-opt/building/custom/references.rs @@ -0,0 +1,55 @@ +#![feature(custom_mir, core_intrinsics)] + +extern crate core; +use core::intrinsics::mir::*; +use core::ptr::{addr_of, addr_of_mut}; + +// EMIT_MIR references.mut_ref.built.after.mir +#[custom_mir(dialect = "runtime", phase = "optimized")] +pub fn mut_ref(x: &mut i32) -> &mut i32 { + mir!( + let t: *mut i32; + + { + t = addr_of_mut!(*x); + RET = &mut *t; + Retag(RET); + Return() + } + ) +} + +// EMIT_MIR references.immut_ref.built.after.mir +#[custom_mir(dialect = "runtime", phase = "optimized")] +pub fn immut_ref(x: &i32) -> &i32 { + mir!( + let t: *const i32; + + { + t = addr_of!(*x); + RET = & *t; + Retag(RET); + Return() + } + ) +} + +// EMIT_MIR references.raw_pointer.built.after.mir +#[custom_mir(dialect = "built")] +pub fn raw_pointer(x: *const i32) -> *const i32 { + // Regression test for a bug in which unsafetyck was not correctly turned off for + // `dialect = "built"` + mir!({ + RET = addr_of!(*x); + Return() + }) +} + +fn main() { + let mut x = 5; + assert_eq!(*mut_ref(&mut x), 5); + assert_eq!(*immut_ref(&x), 5); + unsafe { + assert_eq!(*raw_pointer(addr_of!(x)), 5); + } +} diff --git a/src/test/mir-opt/building/custom/simple_assign.rs b/tests/mir-opt/building/custom/simple_assign.rs index ec6dbe1d0..db041aab2 100644 --- a/src/test/mir-opt/building/custom/simple_assign.rs +++ b/tests/mir-opt/building/custom/simple_assign.rs @@ -11,12 +11,14 @@ pub fn simple(x: i32) -> i32 { let temp2: _; { + StorageLive(temp1); temp1 = x; Goto(exit) } exit = { temp2 = Move(temp1); + StorageDead(temp1); RET = temp2; Return() } diff --git a/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir b/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir new file mode 100644 index 000000000..743016708 --- /dev/null +++ b/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir @@ -0,0 +1,20 @@ +// MIR for `simple` after built + +fn simple(_1: i32) -> i32 { + let mut _0: i32; // return place in scope 0 at $DIR/simple_assign.rs:+0:26: +0:29 + let mut _2: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL + let mut _3: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL + + bb0: { + StorageLive(_2); // scope 0 at $DIR/simple_assign.rs:+6:13: +6:31 + _2 = _1; // scope 0 at $DIR/simple_assign.rs:+7:13: +7:22 + goto -> bb1; // scope 0 at $DIR/simple_assign.rs:+8:13: +8:23 + } + + bb1: { + _3 = move _2; // scope 0 at $DIR/simple_assign.rs:+12:13: +12:32 + StorageDead(_2); // scope 0 at $DIR/simple_assign.rs:+13:13: +13:31 + _0 = _3; // scope 0 at $DIR/simple_assign.rs:+14:13: +14:24 + return; // scope 0 at $DIR/simple_assign.rs:+15:13: +15:21 + } +} diff --git a/src/test/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir b/tests/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir index 2b0e8f104..2b0e8f104 100644 --- a/src/test/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir +++ b/tests/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir diff --git a/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir b/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir new file mode 100644 index 000000000..a1a27226b --- /dev/null +++ b/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir @@ -0,0 +1,17 @@ +// MIR for `assert_nonzero` after built + +fn assert_nonzero(_1: i32) -> () { + let mut _0: (); // return place in scope 0 at $DIR/terminators.rs:+0:27: +0:27 + + bb0: { + switchInt(_1) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/terminators.rs:+3:13: +6:14 + } + + bb1: { + unreachable; // scope 0 at $DIR/terminators.rs:+10:13: +10:26 + } + + bb2: { + return; // scope 0 at $DIR/terminators.rs:+14:13: +14:21 + } +} diff --git a/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir b/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir new file mode 100644 index 000000000..1b2345a96 --- /dev/null +++ b/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir @@ -0,0 +1,16 @@ +// MIR for `direct_call` after built + +fn direct_call(_1: i32) -> i32 { + let mut _0: i32; // return place in scope 0 at $DIR/terminators.rs:+0:27: +0:30 + + bb0: { + _0 = ident::<i32>(_1) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:42 + // mir::Constant + // + span: $DIR/terminators.rs:15:33: 15:38 + // + literal: Const { ty: fn(i32) -> i32 {ident::<i32>}, val: Value(<ZST>) } + } + + bb1: { + return; // scope 0 at $DIR/terminators.rs:+7:13: +7:21 + } +} diff --git a/tests/mir-opt/building/custom/terminators.drop_first.built.after.mir b/tests/mir-opt/building/custom/terminators.drop_first.built.after.mir new file mode 100644 index 000000000..c903e5946 --- /dev/null +++ b/tests/mir-opt/building/custom/terminators.drop_first.built.after.mir @@ -0,0 +1,13 @@ +// MIR for `drop_first` after built + +fn drop_first(_1: WriteOnDrop<'_>, _2: WriteOnDrop<'_>) -> () { + let mut _0: (); // return place in scope 0 at $DIR/terminators.rs:+0:59: +0:59 + + bb0: { + replace(_1 <- move _2) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:49 + } + + bb1: { + return; // scope 0 at $DIR/terminators.rs:+7:13: +7:21 + } +} diff --git a/tests/mir-opt/building/custom/terminators.drop_second.built.after.mir b/tests/mir-opt/building/custom/terminators.drop_second.built.after.mir new file mode 100644 index 000000000..f14246f2d --- /dev/null +++ b/tests/mir-opt/building/custom/terminators.drop_second.built.after.mir @@ -0,0 +1,13 @@ +// MIR for `drop_second` after built + +fn drop_second(_1: WriteOnDrop<'_>, _2: WriteOnDrop<'_>) -> () { + let mut _0: (); // return place in scope 0 at $DIR/terminators.rs:+0:60: +0:60 + + bb0: { + drop(_2) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:30 + } + + bb1: { + return; // scope 0 at $DIR/terminators.rs:+7:13: +7:21 + } +} diff --git a/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir b/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir new file mode 100644 index 000000000..2f1b14069 --- /dev/null +++ b/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir @@ -0,0 +1,13 @@ +// MIR for `indirect_call` after built + +fn indirect_call(_1: i32, _2: fn(i32) -> i32) -> i32 { + let mut _0: i32; // return place in scope 0 at $DIR/terminators.rs:+0:48: +0:51 + + bb0: { + _0 = _2(_1) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:38 + } + + bb1: { + return; // scope 0 at $DIR/terminators.rs:+7:13: +7:21 + } +} diff --git a/tests/mir-opt/building/custom/terminators.rs b/tests/mir-opt/building/custom/terminators.rs new file mode 100644 index 000000000..c23233fcf --- /dev/null +++ b/tests/mir-opt/building/custom/terminators.rs @@ -0,0 +1,108 @@ +#![feature(custom_mir, core_intrinsics)] + +extern crate core; +use core::intrinsics::mir::*; + +fn ident<T>(t: T) -> T { + t +} + +// EMIT_MIR terminators.direct_call.built.after.mir +#[custom_mir(dialect = "built")] +fn direct_call(x: i32) -> i32 { + mir!( + { + Call(RET, retblock, ident(x)) + } + + retblock = { + Return() + } + ) +} + +// EMIT_MIR terminators.indirect_call.built.after.mir +#[custom_mir(dialect = "built")] +fn indirect_call(x: i32, f: fn(i32) -> i32) -> i32 { + mir!( + { + Call(RET, retblock, f(x)) + } + + retblock = { + Return() + } + ) +} + +struct WriteOnDrop<'a>(&'a mut i32, i32); + +impl<'a> Drop for WriteOnDrop<'a> { + fn drop(&mut self) { + *self.0 = self.1; + } +} + +// EMIT_MIR terminators.drop_first.built.after.mir +#[custom_mir(dialect = "built")] +fn drop_first<'a>(a: WriteOnDrop<'a>, b: WriteOnDrop<'a>) { + mir!( + { + DropAndReplace(a, Move(b), retblock) + } + + retblock = { + Return() + } + ) +} + +// EMIT_MIR terminators.drop_second.built.after.mir +#[custom_mir(dialect = "built")] +fn drop_second<'a>(a: WriteOnDrop<'a>, b: WriteOnDrop<'a>) { + mir!( + { + Drop(b, retblock) + } + + retblock = { + Return() + } + ) +} + +// EMIT_MIR terminators.assert_nonzero.built.after.mir +#[custom_mir(dialect = "built")] +fn assert_nonzero(a: i32) { + mir!( + { + match a { + 0 => unreachable, + _ => retblock + } + } + + unreachable = { + Unreachable() + } + + retblock = { + Return() + } + ) +} + +fn main() { + assert_eq!(direct_call(5), 5); + assert_eq!(indirect_call(5, ident), 5); + + let mut a = 0; + let mut b = 0; + drop_first(WriteOnDrop(&mut a, 1), WriteOnDrop(&mut b, 1)); + assert_eq!((a, b), (1, 0)); + + let mut a = 0; + let mut b = 0; + drop_second(WriteOnDrop(&mut a, 1), WriteOnDrop(&mut b, 1)); + assert_eq!((a, b), (0, 1)); +} diff --git a/src/test/mir-opt/building/enum_cast.bar.built.after.mir b/tests/mir-opt/building/enum_cast.bar.built.after.mir index 0746e0b49..0746e0b49 100644 --- a/src/test/mir-opt/building/enum_cast.bar.built.after.mir +++ b/tests/mir-opt/building/enum_cast.bar.built.after.mir diff --git a/src/test/mir-opt/building/enum_cast.boo.built.after.mir b/tests/mir-opt/building/enum_cast.boo.built.after.mir index 699c876b0..699c876b0 100644 --- a/src/test/mir-opt/building/enum_cast.boo.built.after.mir +++ b/tests/mir-opt/building/enum_cast.boo.built.after.mir diff --git a/src/test/mir-opt/building/enum_cast.droppy.built.after.mir b/tests/mir-opt/building/enum_cast.droppy.built.after.mir index 5231c2eab..5231c2eab 100644 --- a/src/test/mir-opt/building/enum_cast.droppy.built.after.mir +++ b/tests/mir-opt/building/enum_cast.droppy.built.after.mir diff --git a/src/test/mir-opt/building/enum_cast.foo.built.after.mir b/tests/mir-opt/building/enum_cast.foo.built.after.mir index 17e0abf2e..17e0abf2e 100644 --- a/src/test/mir-opt/building/enum_cast.foo.built.after.mir +++ b/tests/mir-opt/building/enum_cast.foo.built.after.mir diff --git a/src/test/mir-opt/building/enum_cast.rs b/tests/mir-opt/building/enum_cast.rs index 98fd5acfb..98fd5acfb 100644 --- a/src/test/mir-opt/building/enum_cast.rs +++ b/tests/mir-opt/building/enum_cast.rs diff --git a/src/test/mir-opt/building/issue_101867.main.built.after.mir b/tests/mir-opt/building/issue_101867.main.built.after.mir index 0ebd840cf..628a33f10 100644 --- a/src/test/mir-opt/building/issue_101867.main.built.after.mir +++ b/tests/mir-opt/building/issue_101867.main.built.after.mir @@ -27,7 +27,7 @@ fn main() -> () { StorageLive(_5); // scope 1 at $DIR/issue_101867.rs:+2:14: +2:15 FakeRead(ForMatchedPlace(None), _1); // scope 1 at $DIR/issue_101867.rs:+2:19: +2:20 _6 = discriminant(_1); // scope 1 at $DIR/issue_101867.rs:+2:19: +2:20 - switchInt(move _6) -> [1_isize: bb4, otherwise: bb3]; // scope 1 at $DIR/issue_101867.rs:+2:9: +2:16 + switchInt(move _6) -> [1: bb4, otherwise: bb3]; // scope 1 at $DIR/issue_101867.rs:+2:9: +2:16 } bb1: { diff --git a/src/test/mir-opt/building/issue_101867.rs b/tests/mir-opt/building/issue_101867.rs index a32d8cb37..a32d8cb37 100644 --- a/src/test/mir-opt/building/issue_101867.rs +++ b/tests/mir-opt/building/issue_101867.rs diff --git a/src/test/mir-opt/building/issue_49232.main.built.after.mir b/tests/mir-opt/building/issue_49232.main.built.after.mir index 9182bcaa2..de5e4c0f6 100644 --- a/src/test/mir-opt/building/issue_49232.main.built.after.mir +++ b/tests/mir-opt/building/issue_49232.main.built.after.mir @@ -25,7 +25,7 @@ fn main() -> () { StorageLive(_3); // scope 0 at $DIR/issue_49232.rs:+3:19: +3:23 _3 = const true; // scope 0 at $DIR/issue_49232.rs:+3:19: +3:23 FakeRead(ForMatchedPlace(None), _3); // scope 0 at $DIR/issue_49232.rs:+3:19: +3:23 - switchInt(_3) -> [false: bb3, otherwise: bb4]; // scope 0 at $DIR/issue_49232.rs:+3:13: +3:23 + switchInt(_3) -> [0: bb3, otherwise: bb4]; // scope 0 at $DIR/issue_49232.rs:+3:13: +3:23 } bb3: { diff --git a/src/test/mir-opt/building/issue_49232.rs b/tests/mir-opt/building/issue_49232.rs index 7e9f0de81..7e9f0de81 100644 --- a/src/test/mir-opt/building/issue_49232.rs +++ b/tests/mir-opt/building/issue_49232.rs diff --git a/src/test/mir-opt/building/match_false_edges.full_tested_match.built.after.mir b/tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir index 9a190c3d6..cb36bc64d 100644 --- a/src/test/mir-opt/building/match_false_edges.full_tested_match.built.after.mir +++ b/tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir @@ -28,7 +28,7 @@ fn full_tested_match() -> () { _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27 FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27 _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27 - switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:27 + switchInt(move _3) -> [0: bb1, 1: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:27 } bb1: { @@ -60,7 +60,7 @@ fn full_tested_match() -> () { } bb6: { - switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 + switchInt(move _7) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 } bb7: { diff --git a/src/test/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir b/tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir index 1c9953e7e..7f8755faa 100644 --- a/src/test/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir +++ b/tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir @@ -28,7 +28,7 @@ fn full_tested_match2() -> () { _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27 FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27 _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27 - switchInt(move _3) -> [0_isize: bb1, 1_isize: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:27 + switchInt(move _3) -> [0: bb1, 1: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:27 } bb1: { @@ -66,7 +66,7 @@ fn full_tested_match2() -> () { } bb6: { - switchInt(move _7) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 + switchInt(move _7) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 } bb7: { diff --git a/src/test/mir-opt/building/match_false_edges.main.built.after.mir b/tests/mir-opt/building/match_false_edges.main.built.after.mir index 08c67d39d..e8b93f437 100644 --- a/src/test/mir-opt/building/match_false_edges.main.built.after.mir +++ b/tests/mir-opt/building/match_false_edges.main.built.after.mir @@ -39,7 +39,7 @@ fn main() -> () { _2 = Option::<i32>::Some(const 1_i32); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26 FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26 _4 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26 - switchInt(move _4) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26 + switchInt(move _4) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26 } bb1: { @@ -56,7 +56,7 @@ fn main() -> () { bb4: { _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26 - switchInt(move _3) -> [1_isize: bb6, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26 + switchInt(move _3) -> [1: bb6, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26 } bb5: { @@ -87,7 +87,7 @@ fn main() -> () { } bb9: { - switchInt(move _8) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28 + switchInt(move _8) -> [0: bb11, otherwise: bb10]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28 } bb10: { @@ -134,7 +134,7 @@ fn main() -> () { } bb15: { - switchInt(move _12) -> [false: bb17, otherwise: bb16]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29 + switchInt(move _12) -> [0: bb17, otherwise: bb16]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29 } bb16: { diff --git a/src/test/mir-opt/building/match_false_edges.rs b/tests/mir-opt/building/match_false_edges.rs index ddfcc1493..ddfcc1493 100644 --- a/src/test/mir-opt/building/match_false_edges.rs +++ b/tests/mir-opt/building/match_false_edges.rs diff --git a/src/test/mir-opt/building/receiver_ptr_mutability.main.built.after.mir b/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir index 41eb00363..41eb00363 100644 --- a/src/test/mir-opt/building/receiver_ptr_mutability.main.built.after.mir +++ b/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir diff --git a/src/test/mir-opt/building/receiver_ptr_mutability.rs b/tests/mir-opt/building/receiver_ptr_mutability.rs index 668530968..668530968 100644 --- a/src/test/mir-opt/building/receiver_ptr_mutability.rs +++ b/tests/mir-opt/building/receiver_ptr_mutability.rs diff --git a/src/test/mir-opt/building/simple_match.match_bool.built.after.mir b/tests/mir-opt/building/simple_match.match_bool.built.after.mir index a4516026c..aa2fd4632 100644 --- a/src/test/mir-opt/building/simple_match.match_bool.built.after.mir +++ b/tests/mir-opt/building/simple_match.match_bool.built.after.mir @@ -6,7 +6,7 @@ fn match_bool(_1: bool) -> usize { bb0: { FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/simple_match.rs:+1:11: +1:12 - switchInt(_1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/simple_match.rs:+1:5: +1:12 + switchInt(_1) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/simple_match.rs:+1:5: +1:12 } bb1: { diff --git a/src/test/mir-opt/building/simple_match.rs b/tests/mir-opt/building/simple_match.rs index 0ef97dde6..0ef97dde6 100644 --- a/src/test/mir-opt/building/simple_match.rs +++ b/tests/mir-opt/building/simple_match.rs diff --git a/src/test/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir b/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir index 1d3f77e07..1d3f77e07 100644 --- a/src/test/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir +++ b/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir diff --git a/src/test/mir-opt/building/storage_live_dead_in_statics.rs b/tests/mir-opt/building/storage_live_dead_in_statics.rs index 79f709148..79f709148 100644 --- a/src/test/mir-opt/building/storage_live_dead_in_statics.rs +++ b/tests/mir-opt/building/storage_live_dead_in_statics.rs diff --git a/src/test/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir b/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir index 234cd0839..234cd0839 100644 --- a/src/test/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir +++ b/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir diff --git a/src/test/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir b/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir index 24a189498..24a189498 100644 --- a/src/test/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir +++ b/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir diff --git a/src/test/mir-opt/building/uniform_array_move_out.rs b/tests/mir-opt/building/uniform_array_move_out.rs index e925036ec..e925036ec 100644 --- a/src/test/mir-opt/building/uniform_array_move_out.rs +++ b/tests/mir-opt/building/uniform_array_move_out.rs diff --git a/src/test/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir index 73f5655a1..73f5655a1 100644 --- a/src/test/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir diff --git a/src/test/mir-opt/byte_slice.rs b/tests/mir-opt/byte_slice.rs index 48e9c48c1..48e9c48c1 100644 --- a/src/test/mir-opt/byte_slice.rs +++ b/tests/mir-opt/byte_slice.rs diff --git a/src/test/mir-opt/combine_array_len.norm2.InstCombine.diff b/tests/mir-opt/combine_array_len.norm2.InstCombine.diff index c73150f94..c73150f94 100644 --- a/src/test/mir-opt/combine_array_len.norm2.InstCombine.diff +++ b/tests/mir-opt/combine_array_len.norm2.InstCombine.diff diff --git a/src/test/mir-opt/combine_array_len.rs b/tests/mir-opt/combine_array_len.rs index 3ef3bd09a..3ef3bd09a 100644 --- a/src/test/mir-opt/combine_array_len.rs +++ b/tests/mir-opt/combine_array_len.rs diff --git a/src/test/mir-opt/combine_clone_of_primitives.rs b/tests/mir-opt/combine_clone_of_primitives.rs index 7cc50a86e..7cc50a86e 100644 --- a/src/test/mir-opt/combine_clone_of_primitives.rs +++ b/tests/mir-opt/combine_clone_of_primitives.rs diff --git a/src/test/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff b/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff index 6f01553ee..6f01553ee 100644 --- a/src/test/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff +++ b/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff diff --git a/src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir b/tests/mir-opt/const_allocation.main.ConstProp.after.32bit.mir index da5a64cac..6140fc52f 100644 --- a/src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir +++ b/tests/mir-opt/const_allocation.main.ConstProp.after.32bit.mir @@ -10,12 +10,12 @@ fn main() -> () { StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8 _2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8 // mir::Constant - // + span: $DIR/const_allocation.rs:8:5: 8:8 + // + span: $DIR/const_allocation.rs:9:5: 9:8 // + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) } _1 = (*_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8 StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9 StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9 - nop; // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2 + _0 = const (); // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2 return; // scope 0 at $DIR/const_allocation.rs:+2:2: +2:2 } } diff --git a/src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir b/tests/mir-opt/const_allocation.main.ConstProp.after.64bit.mir index febd99068..b2ed23c68 100644 --- a/src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir +++ b/tests/mir-opt/const_allocation.main.ConstProp.after.64bit.mir @@ -10,12 +10,12 @@ fn main() -> () { StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8 _2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8 // mir::Constant - // + span: $DIR/const_allocation.rs:8:5: 8:8 + // + span: $DIR/const_allocation.rs:9:5: 9:8 // + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) } _1 = (*_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8 StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9 StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9 - nop; // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2 + _0 = const (); // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2 return; // scope 0 at $DIR/const_allocation.rs:+2:2: +2:2 } } diff --git a/src/test/mir-opt/const_allocation.rs b/tests/mir-opt/const_allocation.rs index b0fcb86fc..91a2455eb 100644 --- a/src/test/mir-opt/const_allocation.rs +++ b/tests/mir-opt/const_allocation.rs @@ -1,3 +1,4 @@ +// unit-test: ConstProp // ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH static FOO: &[(Option<i32>, &[&str])] = diff --git a/src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir b/tests/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir index 389641f20..aab005c52 100644 --- a/src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir +++ b/tests/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir @@ -10,12 +10,12 @@ fn main() -> () { StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8 _2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8 // mir::Constant - // + span: $DIR/const_allocation2.rs:5:5: 5:8 + // + span: $DIR/const_allocation2.rs:6:5: 6:8 // + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) } _1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8 StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9 StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9 - nop; // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2 + _0 = const (); // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2 return; // scope 0 at $DIR/const_allocation2.rs:+2:2: +2:2 } } diff --git a/src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir b/tests/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir index ce3848e92..0eff9474c 100644 --- a/src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir +++ b/tests/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir @@ -10,12 +10,12 @@ fn main() -> () { StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8 _2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8 // mir::Constant - // + span: $DIR/const_allocation2.rs:5:5: 5:8 + // + span: $DIR/const_allocation2.rs:6:5: 6:8 // + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) } _1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8 StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9 StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9 - nop; // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2 + _0 = const (); // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2 return; // scope 0 at $DIR/const_allocation2.rs:+2:2: +2:2 } } diff --git a/src/test/mir-opt/const_allocation2.rs b/tests/mir-opt/const_allocation2.rs index 30afedffb..f2870aa47 100644 --- a/src/test/mir-opt/const_allocation2.rs +++ b/tests/mir-opt/const_allocation2.rs @@ -1,3 +1,4 @@ +// unit-test: ConstProp // ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR const_allocation2.main.ConstProp.after.mir diff --git a/src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir b/tests/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir index b72519159..55c6db5d0 100644 --- a/src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir +++ b/tests/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir @@ -10,12 +10,12 @@ fn main() -> () { StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8 _2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8 // mir::Constant - // + span: $DIR/const_allocation3.rs:5:5: 5:8 + // + span: $DIR/const_allocation3.rs:6:5: 6:8 // + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) } _1 = (*_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8 StorageDead(_2); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9 StorageDead(_1); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9 - nop; // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2 + _0 = const (); // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2 return; // scope 0 at $DIR/const_allocation3.rs:+2:2: +2:2 } } diff --git a/src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir b/tests/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir index 6bd047c7d..27492a7fd 100644 --- a/src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir +++ b/tests/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir @@ -10,12 +10,12 @@ fn main() -> () { StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8 _2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8 // mir::Constant - // + span: $DIR/const_allocation3.rs:5:5: 5:8 + // + span: $DIR/const_allocation3.rs:6:5: 6:8 // + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) } _1 = (*_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8 StorageDead(_2); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9 StorageDead(_1); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9 - nop; // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2 + _0 = const (); // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2 return; // scope 0 at $DIR/const_allocation3.rs:+2:2: +2:2 } } diff --git a/src/test/mir-opt/const_allocation3.rs b/tests/mir-opt/const_allocation3.rs index ddeb32ab9..da3fd089b 100644 --- a/src/test/mir-opt/const_allocation3.rs +++ b/tests/mir-opt/const_allocation3.rs @@ -1,3 +1,4 @@ +// unit-test: ConstProp // ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR const_allocation3.main.ConstProp.after.mir diff --git a/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff b/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff new file mode 100644 index 000000000..dd548adde --- /dev/null +++ b/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff @@ -0,0 +1,126 @@ +- // MIR for `main` before ConstDebugInfo ++ // MIR for `main` after ConstDebugInfo + + fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/const_debuginfo.rs:+0:11: +0:11 + let _1: u8; // in scope 0 at $DIR/const_debuginfo.rs:+1:9: +1:10 + let mut _5: u8; // in scope 0 at $DIR/const_debuginfo.rs:+4:15: +4:20 + let mut _6: u8; // in scope 0 at $DIR/const_debuginfo.rs:+4:15: +4:16 + let mut _7: u8; // in scope 0 at $DIR/const_debuginfo.rs:+4:19: +4:20 + let mut _8: u8; // in scope 0 at $DIR/const_debuginfo.rs:+4:23: +4:24 + let mut _12: u32; // in scope 0 at $DIR/const_debuginfo.rs:+13:13: +13:16 + let mut _13: u32; // in scope 0 at $DIR/const_debuginfo.rs:+13:19: +13:22 + scope 1 { +- debug x => _1; // in scope 1 at $DIR/const_debuginfo.rs:+1:9: +1:10 ++ debug x => const 1_u8; // in scope 1 at $DIR/const_debuginfo.rs:+1:9: +1:10 + let _2: u8; // in scope 1 at $DIR/const_debuginfo.rs:+2:9: +2:10 + scope 2 { +- debug y => _2; // in scope 2 at $DIR/const_debuginfo.rs:+2:9: +2:10 ++ debug y => const 2_u8; // in scope 2 at $DIR/const_debuginfo.rs:+2:9: +2:10 + let _3: u8; // in scope 2 at $DIR/const_debuginfo.rs:+3:9: +3:10 + scope 3 { +- debug z => _3; // in scope 3 at $DIR/const_debuginfo.rs:+3:9: +3:10 ++ debug z => const 3_u8; // in scope 3 at $DIR/const_debuginfo.rs:+3:9: +3:10 + let _4: u8; // in scope 3 at $DIR/const_debuginfo.rs:+4:9: +4:12 + scope 4 { +- debug sum => _4; // in scope 4 at $DIR/const_debuginfo.rs:+4:9: +4:12 ++ debug sum => const 6_u8; // in scope 4 at $DIR/const_debuginfo.rs:+4:9: +4:12 + let _9: &str; // in scope 4 at $DIR/const_debuginfo.rs:+6:9: +6:10 + scope 5 { +- debug s => _9; // in scope 5 at $DIR/const_debuginfo.rs:+6:9: +6:10 ++ debug s => const "hello, world!"; // in scope 5 at $DIR/const_debuginfo.rs:+6:9: +6:10 + let _14: bool; // in scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10 + let _15: bool; // in scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10 + let _16: u32; // in scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10 + scope 6 { + debug f => (bool, bool, u32){ .0 => _14, .1 => _15, .2 => _16, }; // in scope 6 at $DIR/const_debuginfo.rs:+8:9: +8:10 + let _10: std::option::Option<u16>; // in scope 6 at $DIR/const_debuginfo.rs:+10:9: +10:10 + scope 7 { + debug o => _10; // in scope 7 at $DIR/const_debuginfo.rs:+10:9: +10:10 + let _17: u32; // in scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10 + let _18: u32; // in scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10 + scope 8 { + debug p => Point{ .0 => _17, .1 => _18, }; // in scope 8 at $DIR/const_debuginfo.rs:+12:9: +12:10 + let _11: u32; // in scope 8 at $DIR/const_debuginfo.rs:+13:9: +13:10 + scope 9 { +- debug a => _11; // in scope 9 at $DIR/const_debuginfo.rs:+13:9: +13:10 ++ debug a => const 64_u32; // in scope 9 at $DIR/const_debuginfo.rs:+13:9: +13:10 + } + } + } + } + } + } + } + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/const_debuginfo.rs:+1:9: +1:10 + _1 = const 1_u8; // scope 0 at $DIR/const_debuginfo.rs:+1:13: +1:16 + StorageLive(_2); // scope 1 at $DIR/const_debuginfo.rs:+2:9: +2:10 + _2 = const 2_u8; // scope 1 at $DIR/const_debuginfo.rs:+2:13: +2:16 + StorageLive(_3); // scope 2 at $DIR/const_debuginfo.rs:+3:9: +3:10 + _3 = const 3_u8; // scope 2 at $DIR/const_debuginfo.rs:+3:13: +3:16 + StorageLive(_4); // scope 3 at $DIR/const_debuginfo.rs:+4:9: +4:12 + StorageLive(_5); // scope 3 at $DIR/const_debuginfo.rs:+4:15: +4:20 + StorageLive(_6); // scope 3 at $DIR/const_debuginfo.rs:+4:15: +4:16 + _6 = const 1_u8; // scope 3 at $DIR/const_debuginfo.rs:+4:15: +4:16 + StorageLive(_7); // scope 3 at $DIR/const_debuginfo.rs:+4:19: +4:20 + _7 = const 2_u8; // scope 3 at $DIR/const_debuginfo.rs:+4:19: +4:20 + _5 = const 3_u8; // scope 3 at $DIR/const_debuginfo.rs:+4:15: +4:20 + StorageDead(_7); // scope 3 at $DIR/const_debuginfo.rs:+4:19: +4:20 + StorageDead(_6); // scope 3 at $DIR/const_debuginfo.rs:+4:19: +4:20 + StorageLive(_8); // scope 3 at $DIR/const_debuginfo.rs:+4:23: +4:24 + _8 = const 3_u8; // scope 3 at $DIR/const_debuginfo.rs:+4:23: +4:24 + _4 = const 6_u8; // scope 3 at $DIR/const_debuginfo.rs:+4:15: +4:24 + StorageDead(_8); // scope 3 at $DIR/const_debuginfo.rs:+4:23: +4:24 + StorageDead(_5); // scope 3 at $DIR/const_debuginfo.rs:+4:23: +4:24 + StorageLive(_9); // scope 4 at $DIR/const_debuginfo.rs:+6:9: +6:10 + _9 = const "hello, world!"; // scope 4 at $DIR/const_debuginfo.rs:+6:13: +6:28 + // mir::Constant + // + span: $DIR/const_debuginfo.rs:14:13: 14:28 + // + literal: Const { ty: &str, val: Value(Slice(..)) } + StorageLive(_14); // scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10 + StorageLive(_15); // scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10 + StorageLive(_16); // scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10 + Deinit(_14); // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34 + Deinit(_15); // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34 + Deinit(_16); // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34 + _14 = const true; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34 + _15 = const false; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34 + _16 = const 123_u32; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34 + StorageLive(_10); // scope 6 at $DIR/const_debuginfo.rs:+10:9: +10:10 + Deinit(_10); // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24 + ((_10 as Some).0: u16) = const 99_u16; // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24 + discriminant(_10) = 1; // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24 + StorageLive(_17); // scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10 + StorageLive(_18); // scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10 + Deinit(_17); // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35 + Deinit(_18); // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35 + _17 = const 32_u32; // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35 + _18 = const 32_u32; // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35 + StorageLive(_11); // scope 8 at $DIR/const_debuginfo.rs:+13:9: +13:10 + StorageLive(_12); // scope 8 at $DIR/const_debuginfo.rs:+13:13: +13:16 + _12 = const 32_u32; // scope 8 at $DIR/const_debuginfo.rs:+13:13: +13:16 + StorageLive(_13); // scope 8 at $DIR/const_debuginfo.rs:+13:19: +13:22 + _13 = const 32_u32; // scope 8 at $DIR/const_debuginfo.rs:+13:19: +13:22 + _11 = const 64_u32; // scope 8 at $DIR/const_debuginfo.rs:+13:13: +13:22 + StorageDead(_13); // scope 8 at $DIR/const_debuginfo.rs:+13:21: +13:22 + StorageDead(_12); // scope 8 at $DIR/const_debuginfo.rs:+13:21: +13:22 + StorageDead(_11); // scope 8 at $DIR/const_debuginfo.rs:+14:1: +14:2 + StorageDead(_17); // scope 7 at $DIR/const_debuginfo.rs:+14:1: +14:2 + StorageDead(_18); // scope 7 at $DIR/const_debuginfo.rs:+14:1: +14:2 + StorageDead(_10); // scope 6 at $DIR/const_debuginfo.rs:+14:1: +14:2 + StorageDead(_14); // scope 5 at $DIR/const_debuginfo.rs:+14:1: +14:2 + StorageDead(_15); // scope 5 at $DIR/const_debuginfo.rs:+14:1: +14:2 + StorageDead(_16); // scope 5 at $DIR/const_debuginfo.rs:+14:1: +14:2 + StorageDead(_9); // scope 4 at $DIR/const_debuginfo.rs:+14:1: +14:2 + StorageDead(_4); // scope 3 at $DIR/const_debuginfo.rs:+14:1: +14:2 + StorageDead(_3); // scope 2 at $DIR/const_debuginfo.rs:+14:1: +14:2 + StorageDead(_2); // scope 1 at $DIR/const_debuginfo.rs:+14:1: +14:2 + StorageDead(_1); // scope 0 at $DIR/const_debuginfo.rs:+14:1: +14:2 + return; // scope 0 at $DIR/const_debuginfo.rs:+14:2: +14:2 + } + } + diff --git a/src/test/mir-opt/const_debuginfo.rs b/tests/mir-opt/const_debuginfo.rs index a188da385..a188da385 100644 --- a/src/test/mir-opt/const_debuginfo.rs +++ b/tests/mir-opt/const_debuginfo.rs diff --git a/src/test/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff b/tests/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff index fade2d0bc..a717d1bbd 100644 --- a/src/test/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff +++ b/tests/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff @@ -11,9 +11,9 @@ bb0: { - StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _3 = discriminant(_1); // scope 0 at $DIR/const_goto.rs:+1:17: +1:20 -- switchInt(move _3) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- switchInt(move _3) -> [1: bb2, 2: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _2 = discriminant(_1); // scope 0 at $DIR/const_goto.rs:+1:17: +1:20 -+ switchInt(move _2) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL ++ switchInt(move _2) -> [1: bb2, 2: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb1: { @@ -29,7 +29,7 @@ - } - - bb3: { -- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb4: { diff --git a/src/test/mir-opt/const_goto.rs b/tests/mir-opt/const_goto.rs index 6f84f186b..6f84f186b 100644 --- a/src/test/mir-opt/const_goto.rs +++ b/tests/mir-opt/const_goto.rs diff --git a/src/test/mir-opt/const_goto_const_eval_fail.f.ConstGoto.diff b/tests/mir-opt/const_goto_const_eval_fail.f.ConstGoto.diff index 623297aeb..24be8c9b8 100644 --- a/src/test/mir-opt/const_goto_const_eval_fail.f.ConstGoto.diff +++ b/tests/mir-opt/const_goto_const_eval_fail.f.ConstGoto.diff @@ -10,7 +10,7 @@ StorageLive(_1); // scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:11: +6:6 StorageLive(_2); // scope 0 at $DIR/const_goto_const_eval_fail.rs:+2:15: +2:16 _2 = const A; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+2:15: +2:16 - switchInt(_2) -> [1_i32: bb2, 2_i32: bb2, 3_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+2:9: +2:16 + switchInt(_2) -> [1: bb2, 2: bb2, 3: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+2:9: +2:16 } bb1: { @@ -21,11 +21,11 @@ bb2: { _1 = const B; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+3:26: +3:27 - goto -> bb3; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+3:26: +3:27 -+ switchInt(_1) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:5: +6:6 ++ switchInt(_1) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:5: +6:6 } bb3: { -- switchInt(_1) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:5: +6:6 +- switchInt(_1) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:+1:5: +6:6 - } - - bb4: { diff --git a/src/test/mir-opt/const_goto_const_eval_fail.rs b/tests/mir-opt/const_goto_const_eval_fail.rs index 3b85fe6ab..3b85fe6ab 100644 --- a/src/test/mir-opt/const_goto_const_eval_fail.rs +++ b/tests/mir-opt/const_goto_const_eval_fail.rs diff --git a/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff b/tests/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff index 81c356cb1..f54577259 100644 --- a/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff +++ b/tests/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff @@ -23,10 +23,10 @@ - StorageLive(_5); // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52 - StorageLive(_6); // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28 - _6 = const true; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28 -- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28 +- switchInt(move _6) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28 + StorageLive(_2); // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28 + _2 = const true; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28 -+ switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28 ++ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:+2:24: +2:28 } bb1: { @@ -41,7 +41,7 @@ - - bb3: { - StorageDead(_6); // scope 0 at $DIR/const_goto_storage.rs:+2:51: +2:52 -- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52 +- switchInt(move _5) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52 - } - - bb4: { @@ -56,7 +56,7 @@ - - bb6: { - StorageDead(_5); // scope 0 at $DIR/const_goto_storage.rs:+2:75: +2:76 -- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/const_goto_storage.rs:+2:18: +2:76 +- switchInt(move _4) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/const_goto_storage.rs:+2:18: +2:76 - } - - bb7: { @@ -70,7 +70,7 @@ - } - - bb9: { -- switchInt(move _3) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/const_goto_storage.rs:+2:15: +6:10 +- switchInt(move _3) -> [0: bb11, otherwise: bb10]; // scope 0 at $DIR/const_goto_storage.rs:+2:15: +6:10 - } - - bb10: { diff --git a/src/test/mir-opt/const_goto_storage.rs b/tests/mir-opt/const_goto_storage.rs index 459599c73..459599c73 100644 --- a/src/test/mir-opt/const_goto_storage.rs +++ b/tests/mir-opt/const_goto_storage.rs diff --git a/src/test/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir index 028480bdc..028480bdc 100644 --- a/src/test/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir diff --git a/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff b/tests/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff index 2ef437811..2ef437811 100644 --- a/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff +++ b/tests/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff diff --git a/src/test/mir-opt/const_promotion_extern_static.BOP.built.after.mir b/tests/mir-opt/const_promotion_extern_static.BOP.built.after.mir index 476fc49a1..476fc49a1 100644 --- a/src/test/mir-opt/const_promotion_extern_static.BOP.built.after.mir +++ b/tests/mir-opt/const_promotion_extern_static.BOP.built.after.mir diff --git a/src/test/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir index 41657b53f..41657b53f 100644 --- a/src/test/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir diff --git a/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff b/tests/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff index 25ba0face..25ba0face 100644 --- a/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff +++ b/tests/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff diff --git a/src/test/mir-opt/const_promotion_extern_static.rs b/tests/mir-opt/const_promotion_extern_static.rs index e4261cfe5..e4261cfe5 100644 --- a/src/test/mir-opt/const_promotion_extern_static.rs +++ b/tests/mir-opt/const_promotion_extern_static.rs diff --git a/src/test/mir-opt/const_prop/aggregate.main.ConstProp.diff b/tests/mir-opt/const_prop/aggregate.main.ConstProp.diff index 04378dbf3..04378dbf3 100644 --- a/src/test/mir-opt/const_prop/aggregate.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/aggregate.main.ConstProp.diff diff --git a/src/test/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir b/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir index cfc9a72e3..cfc9a72e3 100644 --- a/src/test/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir +++ b/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir diff --git a/src/test/mir-opt/const_prop/aggregate.rs b/tests/mir-opt/const_prop/aggregate.rs index 6a3080384..6a3080384 100644 --- a/src/test/mir-opt/const_prop/aggregate.rs +++ b/tests/mir-opt/const_prop/aggregate.rs diff --git a/src/test/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff b/tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff index 439b2a3e1..439b2a3e1 100644 --- a/src/test/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff +++ b/tests/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff diff --git a/src/test/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff b/tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff index 439b2a3e1..439b2a3e1 100644 --- a/src/test/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff +++ b/tests/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff diff --git a/src/test/mir-opt/const_prop/array_index.rs b/tests/mir-opt/const_prop/array_index.rs index d31c2827b..d31c2827b 100644 --- a/src/test/mir-opt/const_prop/array_index.rs +++ b/tests/mir-opt/const_prop/array_index.rs diff --git a/src/test/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff index bea32a67e..bea32a67e 100644 --- a/src/test/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff diff --git a/src/test/mir-opt/const_prop/bad_op_div_by_zero.rs b/tests/mir-opt/const_prop/bad_op_div_by_zero.rs index a6fd325ec..a6fd325ec 100644 --- a/src/test/mir-opt/const_prop/bad_op_div_by_zero.rs +++ b/tests/mir-opt/const_prop/bad_op_div_by_zero.rs diff --git a/src/test/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff index 221513042..8485703e3 100644 --- a/src/test/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff @@ -45,7 +45,6 @@ - _2 = Rem(const 1_i32, move _3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19 + _2 = Rem(const 1_i32, const 0_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19 StorageDead(_3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19 - nop; // scope 0 at $DIR/bad_op_mod_by_zero.rs:+0:11: +3:2 StorageDead(_2); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+3:1: +3:2 StorageDead(_1); // scope 0 at $DIR/bad_op_mod_by_zero.rs:+3:1: +3:2 return; // scope 0 at $DIR/bad_op_mod_by_zero.rs:+3:2: +3:2 diff --git a/src/test/mir-opt/const_prop/bad_op_mod_by_zero.rs b/tests/mir-opt/const_prop/bad_op_mod_by_zero.rs index cc16a4a5a..cc16a4a5a 100644 --- a/src/test/mir-opt/const_prop/bad_op_mod_by_zero.rs +++ b/tests/mir-opt/const_prop/bad_op_mod_by_zero.rs diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff new file mode 100644 index 000000000..27e41d486 --- /dev/null +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff @@ -0,0 +1,54 @@ +- // MIR for `main` before ConstProp ++ // MIR for `main` after ConstProp + + fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+0:11: +0:11 + let _1: *const [i32]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10 + let mut _2: *const [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + let _3: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + let _5: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24 + let mut _6: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 + let mut _7: bool; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 + let mut _8: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + scope 1 { + debug a => _1; // in scope 1 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10 + scope 2 { + let _4: i32; // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15 + scope 3 { + debug _b => _4; // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15 + } + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10 + StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + _8 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + // mir::Constant + // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35 + // + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) } + _3 = _8; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + _2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + _1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + StorageDead(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:34: +1:35 + StorageDead(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:35: +1:36 + StorageLive(_4); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15 + StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24 + _5 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24 + _6 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 +- _7 = Lt(_5, _6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 +- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 ++ _7 = Lt(const 3_usize, _6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 ++ assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 + } + + bb1: { + _4 = (*_1)[_5]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 + StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:25: +3:26 + StorageDead(_4); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+4:5: +4:6 + StorageDead(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:1: +5:2 + return; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:2: +5:2 + } + } + diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff new file mode 100644 index 000000000..27e41d486 --- /dev/null +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff @@ -0,0 +1,54 @@ +- // MIR for `main` before ConstProp ++ // MIR for `main` after ConstProp + + fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+0:11: +0:11 + let _1: *const [i32]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10 + let mut _2: *const [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + let _3: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + let _5: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24 + let mut _6: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 + let mut _7: bool; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 + let mut _8: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + scope 1 { + debug a => _1; // in scope 1 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10 + scope 2 { + let _4: i32; // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15 + scope 3 { + debug _b => _4; // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15 + } + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10 + StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + _8 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + // mir::Constant + // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35 + // + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) } + _3 = _8; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + _2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + _1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35 + StorageDead(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:34: +1:35 + StorageDead(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:35: +1:36 + StorageLive(_4); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15 + StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24 + _5 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24 + _6 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 +- _7 = Lt(_5, _6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 +- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 ++ _7 = Lt(const 3_usize, _6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 ++ assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 + } + + bb1: { + _4 = (*_1)[_5]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25 + StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:25: +3:26 + StorageDead(_4); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+4:5: +4:6 + StorageDead(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:1: +5:2 + return; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:2: +5:2 + } + } + diff --git a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs index cf22b06d5..cf22b06d5 100644 --- a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs diff --git a/src/test/mir-opt/const_prop/boolean_identities.rs b/tests/mir-opt/const_prop/boolean_identities.rs index c7b609949..c7b609949 100644 --- a/src/test/mir-opt/const_prop/boolean_identities.rs +++ b/tests/mir-opt/const_prop/boolean_identities.rs diff --git a/src/test/mir-opt/const_prop/boolean_identities.test.ConstProp.diff b/tests/mir-opt/const_prop/boolean_identities.test.ConstProp.diff index 0de800917..0de800917 100644 --- a/src/test/mir-opt/const_prop/boolean_identities.test.ConstProp.diff +++ b/tests/mir-opt/const_prop/boolean_identities.test.ConstProp.diff diff --git a/src/test/mir-opt/const_prop/boxes.main.ConstProp.diff b/tests/mir-opt/const_prop/boxes.main.ConstProp.diff index 5ec421eb2..5ec421eb2 100644 --- a/src/test/mir-opt/const_prop/boxes.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/boxes.main.ConstProp.diff diff --git a/src/test/mir-opt/const_prop/boxes.rs b/tests/mir-opt/const_prop/boxes.rs index d287830db..d287830db 100644 --- a/src/test/mir-opt/const_prop/boxes.rs +++ b/tests/mir-opt/const_prop/boxes.rs diff --git a/src/test/mir-opt/const_prop/cast.main.ConstProp.diff b/tests/mir-opt/const_prop/cast.main.ConstProp.diff index 1d4dfc29f..1d4dfc29f 100644 --- a/src/test/mir-opt/const_prop/cast.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/cast.main.ConstProp.diff diff --git a/src/test/mir-opt/const_prop/cast.rs b/tests/mir-opt/const_prop/cast.rs index 984086eda..984086eda 100644 --- a/src/test/mir-opt/const_prop/cast.rs +++ b/tests/mir-opt/const_prop/cast.rs diff --git a/src/test/mir-opt/const_prop/checked_add.main.ConstProp.diff b/tests/mir-opt/const_prop/checked_add.main.ConstProp.diff index 96d0d2566..96d0d2566 100644 --- a/src/test/mir-opt/const_prop/checked_add.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/checked_add.main.ConstProp.diff diff --git a/src/test/mir-opt/const_prop/checked_add.rs b/tests/mir-opt/const_prop/checked_add.rs index b9860da4c..b9860da4c 100644 --- a/src/test/mir-opt/const_prop/checked_add.rs +++ b/tests/mir-opt/const_prop/checked_add.rs diff --git a/src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff b/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff index bea7114c7..bea7114c7 100644 --- a/src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff diff --git a/src/test/mir-opt/const_prop/const_prop_fails_gracefully.rs b/tests/mir-opt/const_prop/const_prop_fails_gracefully.rs index 0a3dcbd38..0a3dcbd38 100644 --- a/src/test/mir-opt/const_prop/const_prop_fails_gracefully.rs +++ b/tests/mir-opt/const_prop/const_prop_fails_gracefully.rs diff --git a/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff b/tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff index 8b3b9d0a4..f270ab8b6 100644 --- a/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff +++ b/tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff @@ -9,8 +9,8 @@ bb0: { StorageLive(_1); // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21 _1 = const _; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21 -- switchInt(move _1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21 -+ switchInt(const false) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21 +- switchInt(move _1) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21 ++ switchInt(const false) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21 } bb1: { @@ -25,7 +25,6 @@ } bb2: { - nop; // scope 0 at $DIR/control_flow_simplification.rs:+3:6: +3:6 StorageDead(_1); // scope 0 at $DIR/control_flow_simplification.rs:+3:5: +3:6 return; // scope 0 at $DIR/control_flow_simplification.rs:+4:2: +4:2 } diff --git a/src/test/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir b/tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir index 9f7528f0c..9f7528f0c 100644 --- a/src/test/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir +++ b/tests/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir diff --git a/src/test/mir-opt/const_prop/control_flow_simplification.rs b/tests/mir-opt/const_prop/control_flow_simplification.rs index 7dbe8e734..7dbe8e734 100644 --- a/src/test/mir-opt/const_prop/control_flow_simplification.rs +++ b/tests/mir-opt/const_prop/control_flow_simplification.rs diff --git a/src/test/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff b/tests/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff index 6b29bb59c..b4dccecc6 100644 --- a/src/test/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff +++ b/tests/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff @@ -21,13 +21,13 @@ ((_3 as Some).0: bool) = const true; // scope 2 at $DIR/discriminant.rs:+1:34: +1:44 discriminant(_3) = 1; // scope 2 at $DIR/discriminant.rs:+1:34: +1:44 - _4 = discriminant(_3); // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 -- switchInt(move _4) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 +- switchInt(move _4) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 + _4 = const 1_isize; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 -+ switchInt(const 1_isize) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 ++ switchInt(const 1_isize) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 } bb1: { - switchInt(((_3 as Some).0: bool)) -> [false: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 + switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 } bb2: { diff --git a/src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff b/tests/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff index 6b29bb59c..b4dccecc6 100644 --- a/src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff +++ b/tests/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff @@ -21,13 +21,13 @@ ((_3 as Some).0: bool) = const true; // scope 2 at $DIR/discriminant.rs:+1:34: +1:44 discriminant(_3) = 1; // scope 2 at $DIR/discriminant.rs:+1:34: +1:44 - _4 = discriminant(_3); // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 -- switchInt(move _4) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 +- switchInt(move _4) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 + _4 = const 1_isize; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 -+ switchInt(const 1_isize) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 ++ switchInt(const 1_isize) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 } bb1: { - switchInt(((_3 as Some).0: bool)) -> [false: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 + switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31 } bb2: { diff --git a/src/test/mir-opt/const_prop/discriminant.rs b/tests/mir-opt/const_prop/discriminant.rs index fdd67ca8a..fdd67ca8a 100644 --- a/src/test/mir-opt/const_prop/discriminant.rs +++ b/tests/mir-opt/const_prop/discriminant.rs diff --git a/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff b/tests/mir-opt/const_prop/indirect.main.ConstProp.diff index f4c0c5c5e..f4c0c5c5e 100644 --- a/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/indirect.main.ConstProp.diff diff --git a/src/test/mir-opt/const_prop/indirect.rs b/tests/mir-opt/const_prop/indirect.rs index 44916cbfe..44916cbfe 100644 --- a/src/test/mir-opt/const_prop/indirect.rs +++ b/tests/mir-opt/const_prop/indirect.rs diff --git a/src/test/mir-opt/const_prop/invalid_constant.main.ConstProp.diff b/tests/mir-opt/const_prop/invalid_constant.main.ConstProp.diff index 67a4dc3c0..6c4757c1a 100644 --- a/src/test/mir-opt/const_prop/invalid_constant.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/invalid_constant.main.ConstProp.diff @@ -7,8 +7,6 @@ let mut _2: main::InvalidChar; // in scope 0 at $DIR/invalid_constant.rs:+6:34: +6:63 let mut _4: E; // in scope 0 at $DIR/invalid_constant.rs:+13:25: +13:59 let mut _5: main::InvalidTag; // in scope 0 at $DIR/invalid_constant.rs:+13:34: +13:55 - let mut _7: Empty; // in scope 0 at $DIR/invalid_constant.rs:+20:35: +20:73 - let mut _8: main::NoVariants; // in scope 0 at $DIR/invalid_constant.rs:+20:44: +20:65 scope 1 { debug _invalid_char => _1; // in scope 1 at $DIR/invalid_constant.rs:+6:9: +6:22 let _3: [E; 1]; // in scope 1 at $DIR/invalid_constant.rs:+13:9: +13:21 @@ -17,9 +15,9 @@ let _6: [Empty; 1]; // in scope 3 at $DIR/invalid_constant.rs:+20:9: +20:31 scope 5 { debug _enum_without_variants => _6; // in scope 5 at $DIR/invalid_constant.rs:+20:9: +20:31 - let _9: main::Str<"���">; // in scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22 + let _7: main::Str<"���">; // in scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22 scope 7 { - debug _non_utf8_str => _9; // in scope 7 at $DIR/invalid_constant.rs:+24:9: +24:22 + debug _non_utf8_str => _7; // in scope 7 at $DIR/invalid_constant.rs:+24:9: +24:22 } } scope 6 { @@ -57,17 +55,8 @@ StorageDead(_4); // scope 1 at $DIR/invalid_constant.rs:+13:59: +13:60 StorageDead(_5); // scope 1 at $DIR/invalid_constant.rs:+13:60: +13:61 StorageLive(_6); // scope 3 at $DIR/invalid_constant.rs:+20:9: +20:31 - StorageLive(_7); // scope 3 at $DIR/invalid_constant.rs:+20:35: +20:73 - StorageLive(_8); // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:65 - Deinit(_8); // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:65 - (_8.0: u32) = const 0_u32; // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:65 - nop; // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:71 - nop; // scope 3 at $DIR/invalid_constant.rs:+20:34: +20:74 - StorageDead(_7); // scope 3 at $DIR/invalid_constant.rs:+20:73: +20:74 - StorageDead(_8); // scope 3 at $DIR/invalid_constant.rs:+20:74: +20:75 - StorageLive(_9); // scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22 - nop; // scope 0 at $DIR/invalid_constant.rs:+0:11: +27:2 - StorageDead(_9); // scope 5 at $DIR/invalid_constant.rs:+27:1: +27:2 + StorageLive(_7); // scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22 + StorageDead(_7); // scope 5 at $DIR/invalid_constant.rs:+27:1: +27:2 StorageDead(_6); // scope 3 at $DIR/invalid_constant.rs:+27:1: +27:2 StorageDead(_3); // scope 1 at $DIR/invalid_constant.rs:+27:1: +27:2 StorageDead(_1); // scope 0 at $DIR/invalid_constant.rs:+27:1: +27:2 diff --git a/src/test/mir-opt/const_prop/invalid_constant.rs b/tests/mir-opt/const_prop/invalid_constant.rs index 0337a7ca8..0337a7ca8 100644 --- a/src/test/mir-opt/const_prop/invalid_constant.rs +++ b/tests/mir-opt/const_prop/invalid_constant.rs diff --git a/tests/mir-opt/const_prop/issue_66971.main.ConstProp.diff b/tests/mir-opt/const_prop/issue_66971.main.ConstProp.diff new file mode 100644 index 000000000..488e772d0 --- /dev/null +++ b/tests/mir-opt/const_prop/issue_66971.main.ConstProp.diff @@ -0,0 +1,27 @@ +- // MIR for `main` before ConstProp ++ // MIR for `main` after ConstProp + + fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/issue_66971.rs:+0:11: +0:11 + let _1: (); // in scope 0 at $DIR/issue_66971.rs:+1:5: +1:23 + let mut _2: ((), u8, u8); // in scope 0 at $DIR/issue_66971.rs:+1:12: +1:22 + + bb0: { + StorageLive(_1); // scope 0 at $DIR/issue_66971.rs:+1:5: +1:23 + StorageLive(_2); // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22 + Deinit(_2); // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22 + (_2.1: u8) = const 0_u8; // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22 + (_2.2: u8) = const 0_u8; // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22 + _1 = encode(move _2) -> bb1; // scope 0 at $DIR/issue_66971.rs:+1:5: +1:23 + // mir::Constant + // + span: $DIR/issue_66971.rs:17:5: 17:11 + // + literal: Const { ty: fn(((), u8, u8)) {encode}, val: Value(<ZST>) } + } + + bb1: { + StorageDead(_2); // scope 0 at $DIR/issue_66971.rs:+1:22: +1:23 + StorageDead(_1); // scope 0 at $DIR/issue_66971.rs:+1:23: +1:24 + return; // scope 0 at $DIR/issue_66971.rs:+2:2: +2:2 + } + } + diff --git a/src/test/mir-opt/const_prop/issue_66971.rs b/tests/mir-opt/const_prop/issue_66971.rs index 6ca03438e..6ca03438e 100644 --- a/src/test/mir-opt/const_prop/issue_66971.rs +++ b/tests/mir-opt/const_prop/issue_66971.rs diff --git a/src/test/mir-opt/const_prop/issue_67019.main.ConstProp.diff b/tests/mir-opt/const_prop/issue_67019.main.ConstProp.diff index 79cd8bf48..cd5304859 100644 --- a/src/test/mir-opt/const_prop/issue_67019.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/issue_67019.main.ConstProp.diff @@ -27,7 +27,6 @@ bb1: { StorageDead(_2); // scope 0 at $DIR/issue_67019.rs:+1:19: +1:20 StorageDead(_1); // scope 0 at $DIR/issue_67019.rs:+1:20: +1:21 - nop; // scope 0 at $DIR/issue_67019.rs:+0:11: +2:2 return; // scope 0 at $DIR/issue_67019.rs:+2:2: +2:2 } } diff --git a/src/test/mir-opt/const_prop/issue_67019.rs b/tests/mir-opt/const_prop/issue_67019.rs index ffc6fa1f2..ffc6fa1f2 100644 --- a/src/test/mir-opt/const_prop/issue_67019.rs +++ b/tests/mir-opt/const_prop/issue_67019.rs diff --git a/src/test/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff index 96de39258..5331e5b82 100644 --- a/src/test/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff +++ b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.32bit.diff @@ -29,7 +29,6 @@ _1 = _2[_3]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32 StorageDead(_3); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33 StorageDead(_2); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33 - nop; // scope 0 at $DIR/large_array_index.rs:+0:11: +3:2 StorageDead(_1); // scope 0 at $DIR/large_array_index.rs:+3:1: +3:2 return; // scope 0 at $DIR/large_array_index.rs:+3:2: +3:2 } diff --git a/src/test/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff index 96de39258..5331e5b82 100644 --- a/src/test/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff +++ b/tests/mir-opt/const_prop/large_array_index.main.ConstProp.64bit.diff @@ -29,7 +29,6 @@ _1 = _2[_3]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32 StorageDead(_3); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33 StorageDead(_2); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33 - nop; // scope 0 at $DIR/large_array_index.rs:+0:11: +3:2 StorageDead(_1); // scope 0 at $DIR/large_array_index.rs:+3:1: +3:2 return; // scope 0 at $DIR/large_array_index.rs:+3:2: +3:2 } diff --git a/src/test/mir-opt/const_prop/large_array_index.rs b/tests/mir-opt/const_prop/large_array_index.rs index 48d134376..48d134376 100644 --- a/src/test/mir-opt/const_prop/large_array_index.rs +++ b/tests/mir-opt/const_prop/large_array_index.rs diff --git a/src/test/mir-opt/const_prop/mult_by_zero.rs b/tests/mir-opt/const_prop/mult_by_zero.rs index c839f92f2..c839f92f2 100644 --- a/src/test/mir-opt/const_prop/mult_by_zero.rs +++ b/tests/mir-opt/const_prop/mult_by_zero.rs diff --git a/src/test/mir-opt/const_prop/mult_by_zero.test.ConstProp.diff b/tests/mir-opt/const_prop/mult_by_zero.test.ConstProp.diff index 629c8e601..629c8e601 100644 --- a/src/test/mir-opt/const_prop/mult_by_zero.test.ConstProp.diff +++ b/tests/mir-opt/const_prop/mult_by_zero.test.ConstProp.diff diff --git a/src/test/mir-opt/const_prop/mutable_variable.main.ConstProp.diff b/tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff index 3bbd6a87f..a672c457a 100644 --- a/src/test/mir-opt/const_prop/mutable_variable.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff @@ -19,7 +19,6 @@ StorageLive(_2); // scope 1 at $DIR/mutable_variable.rs:+3:9: +3:10 - _2 = _1; // scope 1 at $DIR/mutable_variable.rs:+3:13: +3:14 + _2 = const 99_i32; // scope 1 at $DIR/mutable_variable.rs:+3:13: +3:14 - nop; // scope 0 at $DIR/mutable_variable.rs:+0:11: +4:2 StorageDead(_2); // scope 1 at $DIR/mutable_variable.rs:+4:1: +4:2 StorageDead(_1); // scope 0 at $DIR/mutable_variable.rs:+4:1: +4:2 return; // scope 0 at $DIR/mutable_variable.rs:+4:2: +4:2 diff --git a/src/test/mir-opt/const_prop/mutable_variable.rs b/tests/mir-opt/const_prop/mutable_variable.rs index cb01719dd..cb01719dd 100644 --- a/src/test/mir-opt/const_prop/mutable_variable.rs +++ b/tests/mir-opt/const_prop/mutable_variable.rs diff --git a/src/test/mir-opt/const_prop/mutable_variable_aggregate.main.ConstProp.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate.main.ConstProp.diff index fed6a98b9..f6bf52206 100644 --- a/src/test/mir-opt/const_prop/mutable_variable_aggregate.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate.main.ConstProp.diff @@ -21,7 +21,6 @@ StorageLive(_2); // scope 1 at $DIR/mutable_variable_aggregate.rs:+3:9: +3:10 - _2 = _1; // scope 1 at $DIR/mutable_variable_aggregate.rs:+3:13: +3:14 + _2 = const (42_i32, 99_i32); // scope 1 at $DIR/mutable_variable_aggregate.rs:+3:13: +3:14 - nop; // scope 0 at $DIR/mutable_variable_aggregate.rs:+0:11: +4:2 StorageDead(_2); // scope 1 at $DIR/mutable_variable_aggregate.rs:+4:1: +4:2 StorageDead(_1); // scope 0 at $DIR/mutable_variable_aggregate.rs:+4:1: +4:2 return; // scope 0 at $DIR/mutable_variable_aggregate.rs:+4:2: +4:2 diff --git a/src/test/mir-opt/const_prop/mutable_variable_aggregate.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate.rs index d4ff8d890..d4ff8d890 100644 --- a/src/test/mir-opt/const_prop/mutable_variable_aggregate.rs +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate.rs diff --git a/src/test/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.ConstProp.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.ConstProp.diff index 90eebd8fe..213a70227 100644 --- a/src/test/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.ConstProp.diff @@ -26,7 +26,6 @@ ((*_2).1: i32) = const 99_i32; // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+3:5: +3:13 StorageLive(_3); // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+4:9: +4:10 _3 = _1; // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+4:13: +4:14 - nop; // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+0:11: +5:2 StorageDead(_3); // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+5:1: +5:2 StorageDead(_2); // scope 1 at $DIR/mutable_variable_aggregate_mut_ref.rs:+5:1: +5:2 StorageDead(_1); // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+5:1: +5:2 diff --git a/src/test/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs index 9060f7e9b..9060f7e9b 100644 --- a/src/test/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs diff --git a/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff index 6eda503c1..149aa6290 100644 --- a/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff @@ -26,7 +26,6 @@ StorageLive(_2); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:9: +4:10 - _2 = (_1.1: i32); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:13: +4:16 + _2 = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:13: +4:16 - nop; // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+0:11: +5:2 StorageDead(_2); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:1: +5:2 StorageDead(_1); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:1: +5:2 return; // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:2: +5:2 diff --git a/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs index cb59509ff..cb59509ff 100644 --- a/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs diff --git a/tests/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff b/tests/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff new file mode 100644 index 000000000..7fa29cccd --- /dev/null +++ b/tests/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff @@ -0,0 +1,43 @@ +- // MIR for `main` before ConstProp ++ // MIR for `main` after ConstProp + + fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/mutable_variable_no_prop.rs:+0:11: +0:11 + let mut _1: u32; // in scope 0 at $DIR/mutable_variable_no_prop.rs:+1:9: +1:14 + let mut _2: u32; // in scope 0 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19 + let mut _3: *mut u32; // in scope 0 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19 + scope 1 { + debug x => _1; // in scope 1 at $DIR/mutable_variable_no_prop.rs:+1:9: +1:14 + let _4: u32; // in scope 1 at $DIR/mutable_variable_no_prop.rs:+5:9: +5:10 + scope 2 { + } + scope 3 { + debug y => _4; // in scope 3 at $DIR/mutable_variable_no_prop.rs:+5:9: +5:10 + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/mutable_variable_no_prop.rs:+1:9: +1:14 + _1 = const 42_u32; // scope 0 at $DIR/mutable_variable_no_prop.rs:+1:17: +1:19 + StorageLive(_2); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19 + StorageLive(_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19 + _3 = const {alloc1: *mut u32}; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19 + // mir::Constant + // + span: $DIR/mutable_variable_no_prop.rs:10:13: 10:19 + // + literal: Const { ty: *mut u32, val: Value(Scalar(alloc1)) } + _2 = (*_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19 + _1 = move _2; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:9: +3:19 + StorageDead(_2); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:18: +3:19 + StorageDead(_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:19: +3:20 + StorageLive(_4); // scope 1 at $DIR/mutable_variable_no_prop.rs:+5:9: +5:10 + _4 = _1; // scope 1 at $DIR/mutable_variable_no_prop.rs:+5:13: +5:14 + StorageDead(_4); // scope 1 at $DIR/mutable_variable_no_prop.rs:+6:1: +6:2 + StorageDead(_1); // scope 0 at $DIR/mutable_variable_no_prop.rs:+6:1: +6:2 + return; // scope 0 at $DIR/mutable_variable_no_prop.rs:+6:2: +6:2 + } + } + + alloc1 (static: STATIC, size: 4, align: 4) { + 42 42 42 42 │ BBBB + } + diff --git a/src/test/mir-opt/const_prop/mutable_variable_no_prop.rs b/tests/mir-opt/const_prop/mutable_variable_no_prop.rs index 8c23c5fcf..b69ec931a 100644 --- a/src/test/mir-opt/const_prop/mutable_variable_no_prop.rs +++ b/tests/mir-opt/const_prop/mutable_variable_no_prop.rs @@ -1,7 +1,7 @@ // unit-test // compile-flags: -O -static mut STATIC: u32 = 42; +static mut STATIC: u32 = 0x42424242; // EMIT_MIR mutable_variable_no_prop.main.ConstProp.diff fn main() { diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff new file mode 100644 index 000000000..c3f77b960 --- /dev/null +++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff @@ -0,0 +1,57 @@ +- // MIR for `main` before ConstProp ++ // MIR for `main` after ConstProp + + fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/mutable_variable_unprop_assign.rs:+0:11: +0:11 + let _1: i32; // in scope 0 at $DIR/mutable_variable_unprop_assign.rs:+1:9: +1:10 + let mut _2: i32; // in scope 0 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12 + scope 1 { + debug a => _1; // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:+1:9: +1:10 + let mut _5: i32; // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14 + let mut _6: i32; // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14 + scope 2 { + debug x => (i32, i32){ .0 => _5, .1 => _6, }; // in scope 2 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14 + let _3: i32; // in scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10 + scope 3 { + debug y => _3; // in scope 3 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10 + let _4: i32; // in scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10 + scope 4 { + debug z => _4; // in scope 4 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10 + } + } + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+1:9: +1:10 + _1 = foo() -> bb1; // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+1:13: +1:18 + // mir::Constant + // + span: $DIR/mutable_variable_unprop_assign.rs:6:13: 6:16 + // + literal: Const { ty: fn() -> i32 {foo}, val: Value(<ZST>) } + } + + bb1: { + StorageLive(_5); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14 + StorageLive(_6); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14 + Deinit(_5); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35 + Deinit(_6); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35 + _5 = const 1_i32; // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35 + _6 = const 2_i32; // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35 + StorageLive(_2); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12 + _2 = _1; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12 + _6 = move _2; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:5: +3:12 + StorageDead(_2); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12 + StorageLive(_3); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10 + _3 = _6; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:13: +4:16 + StorageLive(_4); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10 +- _4 = _5; // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16 ++ _4 = const 1_i32; // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16 + StorageDead(_4); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2 + StorageDead(_3); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2 + StorageDead(_5); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2 + StorageDead(_6); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2 + StorageDead(_1); // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2 + return; // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+6:2: +6:2 + } + } + diff --git a/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs index b077cfd3e..b077cfd3e 100644 --- a/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs +++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.32bit.diff b/tests/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.32bit.diff index 7e8ebd31a..7c7aeac4c 100644 --- a/src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.32bit.diff +++ b/tests/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.32bit.diff @@ -9,9 +9,7 @@ let _5: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:32: +2:33 let mut _6: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34 let mut _7: bool; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34 - let mut _9: Point; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - let mut _10: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - let mut _11: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 + let mut _9: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 scope 1 { debug x => _1; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10 let _3: i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10 @@ -53,17 +51,12 @@ StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35 StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35 StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10 - StorageLive(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - StorageLive(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - Deinit(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - Deinit(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - _10 = const 12_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - _11 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 -- _8 = _11; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38 + StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 + Deinit(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 + _9 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 +- _8 = _9; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38 + _8 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38 - StorageDead(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39 - StorageDead(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39 - nop; // scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +4:2 + StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39 StorageDead(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+4:1: +4:2 StorageDead(_3); // scope 1 at $DIR/optimizes_into_variable.rs:+4:1: +4:2 StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+4:1: +4:2 diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.64bit.diff b/tests/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.64bit.diff index 7e8ebd31a..7c7aeac4c 100644 --- a/src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.64bit.diff +++ b/tests/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.64bit.diff @@ -9,9 +9,7 @@ let _5: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:32: +2:33 let mut _6: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34 let mut _7: bool; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34 - let mut _9: Point; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - let mut _10: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - let mut _11: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 + let mut _9: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 scope 1 { debug x => _1; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10 let _3: i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10 @@ -53,17 +51,12 @@ StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35 StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35 StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10 - StorageLive(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - StorageLive(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - Deinit(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - Deinit(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - _10 = const 12_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 - _11 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 -- _8 = _11; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38 + StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 + Deinit(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 + _9 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36 +- _8 = _9; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38 + _8 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38 - StorageDead(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39 - StorageDead(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39 - nop; // scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +4:2 + StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39 StorageDead(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+4:1: +4:2 StorageDead(_3); // scope 1 at $DIR/optimizes_into_variable.rs:+4:1: +4:2 StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+4:1: +4:2 diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable.main.PreCodegen.after.32bit.mir b/tests/mir-opt/const_prop/optimizes_into_variable.main.PreCodegen.after.32bit.mir index 9db87cfc8..9db87cfc8 100644 --- a/src/test/mir-opt/const_prop/optimizes_into_variable.main.PreCodegen.after.32bit.mir +++ b/tests/mir-opt/const_prop/optimizes_into_variable.main.PreCodegen.after.32bit.mir diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable.main.PreCodegen.after.64bit.mir b/tests/mir-opt/const_prop/optimizes_into_variable.main.PreCodegen.after.64bit.mir index 9db87cfc8..9db87cfc8 100644 --- a/src/test/mir-opt/const_prop/optimizes_into_variable.main.PreCodegen.after.64bit.mir +++ b/tests/mir-opt/const_prop/optimizes_into_variable.main.PreCodegen.after.64bit.mir diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.diff b/tests/mir-opt/const_prop/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.diff index 3f9f3b2ea..3f9f3b2ea 100644 --- a/src/test/mir-opt/const_prop/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.diff +++ b/tests/mir-opt/const_prop/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.diff diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.diff b/tests/mir-opt/const_prop/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.diff index 3f9f3b2ea..3f9f3b2ea 100644 --- a/src/test/mir-opt/const_prop/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.diff +++ b/tests/mir-opt/const_prop/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.diff diff --git a/tests/mir-opt/const_prop/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.mir b/tests/mir-opt/const_prop/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.mir new file mode 100644 index 000000000..d926b9df7 --- /dev/null +++ b/tests/mir-opt/const_prop/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.mir @@ -0,0 +1,27 @@ +// MIR for `main` after SimplifyLocals-final + +fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +0:11 + let _1: i32; // in scope 0 at $DIR/optimizes_into_variable.rs:+1:9: +1:10 + scope 1 { + debug x => _1; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10 + let _2: i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10 + scope 2 { + debug y => _2; // in scope 2 at $DIR/optimizes_into_variable.rs:+2:9: +2:10 + let _3: u32; // in scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10 + scope 3 { + debug z => _3; // in scope 3 at $DIR/optimizes_into_variable.rs:+3:9: +3:10 + } + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+1:9: +1:10 + StorageLive(_2); // scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10 + StorageLive(_3); // scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10 + StorageDead(_3); // scope 2 at $DIR/optimizes_into_variable.rs:+4:1: +4:2 + StorageDead(_2); // scope 1 at $DIR/optimizes_into_variable.rs:+4:1: +4:2 + StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+4:1: +4:2 + return; // scope 0 at $DIR/optimizes_into_variable.rs:+4:2: +4:2 + } +} diff --git a/tests/mir-opt/const_prop/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.mir b/tests/mir-opt/const_prop/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.mir new file mode 100644 index 000000000..d926b9df7 --- /dev/null +++ b/tests/mir-opt/const_prop/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.mir @@ -0,0 +1,27 @@ +// MIR for `main` after SimplifyLocals-final + +fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +0:11 + let _1: i32; // in scope 0 at $DIR/optimizes_into_variable.rs:+1:9: +1:10 + scope 1 { + debug x => _1; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10 + let _2: i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10 + scope 2 { + debug y => _2; // in scope 2 at $DIR/optimizes_into_variable.rs:+2:9: +2:10 + let _3: u32; // in scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10 + scope 3 { + debug z => _3; // in scope 3 at $DIR/optimizes_into_variable.rs:+3:9: +3:10 + } + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+1:9: +1:10 + StorageLive(_2); // scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10 + StorageLive(_3); // scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10 + StorageDead(_3); // scope 2 at $DIR/optimizes_into_variable.rs:+4:1: +4:2 + StorageDead(_2); // scope 1 at $DIR/optimizes_into_variable.rs:+4:1: +4:2 + StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+4:1: +4:2 + return; // scope 0 at $DIR/optimizes_into_variable.rs:+4:2: +4:2 + } +} diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable.rs b/tests/mir-opt/const_prop/optimizes_into_variable.rs index 025666548..abea07e20 100644 --- a/src/test/mir-opt/const_prop/optimizes_into_variable.rs +++ b/tests/mir-opt/const_prop/optimizes_into_variable.rs @@ -9,7 +9,7 @@ struct Point { // EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR optimizes_into_variable.main.ScalarReplacementOfAggregates.diff // EMIT_MIR optimizes_into_variable.main.ConstProp.diff -// EMIT_MIR optimizes_into_variable.main.SimplifyLocals.after.mir +// EMIT_MIR optimizes_into_variable.main.SimplifyLocals-final.after.mir // EMIT_MIR optimizes_into_variable.main.PreCodegen.after.mir fn main() { let x = 2 + 2; diff --git a/src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff b/tests/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff index b9c283a54..388c6ca81 100644 --- a/src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff @@ -36,7 +36,6 @@ StorageDead(_2); // scope 0 at $DIR/read_immutable_static.rs:+1:21: +1:22 StorageDead(_5); // scope 0 at $DIR/read_immutable_static.rs:+1:22: +1:23 StorageDead(_3); // scope 0 at $DIR/read_immutable_static.rs:+1:22: +1:23 - nop; // scope 0 at $DIR/read_immutable_static.rs:+0:11: +2:2 StorageDead(_1); // scope 0 at $DIR/read_immutable_static.rs:+2:1: +2:2 return; // scope 0 at $DIR/read_immutable_static.rs:+2:2: +2:2 } diff --git a/src/test/mir-opt/const_prop/read_immutable_static.rs b/tests/mir-opt/const_prop/read_immutable_static.rs index 4f7afe6ca..4f7afe6ca 100644 --- a/src/test/mir-opt/const_prop/read_immutable_static.rs +++ b/tests/mir-opt/const_prop/read_immutable_static.rs diff --git a/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff b/tests/mir-opt/const_prop/ref_deref.main.ConstProp.diff index 09ce67ff1..8a73f0390 100644 --- a/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/ref_deref.main.ConstProp.diff @@ -13,7 +13,7 @@ StorageLive(_2); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10 _4 = const _; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10 // mir::Constant - // + span: $DIR/ref_deref.rs:5:6: 5:10 + // + span: $DIR/ref_deref.rs:6:6: 6:10 // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) } _2 = _4; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10 - _1 = (*_2); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10 diff --git a/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff b/tests/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff index 902cd7850..015ec4d07 100644 --- a/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff +++ b/tests/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff @@ -16,7 +16,7 @@ - _2 = &_3; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10 + _4 = const _; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10 + // mir::Constant -+ // + span: $DIR/ref_deref.rs:5:6: 5:10 ++ // + span: $DIR/ref_deref.rs:6:6: 6:10 + // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) } + _2 = &(*_4); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10 _1 = (*_2); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10 diff --git a/tests/mir-opt/const_prop/ref_deref.rs b/tests/mir-opt/const_prop/ref_deref.rs new file mode 100644 index 000000000..d2549c8b6 --- /dev/null +++ b/tests/mir-opt/const_prop/ref_deref.rs @@ -0,0 +1,7 @@ +// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop +// EMIT_MIR ref_deref.main.PromoteTemps.diff +// EMIT_MIR ref_deref.main.ConstProp.diff + +fn main() { + *(&4); +} diff --git a/src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff b/tests/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff index ec3d90433..ec3d90433 100644 --- a/src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff diff --git a/src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff b/tests/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff index cd0616e65..cd0616e65 100644 --- a/src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff +++ b/tests/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff diff --git a/tests/mir-opt/const_prop/ref_deref_project.rs b/tests/mir-opt/const_prop/ref_deref_project.rs new file mode 100644 index 000000000..2fdd4e153 --- /dev/null +++ b/tests/mir-opt/const_prop/ref_deref_project.rs @@ -0,0 +1,7 @@ +// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop +// EMIT_MIR ref_deref_project.main.PromoteTemps.diff +// EMIT_MIR ref_deref_project.main.ConstProp.diff + +fn main() { + *(&(4, 5).1); // This does not currently propagate (#67862) +} diff --git a/tests/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff b/tests/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff new file mode 100644 index 000000000..15c93f270 --- /dev/null +++ b/tests/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff @@ -0,0 +1,24 @@ +- // MIR for `main` before ConstProp ++ // MIR for `main` after ConstProp + + fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/reify_fn_ptr.rs:+0:11: +0:11 + let mut _1: usize; // in scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:26 + let mut _2: fn(); // in scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17 + scope 1 { + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:26 + StorageLive(_2); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17 + _2 = main as fn() (Pointer(ReifyFnPointer)); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17 + // mir::Constant + // + span: $DIR/reify_fn_ptr.rs:4:13: 4:17 + // + literal: Const { ty: fn() {main}, val: Value(<ZST>) } + _1 = move _2 as usize (PointerExposeAddress); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:26 + StorageDead(_2); // scope 0 at $DIR/reify_fn_ptr.rs:+1:25: +1:26 + StorageDead(_1); // scope 0 at $DIR/reify_fn_ptr.rs:+1:40: +1:41 + return; // scope 0 at $DIR/reify_fn_ptr.rs:+2:2: +2:2 + } + } + diff --git a/src/test/mir-opt/const_prop/reify_fn_ptr.rs b/tests/mir-opt/const_prop/reify_fn_ptr.rs index bfe2563ad..bfe2563ad 100644 --- a/src/test/mir-opt/const_prop/reify_fn_ptr.rs +++ b/tests/mir-opt/const_prop/reify_fn_ptr.rs diff --git a/src/test/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff b/tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff index 7c4977996..636032adb 100644 --- a/src/test/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff +++ b/tests/mir-opt/const_prop/repeat.main.ConstProp.32bit.diff @@ -35,7 +35,6 @@ StorageDead(_2); // scope 0 at $DIR/repeat.rs:+1:31: +1:32 StorageDead(_4); // scope 0 at $DIR/repeat.rs:+1:32: +1:33 StorageDead(_3); // scope 0 at $DIR/repeat.rs:+1:32: +1:33 - nop; // scope 0 at $DIR/repeat.rs:+0:11: +2:2 StorageDead(_1); // scope 0 at $DIR/repeat.rs:+2:1: +2:2 return; // scope 0 at $DIR/repeat.rs:+2:2: +2:2 } diff --git a/src/test/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff b/tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff index 7c4977996..636032adb 100644 --- a/src/test/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff +++ b/tests/mir-opt/const_prop/repeat.main.ConstProp.64bit.diff @@ -35,7 +35,6 @@ StorageDead(_2); // scope 0 at $DIR/repeat.rs:+1:31: +1:32 StorageDead(_4); // scope 0 at $DIR/repeat.rs:+1:32: +1:33 StorageDead(_3); // scope 0 at $DIR/repeat.rs:+1:32: +1:33 - nop; // scope 0 at $DIR/repeat.rs:+0:11: +2:2 StorageDead(_1); // scope 0 at $DIR/repeat.rs:+2:1: +2:2 return; // scope 0 at $DIR/repeat.rs:+2:2: +2:2 } diff --git a/src/test/mir-opt/const_prop/repeat.rs b/tests/mir-opt/const_prop/repeat.rs index 36d9b9fc6..36d9b9fc6 100644 --- a/src/test/mir-opt/const_prop/repeat.rs +++ b/tests/mir-opt/const_prop/repeat.rs diff --git a/src/test/mir-opt/const_prop/return_place.add.ConstProp.diff b/tests/mir-opt/const_prop/return_place.add.ConstProp.diff index 5ebd8a520..5ebd8a520 100644 --- a/src/test/mir-opt/const_prop/return_place.add.ConstProp.diff +++ b/tests/mir-opt/const_prop/return_place.add.ConstProp.diff diff --git a/src/test/mir-opt/const_prop/return_place.add.PreCodegen.before.mir b/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.mir index ececd9942..ececd9942 100644 --- a/src/test/mir-opt/const_prop/return_place.add.PreCodegen.before.mir +++ b/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.mir diff --git a/src/test/mir-opt/const_prop/return_place.rs b/tests/mir-opt/const_prop/return_place.rs index 06a853696..06a853696 100644 --- a/src/test/mir-opt/const_prop/return_place.rs +++ b/tests/mir-opt/const_prop/return_place.rs diff --git a/src/test/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff b/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff index 5920937e0..d518eff04 100644 --- a/src/test/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff @@ -27,7 +27,6 @@ bb1: { StorageDead(_3); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:14: +2:15 StorageDead(_2); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:15: +2:16 - nop; // scope 0 at $DIR/scalar_literal_propagation.rs:+0:11: +3:2 StorageDead(_1); // scope 0 at $DIR/scalar_literal_propagation.rs:+3:1: +3:2 return; // scope 0 at $DIR/scalar_literal_propagation.rs:+3:2: +3:2 } diff --git a/src/test/mir-opt/const_prop/scalar_literal_propagation.rs b/tests/mir-opt/const_prop/scalar_literal_propagation.rs index 8724e4d57..8724e4d57 100644 --- a/src/test/mir-opt/const_prop/scalar_literal_propagation.rs +++ b/tests/mir-opt/const_prop/scalar_literal_propagation.rs diff --git a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff b/tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff index 624376769..9017fd18e 100644 --- a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff +++ b/tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff @@ -12,7 +12,6 @@ let mut _7: usize; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33 let mut _8: bool; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33 let mut _9: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19 - let mut _10: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19 bb0: { StorageLive(_1); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 @@ -21,20 +20,18 @@ StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 _9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 // mir::Constant - // + span: $DIR/slice_len.rs:5:6: 5:19 + // + span: $DIR/slice_len.rs:6:6: 6:19 // + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) } _4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 _3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 - StorageLive(_10); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 - _10 = _3; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 _2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 StorageDead(_3); // scope 0 at $DIR/slice_len.rs:+1:18: +1:19 StorageLive(_6); // scope 0 at $DIR/slice_len.rs:+1:31: +1:32 _6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:+1:31: +1:32 - _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 - StorageDead(_10); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 +- _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 - _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 - assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 ++ _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 + _8 = const true; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 } diff --git a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff b/tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff index 624376769..9017fd18e 100644 --- a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff +++ b/tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff @@ -12,7 +12,6 @@ let mut _7: usize; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33 let mut _8: bool; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33 let mut _9: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19 - let mut _10: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19 bb0: { StorageLive(_1); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 @@ -21,20 +20,18 @@ StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 _9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 // mir::Constant - // + span: $DIR/slice_len.rs:5:6: 5:19 + // + span: $DIR/slice_len.rs:6:6: 6:19 // + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) } _4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 _3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 - StorageLive(_10); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 - _10 = _3; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 _2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19 StorageDead(_3); // scope 0 at $DIR/slice_len.rs:+1:18: +1:19 StorageLive(_6); // scope 0 at $DIR/slice_len.rs:+1:31: +1:32 _6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:+1:31: +1:32 - _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 - StorageDead(_10); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 +- _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 - _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 - assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 ++ _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 + _8 = const true; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33 } diff --git a/tests/mir-opt/const_prop/slice_len.rs b/tests/mir-opt/const_prop/slice_len.rs new file mode 100644 index 000000000..eaaf34b96 --- /dev/null +++ b/tests/mir-opt/const_prop/slice_len.rs @@ -0,0 +1,7 @@ +// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop +// EMIT_MIR_FOR_EACH_BIT_WIDTH + +// EMIT_MIR slice_len.main.ConstProp.diff +fn main() { + (&[1u32, 2, 3] as &[u32])[1]; +} diff --git a/src/test/mir-opt/const_prop/switch_int.main.ConstProp.diff b/tests/mir-opt/const_prop/switch_int.main.ConstProp.diff index 9d7c2784d..ddc1a4493 100644 --- a/src/test/mir-opt/const_prop/switch_int.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/switch_int.main.ConstProp.diff @@ -8,8 +8,8 @@ bb0: { StorageLive(_1); // scope 0 at $DIR/switch_int.rs:+1:11: +1:12 _1 = const 1_i32; // scope 0 at $DIR/switch_int.rs:+1:11: +1:12 -- switchInt(_1) -> [1_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12 -+ switchInt(const 1_i32) -> [1_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12 +- switchInt(_1) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12 ++ switchInt(const 1_i32) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12 } bb1: { diff --git a/src/test/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.diff b/tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.diff index 74f9eafe4..09c47ee6e 100644 --- a/src/test/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.diff +++ b/tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_1); // scope 0 at $DIR/switch_int.rs:+1:11: +1:12 _1 = const 1_i32; // scope 0 at $DIR/switch_int.rs:+1:11: +1:12 -- switchInt(const 1_i32) -> [1_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12 +- switchInt(const 1_i32) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12 + goto -> bb2; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12 } diff --git a/src/test/mir-opt/const_prop/switch_int.rs b/tests/mir-opt/const_prop/switch_int.rs index d7319eca1..d7319eca1 100644 --- a/src/test/mir-opt/const_prop/switch_int.rs +++ b/tests/mir-opt/const_prop/switch_int.rs diff --git a/src/test/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff b/tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff index a0603c60d..e4c92b617 100644 --- a/src/test/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff +++ b/tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff @@ -28,7 +28,6 @@ bb1: { StorageDead(_3); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:14: +3:15 StorageDead(_2); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:15: +3:16 - nop; // scope 0 at $DIR/tuple_literal_propagation.rs:+0:11: +4:2 StorageDead(_1); // scope 0 at $DIR/tuple_literal_propagation.rs:+4:1: +4:2 return; // scope 0 at $DIR/tuple_literal_propagation.rs:+4:2: +4:2 } diff --git a/src/test/mir-opt/const_prop/tuple_literal_propagation.rs b/tests/mir-opt/const_prop/tuple_literal_propagation.rs index e644baec4..e644baec4 100644 --- a/src/test/mir-opt/const_prop/tuple_literal_propagation.rs +++ b/tests/mir-opt/const_prop/tuple_literal_propagation.rs diff --git a/tests/mir-opt/const_prop_miscompile.bar.ConstProp.diff b/tests/mir-opt/const_prop_miscompile.bar.ConstProp.diff new file mode 100644 index 000000000..ea9fec0aa --- /dev/null +++ b/tests/mir-opt/const_prop_miscompile.bar.ConstProp.diff @@ -0,0 +1,37 @@ +- // MIR for `bar` before ConstProp ++ // MIR for `bar` after ConstProp + + fn bar() -> () { + let mut _0: (); // return place in scope 0 at $DIR/const_prop_miscompile.rs:+0:10: +0:10 + let mut _1: (i32,); // in scope 0 at $DIR/const_prop_miscompile.rs:+1:9: +1:14 + let mut _2: *mut i32; // in scope 0 at $DIR/const_prop_miscompile.rs:+3:10: +3:22 + let mut _4: i32; // in scope 0 at $DIR/const_prop_miscompile.rs:+5:13: +5:20 + scope 1 { + debug v => _1; // in scope 1 at $DIR/const_prop_miscompile.rs:+1:9: +1:14 + let _3: bool; // in scope 1 at $DIR/const_prop_miscompile.rs:+5:9: +5:10 + scope 2 { + } + scope 3 { + debug y => _3; // in scope 3 at $DIR/const_prop_miscompile.rs:+5:9: +5:10 + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/const_prop_miscompile.rs:+1:9: +1:14 + Deinit(_1); // scope 0 at $DIR/const_prop_miscompile.rs:+1:17: +1:21 + (_1.0: i32) = const 1_i32; // scope 0 at $DIR/const_prop_miscompile.rs:+1:17: +1:21 + StorageLive(_2); // scope 2 at $DIR/const_prop_miscompile.rs:+3:10: +3:22 + _2 = &raw mut (_1.0: i32); // scope 2 at $DIR/const_prop_miscompile.rs:+3:10: +3:22 + (*_2) = const 5_i32; // scope 2 at $DIR/const_prop_miscompile.rs:+3:9: +3:26 + StorageDead(_2); // scope 2 at $DIR/const_prop_miscompile.rs:+3:26: +3:27 + StorageLive(_3); // scope 1 at $DIR/const_prop_miscompile.rs:+5:9: +5:10 + StorageLive(_4); // scope 1 at $DIR/const_prop_miscompile.rs:+5:13: +5:20 + _4 = (_1.0: i32); // scope 1 at $DIR/const_prop_miscompile.rs:+5:15: +5:18 + _3 = Eq(move _4, const 5_i32); // scope 1 at $DIR/const_prop_miscompile.rs:+5:13: +5:25 + StorageDead(_4); // scope 1 at $DIR/const_prop_miscompile.rs:+5:24: +5:25 + StorageDead(_3); // scope 1 at $DIR/const_prop_miscompile.rs:+6:1: +6:2 + StorageDead(_1); // scope 0 at $DIR/const_prop_miscompile.rs:+6:1: +6:2 + return; // scope 0 at $DIR/const_prop_miscompile.rs:+6:2: +6:2 + } + } + diff --git a/src/test/mir-opt/const_prop_miscompile.foo.ConstProp.diff b/tests/mir-opt/const_prop_miscompile.foo.ConstProp.diff index e8bd98cf8..043f40474 100644 --- a/src/test/mir-opt/const_prop_miscompile.foo.ConstProp.diff +++ b/tests/mir-opt/const_prop_miscompile.foo.ConstProp.diff @@ -27,7 +27,6 @@ _4 = (_1.0: i32); // scope 1 at $DIR/const_prop_miscompile.rs:+3:15: +3:18 _3 = Eq(move _4, const 5_i32); // scope 1 at $DIR/const_prop_miscompile.rs:+3:13: +3:25 StorageDead(_4); // scope 1 at $DIR/const_prop_miscompile.rs:+3:24: +3:25 - nop; // scope 0 at $DIR/const_prop_miscompile.rs:+0:10: +4:2 StorageDead(_3); // scope 1 at $DIR/const_prop_miscompile.rs:+4:1: +4:2 StorageDead(_1); // scope 0 at $DIR/const_prop_miscompile.rs:+4:1: +4:2 return; // scope 0 at $DIR/const_prop_miscompile.rs:+4:2: +4:2 diff --git a/src/test/mir-opt/const_prop_miscompile.rs b/tests/mir-opt/const_prop_miscompile.rs index bc54556b3..bc54556b3 100644 --- a/src/test/mir-opt/const_prop_miscompile.rs +++ b/tests/mir-opt/const_prop_miscompile.rs diff --git a/src/test/mir-opt/coverage_graphviz.bar.InstrumentCoverage.0.dot b/tests/mir-opt/coverage_graphviz.bar.InstrumentCoverage.0.dot index 03df5c950..03df5c950 100644 --- a/src/test/mir-opt/coverage_graphviz.bar.InstrumentCoverage.0.dot +++ b/tests/mir-opt/coverage_graphviz.bar.InstrumentCoverage.0.dot diff --git a/src/test/mir-opt/coverage_graphviz.main.InstrumentCoverage.0.dot b/tests/mir-opt/coverage_graphviz.main.InstrumentCoverage.0.dot index fd21b14af..c4d389b2d 100644 --- a/src/test/mir-opt/coverage_graphviz.main.InstrumentCoverage.0.dot +++ b/tests/mir-opt/coverage_graphviz.main.InstrumentCoverage.0.dot @@ -7,7 +7,7 @@ digraph Cov_0_3 { bcb1__Cov_0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">bcb1</td></tr><tr><td align="left" balign="left">Expression(bcb0 + bcb3) at 10:5-11:17<br align="left"/> 11:12-11:17: @2.Call: _2 = bar() -> [return: bb3, unwind: bb6]</td></tr><tr><td align="left" balign="left">bb1: FalseUnwind<br align="left"/>bb2: Call</td></tr><tr><td align="left" balign="left">bb3: SwitchInt</td></tr></table>>]; bcb0__Cov_0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">bcb0</td></tr><tr><td align="left" balign="left"></td></tr><tr><td align="left" balign="left">Counter(bcb0) at 9:1-9:11<br align="left"/> </td></tr><tr><td align="left" balign="left">bb0: Goto</td></tr></table>>]; bcb3__Cov_0_3 -> bcb1__Cov_0_3 [label=<>]; - bcb1__Cov_0_3 -> bcb3__Cov_0_3 [label=<false>]; + bcb1__Cov_0_3 -> bcb3__Cov_0_3 [label=<0>]; bcb1__Cov_0_3 -> bcb2__Cov_0_3 [label=<otherwise>]; bcb0__Cov_0_3 -> bcb1__Cov_0_3 [label=<>]; } diff --git a/src/test/mir-opt/coverage_graphviz.rs b/tests/mir-opt/coverage_graphviz.rs index 09403bb3a..09403bb3a 100644 --- a/src/test/mir-opt/coverage_graphviz.rs +++ b/tests/mir-opt/coverage_graphviz.rs diff --git a/src/test/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff index bf9ab8669..bf9ab8669 100644 --- a/src/test/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff diff --git a/src/test/mir-opt/dataflow-const-prop/cast.rs b/tests/mir-opt/dataflow-const-prop/cast.rs index 484403f7f..484403f7f 100644 --- a/src/test/mir-opt/dataflow-const-prop/cast.rs +++ b/tests/mir-opt/dataflow-const-prop/cast.rs diff --git a/src/test/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff index a4ebd0c8c..a4ebd0c8c 100644 --- a/src/test/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff diff --git a/src/test/mir-opt/dataflow-const-prop/checked.rs b/tests/mir-opt/dataflow-const-prop/checked.rs index 0738a4ee5..0738a4ee5 100644 --- a/src/test/mir-opt/dataflow-const-prop/checked.rs +++ b/tests/mir-opt/dataflow-const-prop/checked.rs diff --git a/src/test/mir-opt/dataflow-const-prop/enum.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/enum.main.DataflowConstProp.diff index 2ced794e6..fce18fae4 100644 --- a/src/test/mir-opt/dataflow-const-prop/enum.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.main.DataflowConstProp.diff @@ -28,7 +28,7 @@ discriminant(_1) = 0; // scope 0 at $DIR/enum.rs:+1:13: +1:21 StorageLive(_2); // scope 1 at $DIR/enum.rs:+2:9: +2:10 _3 = discriminant(_1); // scope 1 at $DIR/enum.rs:+2:19: +2:20 - switchInt(move _3) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/enum.rs:+2:13: +2:20 + switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 1 at $DIR/enum.rs:+2:13: +2:20 } bb1: { diff --git a/src/test/mir-opt/dataflow-const-prop/enum.rs b/tests/mir-opt/dataflow-const-prop/enum.rs index 13288577d..13288577d 100644 --- a/src/test/mir-opt/dataflow-const-prop/enum.rs +++ b/tests/mir-opt/dataflow-const-prop/enum.rs diff --git a/src/test/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff index 26808c70f..32489b4bd 100644 --- a/src/test/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff @@ -42,8 +42,8 @@ + _4 = const 1_i32; // scope 1 at $DIR/if.rs:+2:16: +2:17 + _3 = const true; // scope 1 at $DIR/if.rs:+2:16: +2:22 StorageDead(_4); // scope 1 at $DIR/if.rs:+2:21: +2:22 -- switchInt(move _3) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22 -+ switchInt(const true) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22 +- switchInt(move _3) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22 ++ switchInt(const true) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22 } bb1: { @@ -73,8 +73,8 @@ + _9 = const 1_i32; // scope 3 at $DIR/if.rs:+5:16: +5:17 + _8 = const true; // scope 3 at $DIR/if.rs:+5:16: +5:22 StorageDead(_9); // scope 3 at $DIR/if.rs:+5:21: +5:22 -- switchInt(move _8) -> [false: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22 -+ switchInt(const true) -> [false: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22 +- switchInt(move _8) -> [0: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22 ++ switchInt(const true) -> [0: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22 } bb4: { diff --git a/src/test/mir-opt/dataflow-const-prop/if.rs b/tests/mir-opt/dataflow-const-prop/if.rs index 34fc35790..34fc35790 100644 --- a/src/test/mir-opt/dataflow-const-prop/if.rs +++ b/tests/mir-opt/dataflow-const-prop/if.rs diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff new file mode 100644 index 000000000..02aafd7ac --- /dev/null +++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff @@ -0,0 +1,39 @@ +- // MIR for `main` before DataflowConstProp ++ // MIR for `main` after DataflowConstProp + + fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/inherit_overflow.rs:+0:11: +0:11 + let mut _1: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47 + let mut _2: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47 + scope 1 { + } + scope 2 (inlined <u8 as Add>::add) { // at $DIR/inherit_overflow.rs:7:13: 7:47 + debug self => _1; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL + debug other => _2; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL + let mut _3: u8; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL + let mut _4: u8; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL + let mut _5: (u8, bool); // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47 + _1 = const u8::MAX; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47 + StorageLive(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47 + _2 = const 1_u8; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47 + StorageLive(_3); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL + _3 = const u8::MAX; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL + StorageLive(_4); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL + _4 = const 1_u8; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL + _5 = CheckedAdd(const u8::MAX, const 1_u8); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL + assert(!move (_5.1: bool), "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> bb1; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL + } + + bb1: { + StorageDead(_4); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL + StorageDead(_3); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL + StorageDead(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47 + StorageDead(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47 + return; // scope 0 at $DIR/inherit_overflow.rs:+4:2: +4:2 + } + } + diff --git a/src/test/mir-opt/dataflow-const-prop/inherit_overflow.rs b/tests/mir-opt/dataflow-const-prop/inherit_overflow.rs index 2f2d9d010..2f2d9d010 100644 --- a/src/test/mir-opt/dataflow-const-prop/inherit_overflow.rs +++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.rs diff --git a/src/test/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff index 881d80f7c..5a8788497 100644 --- a/src/test/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff @@ -10,8 +10,8 @@ StorageLive(_1); // scope 0 at $DIR/issue_81605.rs:+1:9: +1:33 StorageLive(_2); // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16 _2 = const true; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16 -+ switchInt(const true) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16 +- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16 ++ switchInt(const true) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16 } bb1: { diff --git a/src/test/mir-opt/dataflow-const-prop/issue_81605.rs b/tests/mir-opt/dataflow-const-prop/issue_81605.rs index d75e2a28b..d75e2a28b 100644 --- a/src/test/mir-opt/dataflow-const-prop/issue_81605.rs +++ b/tests/mir-opt/dataflow-const-prop/issue_81605.rs diff --git a/src/test/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff index 158f187f1..158f187f1 100644 --- a/src/test/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff diff --git a/src/test/mir-opt/dataflow-const-prop/ref_without_sb.rs b/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs index 2fd480b09..2fd480b09 100644 --- a/src/test/mir-opt/dataflow-const-prop/ref_without_sb.rs +++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs diff --git a/src/test/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff index f66b00a9a..f66b00a9a 100644 --- a/src/test/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff diff --git a/src/test/mir-opt/dataflow-const-prop/repr_transparent.rs b/tests/mir-opt/dataflow-const-prop/repr_transparent.rs index 4ce0ca4df..4ce0ca4df 100644 --- a/src/test/mir-opt/dataflow-const-prop/repr_transparent.rs +++ b/tests/mir-opt/dataflow-const-prop/repr_transparent.rs diff --git a/src/test/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff index df08eff94..df08eff94 100644 --- a/src/test/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff diff --git a/src/test/mir-opt/dataflow-const-prop/self_assign.rs b/tests/mir-opt/dataflow-const-prop/self_assign.rs index 8de2195f9..8de2195f9 100644 --- a/src/test/mir-opt/dataflow-const-prop/self_assign.rs +++ b/tests/mir-opt/dataflow-const-prop/self_assign.rs diff --git a/src/test/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff index c09e4061e..c09e4061e 100644 --- a/src/test/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff diff --git a/src/test/mir-opt/dataflow-const-prop/self_assign_add.rs b/tests/mir-opt/dataflow-const-prop/self_assign_add.rs index e32827624..e32827624 100644 --- a/src/test/mir-opt/dataflow-const-prop/self_assign_add.rs +++ b/tests/mir-opt/dataflow-const-prop/self_assign_add.rs diff --git a/src/test/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff index 8126d4b85..8126d4b85 100644 --- a/src/test/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff diff --git a/src/test/mir-opt/dataflow-const-prop/sibling_ptr.rs b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs index 87ef00d18..87ef00d18 100644 --- a/src/test/mir-opt/dataflow-const-prop/sibling_ptr.rs +++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs diff --git a/src/test/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff index cfb2706c1..cfb2706c1 100644 --- a/src/test/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff diff --git a/src/test/mir-opt/dataflow-const-prop/struct.rs b/tests/mir-opt/dataflow-const-prop/struct.rs index 841b279e0..841b279e0 100644 --- a/src/test/mir-opt/dataflow-const-prop/struct.rs +++ b/tests/mir-opt/dataflow-const-prop/struct.rs diff --git a/src/test/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff index 8018400e7..8018400e7 100644 --- a/src/test/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff diff --git a/src/test/mir-opt/dataflow-const-prop/terminator.rs b/tests/mir-opt/dataflow-const-prop/terminator.rs index d151f666a..d151f666a 100644 --- a/src/test/mir-opt/dataflow-const-prop/terminator.rs +++ b/tests/mir-opt/dataflow-const-prop/terminator.rs diff --git a/src/test/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff index e028def00..e028def00 100644 --- a/src/test/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff diff --git a/src/test/mir-opt/dataflow-const-prop/tuple.rs b/tests/mir-opt/dataflow-const-prop/tuple.rs index 92c70eab0..92c70eab0 100644 --- a/src/test/mir-opt/dataflow-const-prop/tuple.rs +++ b/tests/mir-opt/dataflow-const-prop/tuple.rs diff --git a/src/test/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff index 61d24c3b5..cd3b792fb 100644 --- a/src/test/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff +++ b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff @@ -37,8 +37,8 @@ } bb2: { -- switchInt(move _5) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/cycle.rs:+3:11: +3:17 -+ switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/cycle.rs:+3:11: +3:17 +- switchInt(move _5) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/cycle.rs:+3:11: +3:17 ++ switchInt(move _4) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/cycle.rs:+3:11: +3:17 } bb3: { @@ -59,14 +59,6 @@ - _4 = const (); // scope 0 at $DIR/cycle.rs:+3:18: +8:6 - StorageDead(_6); // scope 0 at $DIR/cycle.rs:+8:5: +8:6 + StorageLive(_5); // scope 0 at $DIR/cycle.rs:+4:13: +4:17 -+ nop; // scope 0 at $DIR/cycle.rs:+4:20: +4:21 -+ nop; // scope 1 at $DIR/cycle.rs:+5:13: +5:14 -+ nop; // scope 1 at $DIR/cycle.rs:+5:9: +5:14 -+ nop; // scope 1 at $DIR/cycle.rs:+6:13: +6:14 -+ nop; // scope 1 at $DIR/cycle.rs:+6:9: +6:14 -+ nop; // scope 1 at $DIR/cycle.rs:+7:13: +7:17 -+ nop; // scope 1 at $DIR/cycle.rs:+7:9: +7:17 -+ nop; // scope 0 at $DIR/cycle.rs:+3:18: +8:6 StorageDead(_5); // scope 0 at $DIR/cycle.rs:+8:5: +8:6 + StorageDead(_4); // scope 0 at $DIR/cycle.rs:+8:5: +8:6 goto -> bb1; // scope 0 at $DIR/cycle.rs:+3:5: +8:6 diff --git a/src/test/mir-opt/dead-store-elimination/cycle.rs b/tests/mir-opt/dead-store-elimination/cycle.rs index b35ce0bcb..b35ce0bcb 100644 --- a/src/test/mir-opt/dead-store-elimination/cycle.rs +++ b/tests/mir-opt/dead-store-elimination/cycle.rs diff --git a/src/test/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination.diff b/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination.diff index 89f1846b4..89f1846b4 100644 --- a/src/test/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination.diff +++ b/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination.diff diff --git a/src/test/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff b/tests/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff index b5f98233b..b5f98233b 100644 --- a/src/test/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff +++ b/tests/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff diff --git a/src/test/mir-opt/dead-store-elimination/provenance_soundness.rs b/tests/mir-opt/dead-store-elimination/provenance_soundness.rs index 11314e990..11314e990 100644 --- a/src/test/mir-opt/dead-store-elimination/provenance_soundness.rs +++ b/tests/mir-opt/dead-store-elimination/provenance_soundness.rs diff --git a/src/test/mir-opt/deaggregator_test.bar.Deaggregator.diff b/tests/mir-opt/deaggregator_test.bar.Deaggregator.diff index db136485a..db136485a 100644 --- a/src/test/mir-opt/deaggregator_test.bar.Deaggregator.diff +++ b/tests/mir-opt/deaggregator_test.bar.Deaggregator.diff diff --git a/src/test/mir-opt/deaggregator_test.rs b/tests/mir-opt/deaggregator_test.rs index ee59402af..ee59402af 100644 --- a/src/test/mir-opt/deaggregator_test.rs +++ b/tests/mir-opt/deaggregator_test.rs diff --git a/src/test/mir-opt/deaggregator_test_enum.bar.Deaggregator.diff b/tests/mir-opt/deaggregator_test_enum.bar.Deaggregator.diff index f28c2b482..f28c2b482 100644 --- a/src/test/mir-opt/deaggregator_test_enum.bar.Deaggregator.diff +++ b/tests/mir-opt/deaggregator_test_enum.bar.Deaggregator.diff diff --git a/src/test/mir-opt/deaggregator_test_enum.rs b/tests/mir-opt/deaggregator_test_enum.rs index ea402dafd..ea402dafd 100644 --- a/src/test/mir-opt/deaggregator_test_enum.rs +++ b/tests/mir-opt/deaggregator_test_enum.rs diff --git a/src/test/mir-opt/deaggregator_test_enum_2.rs b/tests/mir-opt/deaggregator_test_enum_2.rs index 955c31732..955c31732 100644 --- a/src/test/mir-opt/deaggregator_test_enum_2.rs +++ b/tests/mir-opt/deaggregator_test_enum_2.rs diff --git a/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff b/tests/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff index fb18089e0..210d3849e 100644 --- a/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff +++ b/tests/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff @@ -12,7 +12,7 @@ bb0: { StorageLive(_3); // scope 0 at $DIR/deaggregator_test_enum_2.rs:+1:8: +1:9 _3 = _1; // scope 0 at $DIR/deaggregator_test_enum_2.rs:+1:8: +1:9 - switchInt(move _3) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/deaggregator_test_enum_2.rs:+1:8: +1:9 + switchInt(move _3) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/deaggregator_test_enum_2.rs:+1:8: +1:9 } bb1: { diff --git a/src/test/mir-opt/deaggregator_test_multiple.rs b/tests/mir-opt/deaggregator_test_multiple.rs index 46305fe21..46305fe21 100644 --- a/src/test/mir-opt/deaggregator_test_multiple.rs +++ b/tests/mir-opt/deaggregator_test_multiple.rs diff --git a/src/test/mir-opt/deaggregator_test_multiple.test.Deaggregator.diff b/tests/mir-opt/deaggregator_test_multiple.test.Deaggregator.diff index cf5da273c..cf5da273c 100644 --- a/src/test/mir-opt/deaggregator_test_multiple.test.Deaggregator.diff +++ b/tests/mir-opt/deaggregator_test_multiple.test.Deaggregator.diff diff --git a/src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff index 995611f0e..3b1f81175 100644 --- a/src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff +++ b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff @@ -28,44 +28,44 @@ _7 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37 _8 = const 4_usize; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37 _9 = Ge(move _7, move _8); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37 - switchInt(move _9) -> [false: bb6, otherwise: bb2]; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37 + switchInt(move _9) -> [0: bb6, otherwise: bb2]; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37 } bb2: { - switchInt((*_2)[0 of 4]) -> [47_u8: bb3, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 + switchInt((*_2)[0 of 4]) -> [47: bb3, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 } bb3: { - switchInt((*_2)[1 of 4]) -> [47_u8: bb4, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 + switchInt((*_2)[1 of 4]) -> [47: bb4, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 } bb4: { - switchInt((*_2)[2 of 4]) -> [47_u8: bb5, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 + switchInt((*_2)[2 of 4]) -> [47: bb5, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 } bb5: { -- switchInt((*_2)[3 of 4]) -> [47_u8: bb11, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 -+ switchInt((*_2)[3 of 4]) -> [47_u8: bb10, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 +- switchInt((*_2)[3 of 4]) -> [47: bb11, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 ++ switchInt((*_2)[3 of 4]) -> [47: bb10, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 } bb6: { _4 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31 _5 = const 3_usize; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31 _6 = Ge(move _4, move _5); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31 - switchInt(move _6) -> [false: bb10, otherwise: bb7]; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31 + switchInt(move _6) -> [0: bb10, otherwise: bb7]; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31 } bb7: { - switchInt((*_2)[0 of 3]) -> [47_u8: bb8, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 + switchInt((*_2)[0 of 3]) -> [47: bb8, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 } bb8: { - switchInt((*_2)[1 of 3]) -> [47_u8: bb9, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 + switchInt((*_2)[1 of 3]) -> [47: bb9, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 } bb9: { -- switchInt((*_2)[2 of 3]) -> [47_u8: bb12, 33_u8: bb13, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 -+ switchInt((*_2)[2 of 3]) -> [47_u8: bb11, 33_u8: bb11, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 +- switchInt((*_2)[2 of 3]) -> [47: bb12, 33: bb13, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 ++ switchInt((*_2)[2 of 3]) -> [47: bb11, 33: bb11, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23 } bb10: { diff --git a/src/test/mir-opt/deduplicate_blocks.rs b/tests/mir-opt/deduplicate_blocks.rs index 2b9eed99e..2b9eed99e 100644 --- a/src/test/mir-opt/deduplicate_blocks.rs +++ b/tests/mir-opt/deduplicate_blocks.rs diff --git a/src/test/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir b/tests/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir index 5b185082d..9597a0c83 100644 --- a/src/test/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir +++ b/tests/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir @@ -17,7 +17,7 @@ fn foo(_1: Option<String>) -> i32 { _7 = const false; // scope 0 at $DIR/string.rs:+1:11: +1:12 _7 = const true; // scope 0 at $DIR/string.rs:+1:11: +1:12 _5 = discriminant(_1); // scope 0 at $DIR/string.rs:+1:11: +1:12 - switchInt(move _5) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/string.rs:+1:5: +1:12 + switchInt(move _5) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/string.rs:+1:5: +1:12 } bb1: { @@ -47,7 +47,7 @@ fn foo(_1: Option<String>) -> i32 { } bb4: { - switchInt(move _4) -> [false: bb1, otherwise: bb5]; // scope 0 at $DIR/string.rs:+2:14: +2:17 + switchInt(move _4) -> [0: bb1, otherwise: bb5]; // scope 0 at $DIR/string.rs:+2:14: +2:17 } bb5: { @@ -69,6 +69,6 @@ fn foo(_1: Option<String>) -> i32 { } bb9: { - switchInt(_7) -> [false: bb7, otherwise: bb8]; // scope 0 at $DIR/string.rs:+5:1: +5:2 + switchInt(_7) -> [0: bb7, otherwise: bb8]; // scope 0 at $DIR/string.rs:+5:1: +5:2 } } diff --git a/src/test/mir-opt/deref-patterns/string.rs b/tests/mir-opt/deref-patterns/string.rs index 3a99c44aa..3a99c44aa 100644 --- a/src/test/mir-opt/deref-patterns/string.rs +++ b/tests/mir-opt/deref-patterns/string.rs diff --git a/src/test/mir-opt/derefer_complex_case.main.Derefer.diff b/tests/mir-opt/derefer_complex_case.main.Derefer.diff index 713d56c38..fa3eeedc4 100644 --- a/src/test/mir-opt/derefer_complex_case.main.Derefer.diff +++ b/tests/mir-opt/derefer_complex_case.main.Derefer.diff @@ -62,7 +62,7 @@ bb3: { StorageDead(_8); // scope 1 at $DIR/derefer_complex_case.rs:+1:25: +1:26 _10 = discriminant(_7); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26 - switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26 + switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5]; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26 } bb4: { diff --git a/src/test/mir-opt/derefer_complex_case.rs b/tests/mir-opt/derefer_complex_case.rs index dc48cee95..dc48cee95 100644 --- a/src/test/mir-opt/derefer_complex_case.rs +++ b/tests/mir-opt/derefer_complex_case.rs diff --git a/src/test/mir-opt/derefer_inline_test.main.Derefer.diff b/tests/mir-opt/derefer_inline_test.main.Derefer.diff index 3540df308..3540df308 100644 --- a/src/test/mir-opt/derefer_inline_test.main.Derefer.diff +++ b/tests/mir-opt/derefer_inline_test.main.Derefer.diff diff --git a/src/test/mir-opt/derefer_inline_test.rs b/tests/mir-opt/derefer_inline_test.rs index cc06a7dd8..cc06a7dd8 100644 --- a/src/test/mir-opt/derefer_inline_test.rs +++ b/tests/mir-opt/derefer_inline_test.rs diff --git a/src/test/mir-opt/derefer_terminator_test.main.Derefer.diff b/tests/mir-opt/derefer_terminator_test.main.Derefer.diff index 60f7b9d56..ab2388d13 100644 --- a/src/test/mir-opt/derefer_terminator_test.main.Derefer.diff +++ b/tests/mir-opt/derefer_terminator_test.main.Derefer.diff @@ -54,11 +54,11 @@ _6 = &_7; // scope 2 at $DIR/derefer_terminator_test.rs:+3:18: +3:21 _5 = &_6; // scope 2 at $DIR/derefer_terminator_test.rs:+3:17: +3:21 _4 = &_5; // scope 2 at $DIR/derefer_terminator_test.rs:+3:15: +3:22 -- switchInt((*(*(*(*_4))))) -> [false: bb3, otherwise: bb4]; // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22 +- switchInt((*(*(*(*_4))))) -> [0: bb3, otherwise: bb4]; // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22 + _10 = deref_copy (*_4); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22 + _11 = deref_copy (*_10); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22 + _12 = deref_copy (*_11); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22 -+ switchInt((*_12)) -> [false: bb3, otherwise: bb4]; // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22 ++ switchInt((*_12)) -> [0: bb3, otherwise: bb4]; // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22 } bb3: { diff --git a/src/test/mir-opt/derefer_terminator_test.rs b/tests/mir-opt/derefer_terminator_test.rs index d6750c29d..d6750c29d 100644 --- a/src/test/mir-opt/derefer_terminator_test.rs +++ b/tests/mir-opt/derefer_terminator_test.rs diff --git a/src/test/mir-opt/derefer_test.main.Derefer.diff b/tests/mir-opt/derefer_test.main.Derefer.diff index 87306d818..87306d818 100644 --- a/src/test/mir-opt/derefer_test.main.Derefer.diff +++ b/tests/mir-opt/derefer_test.main.Derefer.diff diff --git a/src/test/mir-opt/derefer_test.rs b/tests/mir-opt/derefer_test.rs index fad0fe8eb..fad0fe8eb 100644 --- a/src/test/mir-opt/derefer_test.rs +++ b/tests/mir-opt/derefer_test.rs diff --git a/src/test/mir-opt/derefer_test_multiple.main.Derefer.diff b/tests/mir-opt/derefer_test_multiple.main.Derefer.diff index 3e40db118..3e40db118 100644 --- a/src/test/mir-opt/derefer_test_multiple.main.Derefer.diff +++ b/tests/mir-opt/derefer_test_multiple.main.Derefer.diff diff --git a/src/test/mir-opt/derefer_test_multiple.rs b/tests/mir-opt/derefer_test_multiple.rs index 0b3888b07..0b3888b07 100644 --- a/src/test/mir-opt/derefer_test_multiple.rs +++ b/tests/mir-opt/derefer_test_multiple.rs diff --git a/src/test/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff index 5fa7013d5..9c7296632 100644 --- a/src/test/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff +++ b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff @@ -37,7 +37,7 @@ } bb2: { - switchInt(move _3) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/branch.rs:+3:16: +3:22 + switchInt(move _3) -> [0: bb4, otherwise: bb3]; // scope 1 at $DIR/branch.rs:+3:16: +3:22 } bb3: { diff --git a/src/test/mir-opt/dest-prop/branch.rs b/tests/mir-opt/dest-prop/branch.rs index 898c908b1..898c908b1 100644 --- a/src/test/mir-opt/dest-prop/branch.rs +++ b/tests/mir-opt/dest-prop/branch.rs diff --git a/src/test/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.diff index 4343a5935..4343a5935 100644 --- a/src/test/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.diff diff --git a/src/test/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff index 298991b5a..298991b5a 100644 --- a/src/test/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff diff --git a/src/test/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.diff index bc88787e6..bc88787e6 100644 --- a/src/test/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.diff diff --git a/src/test/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.diff index d37a9f71d..d37a9f71d 100644 --- a/src/test/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.diff diff --git a/src/test/mir-opt/dest-prop/copy_propagation_arg.rs b/tests/mir-opt/dest-prop/copy_propagation_arg.rs index 31be6c931..31be6c931 100644 --- a/src/test/mir-opt/dest-prop/copy_propagation_arg.rs +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.rs diff --git a/src/test/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff index cfc203c5f..cfc203c5f 100644 --- a/src/test/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff +++ b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff diff --git a/src/test/mir-opt/dest-prop/cycle.rs b/tests/mir-opt/dest-prop/cycle.rs index 6182878f3..6182878f3 100644 --- a/src/test/mir-opt/dest-prop/cycle.rs +++ b/tests/mir-opt/dest-prop/cycle.rs diff --git a/src/test/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.mir b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.mir index 63cac133b..63cac133b 100644 --- a/src/test/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.mir +++ b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.mir diff --git a/src/test/mir-opt/dest-prop/dead_stores_79191.rs b/tests/mir-opt/dest-prop/dead_stores_79191.rs index 43e0bf664..43e0bf664 100644 --- a/src/test/mir-opt/dest-prop/dead_stores_79191.rs +++ b/tests/mir-opt/dest-prop/dead_stores_79191.rs diff --git a/src/test/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.mir b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.mir index ba7f76d28..26068931a 100644 --- a/src/test/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.mir +++ b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.mir @@ -13,7 +13,6 @@ fn f(_1: usize) -> usize { bb0: { nop; // scope 0 at $DIR/dead_stores_better.rs:+1:9: +1:10 nop; // scope 0 at $DIR/dead_stores_better.rs:+1:13: +1:14 - nop; // scope 1 at $DIR/dead_stores_better.rs:+2:5: +2:10 nop; // scope 1 at $DIR/dead_stores_better.rs:+3:9: +3:10 nop; // scope 1 at $DIR/dead_stores_better.rs:+3:9: +3:10 nop; // scope 1 at $DIR/dead_stores_better.rs:+3:5: +3:10 diff --git a/src/test/mir-opt/dest-prop/dead_stores_better.rs b/tests/mir-opt/dest-prop/dead_stores_better.rs index 003ad57d8..003ad57d8 100644 --- a/src/test/mir-opt/dest-prop/dead_stores_better.rs +++ b/tests/mir-opt/dest-prop/dead_stores_better.rs diff --git a/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff index c2a3a0025..c2a3a0025 100644 --- a/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff +++ b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff diff --git a/src/test/mir-opt/dest-prop/simple.rs b/tests/mir-opt/dest-prop/simple.rs index d4c27228f..d4c27228f 100644 --- a/src/test/mir-opt/dest-prop/simple.rs +++ b/tests/mir-opt/dest-prop/simple.rs diff --git a/src/test/mir-opt/dest-prop/union.main.DestinationPropagation.diff b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.diff index 85d994bc8..fbed31788 100644 --- a/src/test/mir-opt/dest-prop/union.main.DestinationPropagation.diff +++ b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.diff @@ -25,11 +25,8 @@ } bb1: { - nop; // scope 0 at $DIR/union.rs:+5:14: +5:30 - nop; // scope 0 at $DIR/union.rs:+5:14: +5:30 StorageDead(_2); // scope 0 at $DIR/union.rs:+5:29: +5:30 StorageLive(_3); // scope 1 at $DIR/union.rs:+7:10: +7:26 - nop; // scope 2 at $DIR/union.rs:+7:19: +7:24 StorageDead(_3); // scope 1 at $DIR/union.rs:+7:26: +7:27 StorageDead(_1); // scope 0 at $DIR/union.rs:+8:1: +8:2 return; // scope 0 at $DIR/union.rs:+8:2: +8:2 diff --git a/src/test/mir-opt/dest-prop/union.rs b/tests/mir-opt/dest-prop/union.rs index eb6cb09fc..eb6cb09fc 100644 --- a/src/test/mir-opt/dest-prop/union.rs +++ b/tests/mir-opt/dest-prop/union.rs diff --git a/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.diff b/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.diff new file mode 100644 index 000000000..9ea756c27 --- /dev/null +++ b/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.diff @@ -0,0 +1,86 @@ +- // MIR for `f` before DestinationPropagation ++ // MIR for `f` after DestinationPropagation + + fn f(_1: T) -> () { + debug a => _1; // in scope 0 at $DIR/unreachable.rs:+0:19: +0:20 + let mut _0: (); // return place in scope 0 at $DIR/unreachable.rs:+0:25: +0:25 + let _2: T; // in scope 0 at $DIR/unreachable.rs:+1:9: +1:10 + let mut _3: bool; // in scope 0 at $DIR/unreachable.rs:+2:8: +2:13 + let _4: (); // in scope 0 at $DIR/unreachable.rs:+3:9: +3:16 + let mut _5: T; // in scope 0 at $DIR/unreachable.rs:+3:11: +3:12 + let mut _6: T; // in scope 0 at $DIR/unreachable.rs:+3:14: +3:15 + let _7: (); // in scope 0 at $DIR/unreachable.rs:+5:9: +5:16 + let mut _8: T; // in scope 0 at $DIR/unreachable.rs:+5:11: +5:12 + let mut _9: T; // in scope 0 at $DIR/unreachable.rs:+5:14: +5:15 + scope 1 { +- debug b => _2; // in scope 1 at $DIR/unreachable.rs:+1:9: +1:10 ++ debug b => _1; // in scope 1 at $DIR/unreachable.rs:+1:9: +1:10 + } + + bb0: { +- StorageLive(_2); // scope 0 at $DIR/unreachable.rs:+1:9: +1:10 +- _2 = _1; // scope 0 at $DIR/unreachable.rs:+1:13: +1:14 ++ nop; // scope 0 at $DIR/unreachable.rs:+1:9: +1:10 ++ nop; // scope 0 at $DIR/unreachable.rs:+1:13: +1:14 + StorageLive(_3); // scope 1 at $DIR/unreachable.rs:+2:8: +2:13 + _3 = const false; // scope 1 at $DIR/unreachable.rs:+2:8: +2:13 +- goto -> bb3; // scope 1 at $DIR/unreachable.rs:+2:8: +2:13 ++ goto -> bb1; // scope 1 at $DIR/unreachable.rs:+2:8: +2:13 + } + + bb1: { +- StorageLive(_4); // scope 1 at $DIR/unreachable.rs:+3:9: +3:16 +- StorageLive(_5); // scope 1 at $DIR/unreachable.rs:+3:11: +3:12 +- _5 = _1; // scope 1 at $DIR/unreachable.rs:+3:11: +3:12 +- StorageLive(_6); // scope 1 at $DIR/unreachable.rs:+3:14: +3:15 +- _6 = _2; // scope 1 at $DIR/unreachable.rs:+3:14: +3:15 +- _4 = g::<T>(move _5, move _6) -> bb2; // scope 1 at $DIR/unreachable.rs:+3:9: +3:16 +- // mir::Constant +- // + span: $DIR/unreachable.rs:11:9: 11:10 +- // + literal: Const { ty: fn(T, T) {g::<T>}, val: Value(<ZST>) } +- } +- +- bb2: { +- StorageDead(_6); // scope 1 at $DIR/unreachable.rs:+3:15: +3:16 +- StorageDead(_5); // scope 1 at $DIR/unreachable.rs:+3:15: +3:16 +- StorageDead(_4); // scope 1 at $DIR/unreachable.rs:+3:16: +3:17 +- _0 = const (); // scope 1 at $DIR/unreachable.rs:+2:14: +4:6 +- goto -> bb5; // scope 1 at $DIR/unreachable.rs:+2:5: +6:6 +- } +- +- bb3: { + StorageLive(_7); // scope 1 at $DIR/unreachable.rs:+5:9: +5:16 +- StorageLive(_8); // scope 1 at $DIR/unreachable.rs:+5:11: +5:12 +- _8 = _2; // scope 1 at $DIR/unreachable.rs:+5:11: +5:12 ++ nop; // scope 1 at $DIR/unreachable.rs:+5:11: +5:12 ++ nop; // scope 1 at $DIR/unreachable.rs:+5:11: +5:12 + StorageLive(_9); // scope 1 at $DIR/unreachable.rs:+5:14: +5:15 +- _9 = _2; // scope 1 at $DIR/unreachable.rs:+5:14: +5:15 +- _7 = g::<T>(move _8, move _9) -> bb4; // scope 1 at $DIR/unreachable.rs:+5:9: +5:16 ++ _9 = _1; // scope 1 at $DIR/unreachable.rs:+5:14: +5:15 ++ _7 = g::<T>(move _1, move _9) -> bb2; // scope 1 at $DIR/unreachable.rs:+5:9: +5:16 + // mir::Constant + // + span: $DIR/unreachable.rs:13:9: 13:10 + // + literal: Const { ty: fn(T, T) {g::<T>}, val: Value(<ZST>) } + } + +- bb4: { ++ bb2: { + StorageDead(_9); // scope 1 at $DIR/unreachable.rs:+5:15: +5:16 +- StorageDead(_8); // scope 1 at $DIR/unreachable.rs:+5:15: +5:16 ++ nop; // scope 1 at $DIR/unreachable.rs:+5:15: +5:16 + StorageDead(_7); // scope 1 at $DIR/unreachable.rs:+5:16: +5:17 + _0 = const (); // scope 1 at $DIR/unreachable.rs:+4:12: +6:6 +- goto -> bb5; // scope 1 at $DIR/unreachable.rs:+2:5: +6:6 ++ goto -> bb3; // scope 1 at $DIR/unreachable.rs:+2:5: +6:6 + } + +- bb5: { ++ bb3: { + StorageDead(_3); // scope 1 at $DIR/unreachable.rs:+6:5: +6:6 +- StorageDead(_2); // scope 0 at $DIR/unreachable.rs:+7:1: +7:2 ++ nop; // scope 0 at $DIR/unreachable.rs:+7:1: +7:2 + return; // scope 0 at $DIR/unreachable.rs:+7:2: +7:2 + } + } + diff --git a/tests/mir-opt/dest-prop/unreachable.rs b/tests/mir-opt/dest-prop/unreachable.rs new file mode 100644 index 000000000..32b5def98 --- /dev/null +++ b/tests/mir-opt/dest-prop/unreachable.rs @@ -0,0 +1,18 @@ +// Check that unreachable code is removed after the destination propagation. +// Regression test for issue #105428. +// +// compile-flags: --crate-type=lib -Zmir-opt-level=0 +// compile-flags: -Zmir-enable-passes=+ConstProp,+SimplifyConstCondition-after-const-prop,+DestinationPropagation + +// EMIT_MIR unreachable.f.DestinationPropagation.diff +pub fn f<T: Copy>(a: T) { + let b = a; + if false { + g(a, b); + } else { + g(b, b); + } +} + +#[inline(never)] +pub fn g<T: Copy>(_: T, _: T) {} diff --git a/tests/mir-opt/div_overflow.const_dividend.PreCodegen.after.mir b/tests/mir-opt/div_overflow.const_dividend.PreCodegen.after.mir new file mode 100644 index 000000000..d7f66a6bf --- /dev/null +++ b/tests/mir-opt/div_overflow.const_dividend.PreCodegen.after.mir @@ -0,0 +1,17 @@ +// MIR for `const_dividend` after PreCodegen + +fn const_dividend(_1: i32) -> i32 { + debug a => _1; // in scope 0 at $DIR/div_overflow.rs:+0:23: +0:24 + let mut _0: i32; // return place in scope 0 at $DIR/div_overflow.rs:+0:34: +0:37 + let mut _2: bool; // in scope 0 at $DIR/div_overflow.rs:+1:5: +1:12 + + bb0: { + _2 = Eq(_1, const 0_i32); // scope 0 at $DIR/div_overflow.rs:+1:5: +1:12 + assert(!move _2, "attempt to divide `{}` by zero", const 256_i32) -> bb1; // scope 0 at $DIR/div_overflow.rs:+1:5: +1:12 + } + + bb1: { + _0 = Div(const 256_i32, move _1); // scope 0 at $DIR/div_overflow.rs:+1:5: +1:12 + return; // scope 0 at $DIR/div_overflow.rs:+2:2: +2:2 + } +} diff --git a/tests/mir-opt/div_overflow.const_divisor.PreCodegen.after.mir b/tests/mir-opt/div_overflow.const_divisor.PreCodegen.after.mir new file mode 100644 index 000000000..7b7ab1978 --- /dev/null +++ b/tests/mir-opt/div_overflow.const_divisor.PreCodegen.after.mir @@ -0,0 +1,11 @@ +// MIR for `const_divisor` after PreCodegen + +fn const_divisor(_1: i32) -> i32 { + debug a => _1; // in scope 0 at $DIR/div_overflow.rs:+0:22: +0:23 + let mut _0: i32; // return place in scope 0 at $DIR/div_overflow.rs:+0:33: +0:36 + + bb0: { + _0 = Div(move _1, const 256_i32); // scope 0 at $DIR/div_overflow.rs:+1:5: +1:12 + return; // scope 0 at $DIR/div_overflow.rs:+2:2: +2:2 + } +} diff --git a/tests/mir-opt/div_overflow.rs b/tests/mir-opt/div_overflow.rs new file mode 100644 index 000000000..10ce5bc0f --- /dev/null +++ b/tests/mir-opt/div_overflow.rs @@ -0,0 +1,18 @@ +// compile-flags: -Copt-level=0 -Coverflow-checks=yes + +// Tests that division with a const does not emit a panicking branch for overflow + +// EMIT_MIR div_overflow.const_divisor.PreCodegen.after.mir +pub fn const_divisor(a: i32) -> i32 { + a / 256 +} + +// EMIT_MIR div_overflow.const_dividend.PreCodegen.after.mir +pub fn const_dividend(a: i32) -> i32 { + 256 / a +} + +fn main() { + const_divisor(123); + const_dividend(123); +} diff --git a/src/test/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff index 89d8106ae..98a02ee38 100644 --- a/src/test/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff @@ -31,13 +31,13 @@ StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17 StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17 _7 = discriminant((_3.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17 -- switchInt(move _7) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 +- switchInt(move _7) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + StorageLive(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + _10 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + _11 = Ne(_7, move _10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + StorageDead(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 -+ switchInt(move _11) -> [false: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 ++ switchInt(move _11) -> [0: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 } bb1: { @@ -49,7 +49,7 @@ bb2: { - _6 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17 -- switchInt(move _6) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 +- switchInt(move _6) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 - } - - bb3: { @@ -72,7 +72,7 @@ + + bb4: { + StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 -+ switchInt(_7) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 ++ switchInt(_7) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 } } diff --git a/src/test/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff index 1a9efa930..aa75c44b8 100644 --- a/src/test/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff @@ -32,18 +32,18 @@ StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17 StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17 _8 = discriminant((_3.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17 -- switchInt(move _8) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 +- switchInt(move _8) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + _11 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + StorageLive(_12); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + _12 = Ne(_8, move _11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 -+ switchInt(move _12) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 ++ switchInt(move _12) -> [0: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 } bb1: { - _6 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17 -- switchInt(move _6) -> [0_isize: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 +- switchInt(move _6) -> [0: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 - } - - bb2: { @@ -55,7 +55,7 @@ - bb3: { - _7 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17 -- switchInt(move _7) -> [1_isize: bb4, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 +- switchInt(move _7) -> [1: bb4, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 - } - - bb4: { @@ -86,7 +86,7 @@ + + bb5: { + StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 -+ switchInt(_8) -> [0_isize: bb3, 1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 ++ switchInt(_8) -> [0: bb3, 1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 } } diff --git a/src/test/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff index 309a72ae5..cea6ff7cd 100644 --- a/src/test/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff @@ -31,13 +31,13 @@ StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17 StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch.rs:+1:16: +1:17 _7 = discriminant((_3.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17 -- switchInt(move _7) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 +- switchInt(move _7) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + StorageLive(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + _10 = discriminant((_3.1: std::option::Option<bool>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + _11 = Ne(_7, move _10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 + StorageDead(_10); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 -+ switchInt(move _11) -> [false: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 ++ switchInt(move _11) -> [0: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 } bb1: { @@ -49,7 +49,7 @@ bb2: { - _6 = discriminant((_3.1: std::option::Option<bool>)); // scope 0 at $DIR/early_otherwise_branch.rs:+1:11: +1:17 -- switchInt(move _6) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 +- switchInt(move _6) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 - } - - bb3: { @@ -72,7 +72,7 @@ + + bb4: { + StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 -+ switchInt(_7) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 ++ switchInt(_7) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:+1:5: +1:17 } } diff --git a/src/test/mir-opt/early_otherwise_branch.rs b/tests/mir-opt/early_otherwise_branch.rs index 7be9fbd03..7be9fbd03 100644 --- a/src/test/mir-opt/early_otherwise_branch.rs +++ b/tests/mir-opt/early_otherwise_branch.rs diff --git a/src/test/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff index 9574f32f7..b90d70ce4 100644 --- a/src/test/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff @@ -42,13 +42,13 @@ StorageDead(_6); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:19: +1:20 StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:19: +1:20 _10 = discriminant((_4.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:11: +1:20 -- switchInt(move _10) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 +- switchInt(move _10) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 + StorageLive(_14); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 + _14 = discriminant((_4.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 + StorageLive(_15); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 + _15 = Ne(_10, move _14); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 + StorageDead(_14); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 -+ switchInt(move _15) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 ++ switchInt(move _15) -> [0: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 } bb1: { @@ -61,13 +61,13 @@ bb2: { - _9 = discriminant((_4.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:11: +1:20 -- switchInt(move _9) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 +- switchInt(move _9) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 - } - - bb3: { _8 = discriminant((_4.2: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:11: +1:20 -- switchInt(move _8) -> [1_isize: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 -+ switchInt(move _8) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 +- switchInt(move _8) -> [1: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 ++ switchInt(move _8) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 } - bb4: { @@ -94,7 +94,7 @@ + + bb5: { + StorageDead(_15); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 -+ switchInt(_10) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 ++ switchInt(_10) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:+1:5: +1:20 } } diff --git a/src/test/mir-opt/early_otherwise_branch_3_element_tuple.rs b/tests/mir-opt/early_otherwise_branch_3_element_tuple.rs index 76055e133..76055e133 100644 --- a/src/test/mir-opt/early_otherwise_branch_3_element_tuple.rs +++ b/tests/mir-opt/early_otherwise_branch_3_element_tuple.rs diff --git a/src/test/mir-opt/early_otherwise_branch_68867.rs b/tests/mir-opt/early_otherwise_branch_68867.rs index a6a56f3a9..a6a56f3a9 100644 --- a/src/test/mir-opt/early_otherwise_branch_68867.rs +++ b/tests/mir-opt/early_otherwise_branch_68867.rs diff --git a/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff index 6bc025bb5..9edd1a39f 100644 --- a/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff @@ -80,13 +80,13 @@ StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:23: +5:24 _34 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24 _11 = discriminant((*_34)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24 - switchInt(move _11) -> [0_isize: bb1, 1_isize: bb3, 2_isize: bb4, 3_isize: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24 + switchInt(move _11) -> [0: bb1, 1: bb3, 2: bb4, 3: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24 } bb1: { _35 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24 _7 = discriminant((*_35)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24 - switchInt(move _7) -> [0_isize: bb6, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24 + switchInt(move _7) -> [0: bb6, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24 } bb2: { @@ -104,19 +104,19 @@ bb3: { _36 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24 _8 = discriminant((*_36)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24 - switchInt(move _8) -> [1_isize: bb7, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24 + switchInt(move _8) -> [1: bb7, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24 } bb4: { _37 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24 _9 = discriminant((*_37)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24 - switchInt(move _9) -> [2_isize: bb8, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24 + switchInt(move _9) -> [2: bb8, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24 } bb5: { _38 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24 _10 = discriminant((*_38)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24 - switchInt(move _10) -> [3_isize: bb9, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24 + switchInt(move _10) -> [3: bb9, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24 } bb6: { diff --git a/src/test/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff index 321f57951..82d8b2fc5 100644 --- a/src/test/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff @@ -38,12 +38,12 @@ StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:16: +1:17 StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:16: +1:17 _8 = discriminant((_3.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:11: +1:17 - switchInt(move _8) -> [0_isize: bb1, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17 + switchInt(move _8) -> [0: bb1, 1: bb4, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17 } bb1: { _6 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:11: +1:17 - switchInt(move _6) -> [0_isize: bb2, 1_isize: bb7, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17 + switchInt(move _6) -> [0: bb2, 1: bb7, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17 } bb2: { @@ -57,7 +57,7 @@ bb4: { _7 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:11: +1:17 - switchInt(move _7) -> [0_isize: bb6, 1_isize: bb5, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17 + switchInt(move _7) -> [0: bb6, 1: bb5, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:+1:5: +1:17 } bb5: { diff --git a/src/test/mir-opt/early_otherwise_branch_noopt.rs b/tests/mir-opt/early_otherwise_branch_noopt.rs index ef766bbd4..ef766bbd4 100644 --- a/src/test/mir-opt/early_otherwise_branch_noopt.rs +++ b/tests/mir-opt/early_otherwise_branch_noopt.rs diff --git a/src/test/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff index 8b556acb2..a3fa2529b 100644 --- a/src/test/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff @@ -14,7 +14,7 @@ bb0: { _3 = discriminant(_1); // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:11: +1:12 - switchInt(move _3) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:5: +1:12 + switchInt(move _3) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:5: +1:12 } bb1: { @@ -24,7 +24,7 @@ bb2: { _4 = discriminant((*_2)); // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+3:26: +3:28 - switchInt(move _4) -> [1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+3:20: +3:28 + switchInt(move _4) -> [1: bb4, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:+3:20: +3:28 } bb3: { diff --git a/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff index 659aed18f..6d0224b54 100644 --- a/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff @@ -12,13 +12,13 @@ bb0: { _3 = discriminant((*_1)); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31 - switchInt(move _3) -> [1_isize: bb1, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31 + switchInt(move _3) -> [1: bb1, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31 } bb1: { _4 = deref_copy (((*_1) as Some).0: &E<'_>); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31 _2 = discriminant((*_4)); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31 - switchInt(move _2) -> [1_isize: bb2, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31 + switchInt(move _2) -> [1: bb2, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31 } bb2: { diff --git a/src/test/mir-opt/early_otherwise_branch_soundness.rs b/tests/mir-opt/early_otherwise_branch_soundness.rs index cd4589232..cd4589232 100644 --- a/src/test/mir-opt/early_otherwise_branch_soundness.rs +++ b/tests/mir-opt/early_otherwise_branch_soundness.rs diff --git a/src/test/mir-opt/equal_true.opt.InstCombine.diff b/tests/mir-opt/equal_true.opt.InstCombine.diff index 89982308e..8b542a7c1 100644 --- a/src/test/mir-opt/equal_true.opt.InstCombine.diff +++ b/tests/mir-opt/equal_true.opt.InstCombine.diff @@ -14,7 +14,7 @@ - _2 = Eq(move _3, const true); // scope 0 at $DIR/equal_true.rs:+1:8: +1:17 + _2 = move _3; // scope 0 at $DIR/equal_true.rs:+1:8: +1:17 StorageDead(_3); // scope 0 at $DIR/equal_true.rs:+1:16: +1:17 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/equal_true.rs:+1:8: +1:17 + switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/equal_true.rs:+1:8: +1:17 } bb1: { diff --git a/src/test/mir-opt/equal_true.rs b/tests/mir-opt/equal_true.rs index 717d10c6d..717d10c6d 100644 --- a/src/test/mir-opt/equal_true.rs +++ b/tests/mir-opt/equal_true.rs diff --git a/src/test/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir b/tests/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir index 08481777e..ab9550499 100644 --- a/src/test/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir @@ -19,7 +19,7 @@ fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 { bb0: { FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/exponential_or.rs:+1:11: +1:12 - switchInt((_1.0: u32)) -> [1_u32: bb2, 4_u32: bb2, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:15: +2:20 + switchInt((_1.0: u32)) -> [1: bb2, 4: bb2, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:15: +2:20 } bb1: { @@ -29,31 +29,31 @@ fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 { bb2: { _2 = discriminant((_1.2: std::option::Option<i32>)); // scope 0 at $DIR/exponential_or.rs:+2:37: +2:55 - switchInt(move _2) -> [0_isize: bb4, 1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:37: +2:55 + switchInt(move _2) -> [0: bb4, 1: bb3, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:37: +2:55 } bb3: { - switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1_i32: bb4, 8_i32: bb4, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:37: +2:55 + switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1: bb4, 8: bb4, otherwise: bb1]; // scope 0 at $DIR/exponential_or.rs:+2:37: +2:55 } bb4: { _5 = Le(const 6_u32, (_1.3: u32)); // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67 - switchInt(move _5) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67 + switchInt(move _5) -> [0: bb6, otherwise: bb5]; // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67 } bb5: { _6 = Le((_1.3: u32), const 9_u32); // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67 - switchInt(move _6) -> [false: bb6, otherwise: bb8]; // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67 + switchInt(move _6) -> [0: bb6, otherwise: bb8]; // scope 0 at $DIR/exponential_or.rs:+2:62: +2:67 } bb6: { _3 = Le(const 13_u32, (_1.3: u32)); // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77 - switchInt(move _3) -> [false: bb1, otherwise: bb7]; // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77 + switchInt(move _3) -> [0: bb1, otherwise: bb7]; // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77 } bb7: { _4 = Le((_1.3: u32), const 16_u32); // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77 - switchInt(move _4) -> [false: bb1, otherwise: bb8]; // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77 + switchInt(move _4) -> [0: bb1, otherwise: bb8]; // scope 0 at $DIR/exponential_or.rs:+2:70: +2:77 } bb8: { diff --git a/src/test/mir-opt/exponential_or.rs b/tests/mir-opt/exponential_or.rs index 0b8be8385..0b8be8385 100644 --- a/src/test/mir-opt/exponential_or.rs +++ b/tests/mir-opt/exponential_or.rs diff --git a/src/test/mir-opt/fn_ptr_shim.core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir b/tests/mir-opt/fn_ptr_shim.core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir index c63433d36..c63433d36 100644 --- a/src/test/mir-opt/fn_ptr_shim.core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir +++ b/tests/mir-opt/fn_ptr_shim.core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir diff --git a/src/test/mir-opt/fn_ptr_shim.rs b/tests/mir-opt/fn_ptr_shim.rs index 64fbdc9de..64fbdc9de 100644 --- a/src/test/mir-opt/fn_ptr_shim.rs +++ b/tests/mir-opt/fn_ptr_shim.rs diff --git a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff b/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff index 6ab63e82e..c1c2cde71 100644 --- a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff +++ b/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff @@ -47,7 +47,7 @@ bb1: { StorageDead(_5); // scope 0 at $DIR/funky_arms.rs:+4:36: +4:37 StorageLive(_6); // scope 1 at $DIR/funky_arms.rs:+8:9: +8:13 - switchInt(_4) -> [false: bb3, otherwise: bb2]; // scope 1 at $DIR/funky_arms.rs:+8:16: +8:32 + switchInt(_4) -> [0: bb3, otherwise: bb2]; // scope 1 at $DIR/funky_arms.rs:+8:16: +8:32 } bb2: { @@ -75,7 +75,7 @@ bb5: { StorageDead(_8); // scope 3 at $DIR/funky_arms.rs:+13:44: +13:45 _9 = discriminant(_7); // scope 3 at $DIR/funky_arms.rs:+13:12: +13:27 - switchInt(move _9) -> [1_isize: bb6, otherwise: bb8]; // scope 3 at $DIR/funky_arms.rs:+13:12: +13:27 + switchInt(move _9) -> [1: bb6, otherwise: bb8]; // scope 3 at $DIR/funky_arms.rs:+13:12: +13:27 } bb6: { diff --git a/src/test/mir-opt/funky_arms.rs b/tests/mir-opt/funky_arms.rs index 3e70d85e0..3e70d85e0 100644 --- a/src/test/mir-opt/funky_arms.rs +++ b/tests/mir-opt/funky_arms.rs diff --git a/src/test/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir b/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir index c3b08bf06..a8e090020 100644 --- a/src/test/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir +++ b/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir @@ -29,7 +29,7 @@ fn main::{closure#0}(_1: *mut [generator@$DIR/generator_drop_cleanup.rs:10:15: 1 bb0: { _8 = discriminant((*_1)); // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6 - switchInt(move _8) -> [0_u32: bb7, 3_u32: bb10, otherwise: bb11]; // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6 + switchInt(move _8) -> [0: bb7, 3: bb10, otherwise: bb11]; // scope 0 at $DIR/generator_drop_cleanup.rs:+0:15: +3:6 } bb1: { diff --git a/src/test/mir-opt/generator_drop_cleanup.rs b/tests/mir-opt/generator_drop_cleanup.rs index 82c1292cb..82c1292cb 100644 --- a/src/test/mir-opt/generator_drop_cleanup.rs +++ b/tests/mir-opt/generator_drop_cleanup.rs diff --git a/src/test/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir b/tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir index cfbe0aaf2..cfbe0aaf2 100644 --- a/src/test/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir +++ b/tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir diff --git a/src/test/mir-opt/generator_storage_dead_unwind.rs b/tests/mir-opt/generator_storage_dead_unwind.rs index b72170ade..b72170ade 100644 --- a/src/test/mir-opt/generator_storage_dead_unwind.rs +++ b/tests/mir-opt/generator_storage_dead_unwind.rs diff --git a/src/test/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir b/tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir index fee6da2c6..b3d3c768a 100644 --- a/src/test/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir +++ b/tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir @@ -32,7 +32,7 @@ fn main::{closure#0}(_1: Pin<&mut [generator@$DIR/generator_tiny.rs:19:16: 19:24 bb0: { _11 = discriminant((*(_1.0: &mut [generator@$DIR/generator_tiny.rs:19:16: 19:24]))); // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6 - switchInt(move _11) -> [0_u32: bb1, 3_u32: bb5, otherwise: bb6]; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6 + switchInt(move _11) -> [0: bb1, 3: bb5, otherwise: bb6]; // scope 0 at $DIR/generator_tiny.rs:+0:16: +6:6 } bb1: { diff --git a/src/test/mir-opt/generator_tiny.rs b/tests/mir-opt/generator_tiny.rs index 7dad63a61..7dad63a61 100644 --- a/src/test/mir-opt/generator_tiny.rs +++ b/tests/mir-opt/generator_tiny.rs diff --git a/src/test/mir-opt/graphviz.main.built.after.dot b/tests/mir-opt/graphviz.main.built.after.dot index 8d1da7f1b..8d1da7f1b 100644 --- a/src/test/mir-opt/graphviz.main.built.after.dot +++ b/tests/mir-opt/graphviz.main.built.after.dot diff --git a/src/test/mir-opt/graphviz.rs b/tests/mir-opt/graphviz.rs index 6906b86c2..6906b86c2 100644 --- a/src/test/mir-opt/graphviz.rs +++ b/tests/mir-opt/graphviz.rs diff --git a/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff index 94180d203..de4235c9e 100644 --- a/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff @@ -9,7 +9,7 @@ bb0: { StorageLive(_2); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9 _2 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9 + switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9 } bb1: { diff --git a/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff index b22c7eac6..754c6579a 100644 --- a/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff @@ -13,7 +13,7 @@ _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9 _2 = Eq(move _3, const -42f32); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:18 StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:17: +1:18 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:18 + switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:18 } bb1: { diff --git a/src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff index cc0995f99..ff23839e2 100644 --- a/src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff @@ -20,10 +20,10 @@ _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:14 - _2 = Eq(move _3, const 17_i8); // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:20 - StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:19: +1:20 -- switchInt(_2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12 +- switchInt(_2) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12 + _2 = Eq(_3, const 17_i8); // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:20 + nop; // scope 0 at $DIR/if_condition_int.rs:+1:19: +1:20 -+ switchInt(move _3) -> [17_i8: bb1, otherwise: bb2]; // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12 ++ switchInt(move _3) -> [17: bb1, otherwise: bb2]; // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12 } bb1: { diff --git a/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff index 801ea0402..5964d76a4 100644 --- a/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff @@ -13,10 +13,10 @@ _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9 - _2 = Eq(move _3, const 'x'); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16 - StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:15: +1:16 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16 +- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16 + nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16 + nop; // scope 0 at $DIR/if_condition_int.rs:+1:15: +1:16 -+ switchInt(move _3) -> ['x': bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16 ++ switchInt(move _3) -> [120: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16 } bb1: { diff --git a/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff index 4297f4d64..98918cc74 100644 --- a/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff @@ -13,10 +13,10 @@ _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9 - _2 = Eq(move _3, const 42_i8); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 - StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 +- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 + nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 + nop; // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15 -+ switchInt(move _3) -> [42_i8: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 ++ switchInt(move _3) -> [42: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 } bb1: { diff --git a/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff index 8fb794abb..db38140b8 100644 --- a/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff @@ -15,10 +15,10 @@ _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9 - _2 = Eq(move _3, const 42_u32); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 - StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 +- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 + nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 + nop; // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15 -+ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 ++ switchInt(move _3) -> [42: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 } bb1: { @@ -34,10 +34,10 @@ _5 = _1; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:16 - _4 = Ne(move _5, const 21_u32); // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22 - StorageDead(_5); // scope 0 at $DIR/if_condition_int.rs:+3:21: +3:22 -- switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22 +- switchInt(move _4) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22 + nop; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22 + nop; // scope 0 at $DIR/if_condition_int.rs:+3:21: +3:22 -+ switchInt(move _5) -> [21_u32: bb4, otherwise: bb3]; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22 ++ switchInt(move _5) -> [21: bb4, otherwise: bb3]; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22 } bb3: { diff --git a/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff index 992253ea7..1a1ac4caa 100644 --- a/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff @@ -13,10 +13,10 @@ _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9 - _2 = Eq(move _3, const -42_i32); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16 - StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:15: +1:16 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16 +- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16 + nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16 + nop; // scope 0 at $DIR/if_condition_int.rs:+1:15: +1:16 -+ switchInt(move _3) -> [-42_i32: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16 ++ switchInt(move _3) -> [4294967254: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:16 } bb1: { diff --git a/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff index 7cea9472d..fc3f50227 100644 --- a/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff @@ -13,10 +13,10 @@ _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9 - _2 = Eq(move _3, const 42_u32); // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 - StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 +- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 + nop; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 + nop; // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15 -+ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 ++ switchInt(move _3) -> [42: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15 } bb1: { diff --git a/src/test/mir-opt/if_condition_int.rs b/tests/mir-opt/if_condition_int.rs index 398311e6b..398311e6b 100644 --- a/src/test/mir-opt/if_condition_int.rs +++ b/tests/mir-opt/if_condition_int.rs diff --git a/src/test/mir-opt/inline/asm_unwind.main.Inline.diff b/tests/mir-opt/inline/asm_unwind.main.Inline.diff index f1b62ac38..f1b62ac38 100644 --- a/src/test/mir-opt/inline/asm_unwind.main.Inline.diff +++ b/tests/mir-opt/inline/asm_unwind.main.Inline.diff diff --git a/src/test/mir-opt/inline/asm_unwind.rs b/tests/mir-opt/inline/asm_unwind.rs index c03feb433..c03feb433 100644 --- a/src/test/mir-opt/inline/asm_unwind.rs +++ b/tests/mir-opt/inline/asm_unwind.rs diff --git a/src/test/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff b/tests/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff index 8b0300678..8b0300678 100644 --- a/src/test/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff +++ b/tests/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff diff --git a/src/test/mir-opt/inline/caller_with_trivial_bound.rs b/tests/mir-opt/inline/caller_with_trivial_bound.rs index 8545db894..8545db894 100644 --- a/src/test/mir-opt/inline/caller_with_trivial_bound.rs +++ b/tests/mir-opt/inline/caller_with_trivial_bound.rs diff --git a/src/test/mir-opt/inline/cycle.f.Inline.diff b/tests/mir-opt/inline/cycle.f.Inline.diff index 75ea69a42..75ea69a42 100644 --- a/src/test/mir-opt/inline/cycle.f.Inline.diff +++ b/tests/mir-opt/inline/cycle.f.Inline.diff diff --git a/src/test/mir-opt/inline/cycle.g.Inline.diff b/tests/mir-opt/inline/cycle.g.Inline.diff index afe157ccd..5f3ee467c 100644 --- a/src/test/mir-opt/inline/cycle.g.Inline.diff +++ b/tests/mir-opt/inline/cycle.g.Inline.diff @@ -10,6 +10,8 @@ + let _3: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8 + let mut _4: &fn() {main}; // in scope 1 at $DIR/cycle.rs:6:5: 6:6 + let mut _5: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8 ++ scope 2 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) { // at $DIR/cycle.rs:6:5: 6:8 ++ } + } bb0: { @@ -27,10 +29,7 @@ + StorageLive(_4); // scope 1 at $DIR/cycle.rs:6:5: 6:6 + _4 = &_2; // scope 1 at $DIR/cycle.rs:6:5: 6:6 + StorageLive(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8 -+ _3 = <fn() {main} as Fn<()>>::call(move _4, move _5) -> [return: bb2, unwind: bb3]; // scope 1 at $DIR/cycle.rs:6:5: 6:8 -+ // mir::Constant -+ // + span: $DIR/cycle.rs:6:5: 6:6 -+ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() {main}, ()) -> <fn() {main} as FnOnce<()>>::Output {<fn() {main} as Fn<()>>::call}, val: Value(<ZST>) } ++ _3 = move (*_4)() -> [return: bb4, unwind: bb2]; // scope 2 at $SRC_DIR/core/src/ops/function.rs:LL:COL } bb1: { @@ -40,19 +39,19 @@ return; // scope 0 at $DIR/cycle.rs:+2:2: +2:2 + } + -+ bb2: { -+ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:7: 6:8 -+ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8 -+ StorageDead(_3); // scope 1 at $DIR/cycle.rs:6:8: 6:9 -+ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2 ++ bb2 (cleanup): { ++ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2 + } + + bb3 (cleanup): { -+ drop(_2) -> bb4; // scope 1 at $DIR/cycle.rs:7:1: 7:2 ++ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2 + } + -+ bb4 (cleanup): { -+ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2 ++ bb4: { ++ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:7: 6:8 ++ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8 ++ StorageDead(_3); // scope 1 at $DIR/cycle.rs:6:8: 6:9 ++ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2 } } diff --git a/src/test/mir-opt/inline/cycle.main.Inline.diff b/tests/mir-opt/inline/cycle.main.Inline.diff index bd89e09ec..6b4c63bbd 100644 --- a/src/test/mir-opt/inline/cycle.main.Inline.diff +++ b/tests/mir-opt/inline/cycle.main.Inline.diff @@ -10,6 +10,8 @@ + let _3: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8 + let mut _4: &fn() {g}; // in scope 1 at $DIR/cycle.rs:6:5: 6:6 + let mut _5: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8 ++ scope 2 (inlined <fn() {g} as Fn<()>>::call - shim(fn() {g})) { // at $DIR/cycle.rs:6:5: 6:8 ++ } + } bb0: { @@ -27,10 +29,7 @@ + StorageLive(_4); // scope 1 at $DIR/cycle.rs:6:5: 6:6 + _4 = &_2; // scope 1 at $DIR/cycle.rs:6:5: 6:6 + StorageLive(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8 -+ _3 = <fn() {g} as Fn<()>>::call(move _4, move _5) -> [return: bb2, unwind: bb3]; // scope 1 at $DIR/cycle.rs:6:5: 6:8 -+ // mir::Constant -+ // + span: $DIR/cycle.rs:6:5: 6:6 -+ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() {g}, ()) -> <fn() {g} as FnOnce<()>>::Output {<fn() {g} as Fn<()>>::call}, val: Value(<ZST>) } ++ _3 = move (*_4)() -> [return: bb4, unwind: bb2]; // scope 2 at $SRC_DIR/core/src/ops/function.rs:LL:COL } bb1: { @@ -40,19 +39,19 @@ return; // scope 0 at $DIR/cycle.rs:+2:2: +2:2 + } + -+ bb2: { -+ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:7: 6:8 -+ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8 -+ StorageDead(_3); // scope 1 at $DIR/cycle.rs:6:8: 6:9 -+ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2 ++ bb2 (cleanup): { ++ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2 + } + + bb3 (cleanup): { -+ drop(_2) -> bb4; // scope 1 at $DIR/cycle.rs:7:1: 7:2 ++ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2 + } + -+ bb4 (cleanup): { -+ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2 ++ bb4: { ++ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:7: 6:8 ++ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8 ++ StorageDead(_3); // scope 1 at $DIR/cycle.rs:6:8: 6:9 ++ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2 } } diff --git a/src/test/mir-opt/inline/cycle.rs b/tests/mir-opt/inline/cycle.rs index 9e8950d8a..9e8950d8a 100644 --- a/src/test/mir-opt/inline/cycle.rs +++ b/tests/mir-opt/inline/cycle.rs diff --git a/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff b/tests/mir-opt/inline/dyn_trait.get_query.Inline.diff index 8ea1a0757..8ea1a0757 100644 --- a/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff +++ b/tests/mir-opt/inline/dyn_trait.get_query.Inline.diff diff --git a/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff index 7653a5ded..7653a5ded 100644 --- a/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff +++ b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff diff --git a/src/test/mir-opt/inline/dyn_trait.rs b/tests/mir-opt/inline/dyn_trait.rs index 6a46e1e07..6a46e1e07 100644 --- a/src/test/mir-opt/inline/dyn_trait.rs +++ b/tests/mir-opt/inline/dyn_trait.rs diff --git a/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff index a71d73b74..a71d73b74 100644 --- a/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff +++ b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff diff --git a/tests/mir-opt/inline/exponential_runtime.main.Inline.diff b/tests/mir-opt/inline/exponential_runtime.main.Inline.diff new file mode 100644 index 000000000..7fd62be7a --- /dev/null +++ b/tests/mir-opt/inline/exponential_runtime.main.Inline.diff @@ -0,0 +1,75 @@ +- // MIR for `main` before Inline ++ // MIR for `main` after Inline + + fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/exponential_runtime.rs:+0:11: +0:11 + let _1: (); // in scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22 ++ scope 1 (inlined <() as G>::call) { // at $DIR/exponential_runtime.rs:86:5: 86:22 ++ let _2: (); // in scope 1 at $DIR/exponential_runtime.rs:73:9: 73:25 ++ let _3: (); // in scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25 ++ let _4: (); // in scope 1 at $DIR/exponential_runtime.rs:75:9: 75:25 ++ scope 2 (inlined <() as F>::call) { // at $DIR/exponential_runtime.rs:73:9: 73:25 ++ let _5: (); // in scope 2 at $DIR/exponential_runtime.rs:61:9: 61:25 ++ let _6: (); // in scope 2 at $DIR/exponential_runtime.rs:62:9: 62:25 ++ let _7: (); // in scope 2 at $DIR/exponential_runtime.rs:63:9: 63:25 ++ } ++ } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22 +- _1 = <() as G>::call() -> bb1; // scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22 ++ StorageLive(_2); // scope 1 at $DIR/exponential_runtime.rs:73:9: 73:25 ++ StorageLive(_5); // scope 2 at $DIR/exponential_runtime.rs:61:9: 61:25 ++ _5 = <() as E>::call() -> bb3; // scope 2 at $DIR/exponential_runtime.rs:61:9: 61:25 + // mir::Constant +- // + span: $DIR/exponential_runtime.rs:86:5: 86:20 +- // + literal: Const { ty: fn() {<() as G>::call}, val: Value(<ZST>) } ++ // + span: $DIR/exponential_runtime.rs:61:9: 61:23 ++ // + literal: Const { ty: fn() {<() as E>::call}, val: Value(<ZST>) } + } + + bb1: { ++ StorageDead(_3); // scope 1 at $DIR/exponential_runtime.rs:74:25: 74:26 ++ StorageLive(_4); // scope 1 at $DIR/exponential_runtime.rs:75:9: 75:25 ++ _4 = <() as F>::call() -> bb2; // scope 1 at $DIR/exponential_runtime.rs:75:9: 75:25 ++ // mir::Constant ++ // + span: $DIR/exponential_runtime.rs:75:9: 75:23 ++ // + literal: Const { ty: fn() {<() as F>::call}, val: Value(<ZST>) } ++ } ++ ++ bb2: { ++ StorageDead(_4); // scope 1 at $DIR/exponential_runtime.rs:75:25: 75:26 + StorageDead(_1); // scope 0 at $DIR/exponential_runtime.rs:+1:22: +1:23 + _0 = const (); // scope 0 at $DIR/exponential_runtime.rs:+0:11: +2:2 + return; // scope 0 at $DIR/exponential_runtime.rs:+2:2: +2:2 ++ } ++ ++ bb3: { ++ StorageDead(_5); // scope 2 at $DIR/exponential_runtime.rs:61:25: 61:26 ++ StorageLive(_6); // scope 2 at $DIR/exponential_runtime.rs:62:9: 62:25 ++ _6 = <() as E>::call() -> bb4; // scope 2 at $DIR/exponential_runtime.rs:62:9: 62:25 ++ // mir::Constant ++ // + span: $DIR/exponential_runtime.rs:62:9: 62:23 ++ // + literal: Const { ty: fn() {<() as E>::call}, val: Value(<ZST>) } ++ } ++ ++ bb4: { ++ StorageDead(_6); // scope 2 at $DIR/exponential_runtime.rs:62:25: 62:26 ++ StorageLive(_7); // scope 2 at $DIR/exponential_runtime.rs:63:9: 63:25 ++ _7 = <() as E>::call() -> bb5; // scope 2 at $DIR/exponential_runtime.rs:63:9: 63:25 ++ // mir::Constant ++ // + span: $DIR/exponential_runtime.rs:63:9: 63:23 ++ // + literal: Const { ty: fn() {<() as E>::call}, val: Value(<ZST>) } ++ } ++ ++ bb5: { ++ StorageDead(_7); // scope 2 at $DIR/exponential_runtime.rs:63:25: 63:26 ++ StorageDead(_2); // scope 1 at $DIR/exponential_runtime.rs:73:25: 73:26 ++ StorageLive(_3); // scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25 ++ _3 = <() as F>::call() -> bb1; // scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25 ++ // mir::Constant ++ // + span: $DIR/exponential_runtime.rs:74:9: 74:23 ++ // + literal: Const { ty: fn() {<() as F>::call}, val: Value(<ZST>) } + } + } + diff --git a/src/test/mir-opt/inline/exponential_runtime.rs b/tests/mir-opt/inline/exponential_runtime.rs index d9219d76a..d9219d76a 100644 --- a/src/test/mir-opt/inline/exponential_runtime.rs +++ b/tests/mir-opt/inline/exponential_runtime.rs diff --git a/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir b/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir index 3502c2586..3502c2586 100644 --- a/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir +++ b/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir diff --git a/src/test/mir-opt/inline/inline_any_operand.rs b/tests/mir-opt/inline/inline_any_operand.rs index fb0de020f..fb0de020f 100644 --- a/src/test/mir-opt/inline/inline_any_operand.rs +++ b/tests/mir-opt/inline/inline_any_operand.rs diff --git a/src/test/mir-opt/inline/inline_async.rs b/tests/mir-opt/inline/inline_async.rs index 5c838159b..5c838159b 100644 --- a/src/test/mir-opt/inline/inline_async.rs +++ b/tests/mir-opt/inline/inline_async.rs diff --git a/src/test/mir-opt/inline/inline_closure.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir index 9eb3a01ee..9eb3a01ee 100644 --- a/src/test/mir-opt/inline/inline_closure.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir diff --git a/src/test/mir-opt/inline/inline_closure.rs b/tests/mir-opt/inline/inline_closure.rs index 715fd0138..715fd0138 100644 --- a/src/test/mir-opt/inline/inline_closure.rs +++ b/tests/mir-opt/inline/inline_closure.rs diff --git a/src/test/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir index dd32eb2d8..dd32eb2d8 100644 --- a/src/test/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir diff --git a/src/test/mir-opt/inline/inline_closure_borrows_arg.rs b/tests/mir-opt/inline/inline_closure_borrows_arg.rs index d76bc33f5..d76bc33f5 100644 --- a/src/test/mir-opt/inline/inline_closure_borrows_arg.rs +++ b/tests/mir-opt/inline/inline_closure_borrows_arg.rs diff --git a/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir index fd19c2886..fd19c2886 100644 --- a/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir diff --git a/src/test/mir-opt/inline/inline_closure_captures.rs b/tests/mir-opt/inline/inline_closure_captures.rs index 52b6817e4..52b6817e4 100644 --- a/src/test/mir-opt/inline/inline_closure_captures.rs +++ b/tests/mir-opt/inline/inline_closure_captures.rs diff --git a/src/test/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff b/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff index e30a5e116..e30a5e116 100644 --- a/src/test/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff +++ b/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff diff --git a/src/test/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff b/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff index c2b3c46a3..c2b3c46a3 100644 --- a/src/test/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff +++ b/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff diff --git a/src/test/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff index 0ca5a5f70..0ca5a5f70 100644 --- a/src/test/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff +++ b/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff diff --git a/src/test/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff index 00d405c77..00d405c77 100644 --- a/src/test/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff +++ b/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff diff --git a/src/test/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff index 8b9c86f55..8b9c86f55 100644 --- a/src/test/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff +++ b/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff diff --git a/src/test/mir-opt/inline/inline_compatibility.rs b/tests/mir-opt/inline/inline_compatibility.rs index 30aff0a64..30aff0a64 100644 --- a/src/test/mir-opt/inline/inline_compatibility.rs +++ b/tests/mir-opt/inline/inline_compatibility.rs diff --git a/tests/mir-opt/inline/inline_cycle.one.Inline.diff b/tests/mir-opt/inline/inline_cycle.one.Inline.diff new file mode 100644 index 000000000..5510cd7bc --- /dev/null +++ b/tests/mir-opt/inline/inline_cycle.one.Inline.diff @@ -0,0 +1,30 @@ +- // MIR for `one` before Inline ++ // MIR for `one` after Inline + + fn one() -> () { + let mut _0: (); // return place in scope 0 at $DIR/inline_cycle.rs:+0:10: +0:10 + let _1: (); // in scope 0 at $DIR/inline_cycle.rs:+1:5: +1:24 ++ scope 1 (inlined <C as Call>::call) { // at $DIR/inline_cycle.rs:14:5: 14:24 ++ scope 2 (inlined <A<C> as Call>::call) { // at $DIR/inline_cycle.rs:43:9: 43:23 ++ scope 3 (inlined <B<C> as Call>::call) { // at $DIR/inline_cycle.rs:28:9: 28:31 ++ } ++ } ++ } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:24 +- _1 = <C as Call>::call() -> bb1; // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:24 ++ _1 = <C as Call>::call() -> bb1; // scope 3 at $DIR/inline_cycle.rs:36:9: 36:28 + // mir::Constant +- // + span: $DIR/inline_cycle.rs:14:5: 14:22 ++ // + span: $DIR/inline_cycle.rs:36:9: 36:26 + // + literal: Const { ty: fn() {<C as Call>::call}, val: Value(<ZST>) } + } + + bb1: { + StorageDead(_1); // scope 0 at $DIR/inline_cycle.rs:+1:24: +1:25 + _0 = const (); // scope 0 at $DIR/inline_cycle.rs:+0:10: +2:2 + return; // scope 0 at $DIR/inline_cycle.rs:+2:2: +2:2 + } + } + diff --git a/src/test/mir-opt/inline/inline_cycle.rs b/tests/mir-opt/inline/inline_cycle.rs index 63ad57de1..63ad57de1 100644 --- a/src/test/mir-opt/inline/inline_cycle.rs +++ b/tests/mir-opt/inline/inline_cycle.rs diff --git a/src/test/mir-opt/inline/inline_cycle.two.Inline.diff b/tests/mir-opt/inline/inline_cycle.two.Inline.diff index a940848c2..64c0065b5 100644 --- a/src/test/mir-opt/inline/inline_cycle.two.Inline.diff +++ b/tests/mir-opt/inline/inline_cycle.two.Inline.diff @@ -9,6 +9,8 @@ + debug f => _2; // in scope 1 at $DIR/inline_cycle.rs:53:22: 53:23 + let _3: (); // in scope 1 at $DIR/inline_cycle.rs:54:5: 54:8 + let mut _4: (); // in scope 1 at $DIR/inline_cycle.rs:54:5: 54:8 ++ scope 2 (inlined <fn() {f} as FnOnce<()>>::call_once - shim(fn() {f})) { // at $DIR/inline_cycle.rs:54:5: 54:8 ++ } + } bb0: { @@ -24,10 +26,7 @@ // + literal: Const { ty: fn() {f}, val: Value(<ZST>) } + StorageLive(_3); // scope 1 at $DIR/inline_cycle.rs:54:5: 54:8 + StorageLive(_4); // scope 1 at $DIR/inline_cycle.rs:54:5: 54:8 -+ _3 = <fn() {f} as FnOnce<()>>::call_once(move _2, move _4) -> bb1; // scope 1 at $DIR/inline_cycle.rs:54:5: 54:8 -+ // mir::Constant -+ // + span: $DIR/inline_cycle.rs:54:5: 54:6 -+ // + literal: Const { ty: extern "rust-call" fn(fn() {f}, ()) -> <fn() {f} as FnOnce<()>>::Output {<fn() {f} as FnOnce<()>>::call_once}, val: Value(<ZST>) } ++ _3 = move _2() -> bb1; // scope 2 at $SRC_DIR/core/src/ops/function.rs:LL:COL } bb1: { diff --git a/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff b/tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff index 04de3e61e..52debab4d 100644 --- a/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff +++ b/tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff @@ -6,18 +6,21 @@ let _1: (); // in scope 0 at $DIR/inline_cycle_generic.rs:+1:5: +1:24 + scope 1 (inlined <C as Call>::call) { // at $DIR/inline_cycle_generic.rs:9:5: 9:24 + scope 2 (inlined <B<A> as Call>::call) { // at $DIR/inline_cycle_generic.rs:38:9: 38:31 ++ scope 3 (inlined <A as Call>::call) { // at $DIR/inline_cycle_generic.rs:31:9: 31:28 ++ scope 4 (inlined <B<C> as Call>::call) { // at $DIR/inline_cycle_generic.rs:23:9: 23:31 ++ } ++ } + } + } bb0: { StorageLive(_1); // scope 0 at $DIR/inline_cycle_generic.rs:+1:5: +1:24 - _1 = <C as Call>::call() -> bb1; // scope 0 at $DIR/inline_cycle_generic.rs:+1:5: +1:24 -+ _1 = <A as Call>::call() -> bb1; // scope 2 at $DIR/inline_cycle_generic.rs:31:9: 31:28 ++ _1 = <C as Call>::call() -> bb1; // scope 4 at $DIR/inline_cycle_generic.rs:31:9: 31:28 // mir::Constant - // + span: $DIR/inline_cycle_generic.rs:9:5: 9:22 -- // + literal: Const { ty: fn() {<C as Call>::call}, val: Value(<ZST>) } + // + span: $DIR/inline_cycle_generic.rs:31:9: 31:26 -+ // + literal: Const { ty: fn() {<A as Call>::call}, val: Value(<ZST>) } + // + literal: Const { ty: fn() {<C as Call>::call}, val: Value(<ZST>) } } bb1: { diff --git a/src/test/mir-opt/inline/inline_cycle_generic.rs b/tests/mir-opt/inline/inline_cycle_generic.rs index 24b4f3793..24b4f3793 100644 --- a/src/test/mir-opt/inline/inline_cycle_generic.rs +++ b/tests/mir-opt/inline/inline_cycle_generic.rs diff --git a/src/test/mir-opt/inline/inline_diverging.f.Inline.diff b/tests/mir-opt/inline/inline_diverging.f.Inline.diff index b49191f49..b49191f49 100644 --- a/src/test/mir-opt/inline/inline_diverging.f.Inline.diff +++ b/tests/mir-opt/inline/inline_diverging.f.Inline.diff diff --git a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff b/tests/mir-opt/inline/inline_diverging.g.Inline.diff index 1e703a8fd..b787a19f4 100644 --- a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff +++ b/tests/mir-opt/inline/inline_diverging.g.Inline.diff @@ -19,7 +19,7 @@ _3 = _1; // scope 0 at $DIR/inline_diverging.rs:+1:8: +1:9 _2 = Gt(move _3, const 0_i32); // scope 0 at $DIR/inline_diverging.rs:+1:8: +1:13 StorageDead(_3); // scope 0 at $DIR/inline_diverging.rs:+1:12: +1:13 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/inline_diverging.rs:+1:8: +1:13 + switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/inline_diverging.rs:+1:8: +1:13 } bb1: { diff --git a/src/test/mir-opt/inline/inline_diverging.h.Inline.diff b/tests/mir-opt/inline/inline_diverging.h.Inline.diff index a01bcf164..f82fcf4c8 100644 --- a/src/test/mir-opt/inline/inline_diverging.h.Inline.diff +++ b/tests/mir-opt/inline/inline_diverging.h.Inline.diff @@ -20,6 +20,8 @@ + debug b => _9; // in scope 3 at $DIR/inline_diverging.rs:28:9: 28:10 + } + } ++ scope 4 (inlined <fn() -> ! {sleep} as Fn<()>>::call - shim(fn() -> ! {sleep})) { // at $DIR/inline_diverging.rs:27:13: 27:16 ++ } + } bb0: { @@ -38,25 +40,10 @@ + StorageLive(_4); // scope 1 at $DIR/inline_diverging.rs:27:13: 27:14 + _4 = &_2; // scope 1 at $DIR/inline_diverging.rs:27:13: 27:14 + StorageLive(_5); // scope 1 at $DIR/inline_diverging.rs:27:13: 27:16 -+ _3 = <fn() -> ! {sleep} as Fn<()>>::call(move _4, move _5) -> [return: bb1, unwind: bb5]; // scope 1 at $DIR/inline_diverging.rs:27:13: 27:16 -+ // mir::Constant -+ // + span: $DIR/inline_diverging.rs:27:13: 27:14 -+ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() -> ! {sleep}, ()) -> <fn() -> ! {sleep} as FnOnce<()>>::Output {<fn() -> ! {sleep} as Fn<()>>::call}, val: Value(<ZST>) } ++ _3 = move (*_4)() -> [return: bb6, unwind: bb4]; // scope 4 at $SRC_DIR/core/src/ops/function.rs:LL:COL + } + + bb1: { -+ StorageDead(_5); // scope 1 at $DIR/inline_diverging.rs:27:15: 27:16 -+ StorageDead(_4); // scope 1 at $DIR/inline_diverging.rs:27:15: 27:16 -+ StorageLive(_6); // scope 2 at $DIR/inline_diverging.rs:28:13: 28:14 -+ _6 = &_2; // scope 2 at $DIR/inline_diverging.rs:28:13: 28:14 -+ StorageLive(_7); // scope 2 at $DIR/inline_diverging.rs:28:13: 28:16 -+ _9 = <fn() -> ! {sleep} as Fn<()>>::call(move _6, move _7) -> [return: bb2, unwind: bb4]; // scope 2 at $DIR/inline_diverging.rs:28:13: 28:16 -+ // mir::Constant -+ // + span: $DIR/inline_diverging.rs:28:13: 28:14 -+ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() -> ! {sleep}, ()) -> <fn() -> ! {sleep} as FnOnce<()>>::Output {<fn() -> ! {sleep} as Fn<()>>::call}, val: Value(<ZST>) } -+ } -+ -+ bb2: { + StorageDead(_7); // scope 2 at $DIR/inline_diverging.rs:28:15: 28:16 + StorageDead(_6); // scope 2 at $DIR/inline_diverging.rs:28:15: 28:16 + StorageLive(_8); // scope 3 at $DIR/inline_diverging.rs:29:6: 29:7 @@ -66,23 +53,35 @@ + (_1.1: !) = move _9; // scope 3 at $DIR/inline_diverging.rs:29:5: 29:11 + StorageDead(_8); // scope 3 at $DIR/inline_diverging.rs:29:10: 29:11 + StorageDead(_3); // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2 -+ drop(_2) -> bb3; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2 ++ drop(_2) -> bb2; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2 + } + -+ bb3: { ++ bb2: { + unreachable; // scope 0 at $DIR/inline_diverging.rs:30:2: 30:2 + } + ++ bb3 (cleanup): { ++ drop(_3) -> bb4; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2 ++ } ++ + bb4 (cleanup): { -+ drop(_3) -> bb5; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2 ++ drop(_2) -> bb5; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2 + } + + bb5 (cleanup): { -+ drop(_2) -> bb6; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2 ++ resume; // scope 1 at $DIR/inline_diverging.rs:26:1: 30:2 + } + -+ bb6 (cleanup): { -+ resume; // scope 1 at $DIR/inline_diverging.rs:26:1: 30:2 ++ bb6: { ++ StorageDead(_5); // scope 1 at $DIR/inline_diverging.rs:27:15: 27:16 ++ StorageDead(_4); // scope 1 at $DIR/inline_diverging.rs:27:15: 27:16 ++ StorageLive(_6); // scope 2 at $DIR/inline_diverging.rs:28:13: 28:14 ++ _6 = &_2; // scope 2 at $DIR/inline_diverging.rs:28:13: 28:14 ++ StorageLive(_7); // scope 2 at $DIR/inline_diverging.rs:28:13: 28:16 ++ _9 = <fn() -> ! {sleep} as Fn<()>>::call(move _6, move _7) -> [return: bb1, unwind: bb3]; // scope 2 at $DIR/inline_diverging.rs:28:13: 28:16 ++ // mir::Constant ++ // + span: $DIR/inline_diverging.rs:28:13: 28:14 ++ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() -> ! {sleep}, ()) -> <fn() -> ! {sleep} as FnOnce<()>>::Output {<fn() -> ! {sleep} as Fn<()>>::call}, val: Value(<ZST>) } } } diff --git a/src/test/mir-opt/inline/inline_diverging.rs b/tests/mir-opt/inline/inline_diverging.rs index ae6f814c2..ae6f814c2 100644 --- a/src/test/mir-opt/inline/inline_diverging.rs +++ b/tests/mir-opt/inline/inline_diverging.rs diff --git a/src/test/mir-opt/inline/inline_generator.main.Inline.diff b/tests/mir-opt/inline/inline_generator.main.Inline.diff index 91bff3d32..f27b64c30 100644 --- a/src/test/mir-opt/inline/inline_generator.main.Inline.diff +++ b/tests/mir-opt/inline/inline_generator.main.Inline.diff @@ -7,7 +7,7 @@ let mut _2: std::pin::Pin<&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]>; // in scope 0 at $DIR/inline_generator.rs:+1:14: +1:32 let mut _3: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]; // in scope 0 at $DIR/inline_generator.rs:+1:23: +1:31 let mut _4: [generator@$DIR/inline_generator.rs:15:5: 15:8]; // in scope 0 at $DIR/inline_generator.rs:+1:28: +1:31 -+ let mut _7: bool; // in scope 0 at $DIR/inline_generator.rs:+1:14: +1:46 ++ let mut _7: bool; // in scope 0 at $DIR/inline_generator.rs:+1:33: +1:46 scope 1 { debug _r => _1; // in scope 1 at $DIR/inline_generator.rs:+1:9: +1:11 } @@ -23,7 +23,7 @@ + } + } + } -+ scope 6 (inlined g::{closure#0}) { // at $DIR/inline_generator.rs:9:14: 9:46 ++ scope 6 (inlined g::{closure#0}) { // at $DIR/inline_generator.rs:9:33: 9:46 + debug a => _7; // in scope 6 at $DIR/inline_generator.rs:15:6: 15:7 + let mut _8: i32; // in scope 6 at $DIR/inline_generator.rs:15:17: 15:39 + let mut _9: u32; // in scope 6 at $DIR/inline_generator.rs:15:5: 15:41 @@ -68,16 +68,16 @@ - // mir::Constant - // + span: $DIR/inline_generator.rs:9:33: 9:39 - // + literal: Const { ty: for<'a> fn(Pin<&'a mut [generator@$DIR/inline_generator.rs:15:5: 15:8]>, bool) -> GeneratorState<<[generator@$DIR/inline_generator.rs:15:5: 15:8] as Generator<bool>>::Yield, <[generator@$DIR/inline_generator.rs:15:5: 15:8] as Generator<bool>>::Return> {<[generator@$DIR/inline_generator.rs:15:5: 15:8] as Generator<bool>>::resume}, val: Value(<ZST>) } -+ StorageLive(_7); // scope 0 at $DIR/inline_generator.rs:+1:14: +1:46 -+ _7 = const false; // scope 0 at $DIR/inline_generator.rs:+1:14: +1:46 ++ StorageLive(_7); // scope 0 at $DIR/inline_generator.rs:+1:33: +1:46 ++ _7 = const false; // scope 0 at $DIR/inline_generator.rs:+1:33: +1:46 + _10 = deref_copy (_2.0: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline_generator.rs:15:5: 15:41 + _9 = discriminant((*_10)); // scope 6 at $DIR/inline_generator.rs:15:5: 15:41 -+ switchInt(move _9) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline_generator.rs:15:5: 15:41 ++ switchInt(move _9) -> [0: bb3, 1: bb8, 3: bb7, otherwise: bb9]; // scope 6 at $DIR/inline_generator.rs:15:5: 15:41 } - bb3: { + bb1: { -+ StorageDead(_7); // scope 0 at $DIR/inline_generator.rs:+1:14: +1:46 ++ StorageDead(_7); // scope 0 at $DIR/inline_generator.rs:+1:33: +1:46 StorageDead(_2); // scope 0 at $DIR/inline_generator.rs:+1:45: +1:46 StorageDead(_4); // scope 0 at $DIR/inline_generator.rs:+1:46: +1:47 _0 = const (); // scope 0 at $DIR/inline_generator.rs:+0:11: +2:2 @@ -92,7 +92,7 @@ + + bb3: { + StorageLive(_8); // scope 6 at $DIR/inline_generator.rs:15:17: 15:39 -+ switchInt(move _7) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline_generator.rs:15:20: 15:21 ++ switchInt(move _7) -> [0: bb5, otherwise: bb4]; // scope 6 at $DIR/inline_generator.rs:15:20: 15:21 + } + + bb4: { diff --git a/src/test/mir-opt/inline/inline_generator.rs b/tests/mir-opt/inline/inline_generator.rs index d11b3e548..d11b3e548 100644 --- a/src/test/mir-opt/inline/inline_generator.rs +++ b/tests/mir-opt/inline/inline_generator.rs diff --git a/src/test/mir-opt/inline/inline_instruction_set.default.Inline.diff b/tests/mir-opt/inline/inline_instruction_set.default.Inline.diff index f1988ea4b..f1988ea4b 100644 --- a/src/test/mir-opt/inline/inline_instruction_set.default.Inline.diff +++ b/tests/mir-opt/inline/inline_instruction_set.default.Inline.diff diff --git a/src/test/mir-opt/inline/inline_instruction_set.rs b/tests/mir-opt/inline/inline_instruction_set.rs index 5dfb04943..5dfb04943 100644 --- a/src/test/mir-opt/inline/inline_instruction_set.rs +++ b/tests/mir-opt/inline/inline_instruction_set.rs diff --git a/src/test/mir-opt/inline/inline_instruction_set.t32.Inline.diff b/tests/mir-opt/inline/inline_instruction_set.t32.Inline.diff index e777b2cc2..e777b2cc2 100644 --- a/src/test/mir-opt/inline/inline_instruction_set.t32.Inline.diff +++ b/tests/mir-opt/inline/inline_instruction_set.t32.Inline.diff diff --git a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.diff b/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff index 2a4dc9e3e..a28da146e 100644 --- a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.diff +++ b/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff @@ -11,13 +11,14 @@ let mut _6: (); // in scope 0 at $DIR/inline_into_box_place.rs:+1:42: +1:43 let mut _7: *const std::vec::Vec<u32>; // in scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43 + let mut _8: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 ++ let mut _9: std::vec::Vec<u32>; // in scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 scope 1 { debug _x => _1; // in scope 1 at $DIR/inline_into_box_place.rs:+1:9: +1:11 } scope 2 { } + scope 3 (inlined Vec::<u32>::new) { // at $DIR/inline_into_box_place.rs:8:33: 8:43 -+ let mut _9: alloc::raw_vec::RawVec<u32>; // in scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL ++ let mut _10: alloc::raw_vec::RawVec<u32>; // in scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + } bb0: { @@ -37,8 +38,9 @@ - (*_7) = Vec::<u32>::new() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 + StorageLive(_8); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 + _8 = &mut (*_7); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 -+ StorageLive(_9); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL -+ _9 = const _; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL ++ StorageLive(_9); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 ++ StorageLive(_10); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL ++ _10 = const _; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL // mir::Constant - // + span: $DIR/inline_into_box_place.rs:8:33: 8:41 - // + user_ty: UserType(1) @@ -49,10 +51,12 @@ + // + span: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + // + user_ty: UserType(0) + // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Unevaluated(alloc::raw_vec::RawVec::<T>::NEW, [u32], None) } -+ Deinit((*_8)); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL -+ ((*_8).0: alloc::raw_vec::RawVec<u32>) = move _9; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL -+ ((*_8).1: usize) = const 0_usize; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL -+ StorageDead(_9); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL ++ Deinit(_9); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL ++ (_9.0: alloc::raw_vec::RawVec<u32>) = move _10; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL ++ (_9.1: usize) = const 0_usize; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL ++ StorageDead(_10); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL ++ (*_8) = move _9; // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 ++ StorageDead(_9); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 + StorageDead(_8); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 _1 = move _5; // scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43 StorageDead(_5); // scope 0 at $DIR/inline_into_box_place.rs:+1:42: +1:43 diff --git a/src/test/mir-opt/inline/inline_into_box_place.rs b/tests/mir-opt/inline/inline_into_box_place.rs index 232bcc7b2..232bcc7b2 100644 --- a/src/test/mir-opt/inline/inline_into_box_place.rs +++ b/tests/mir-opt/inline/inline_into_box_place.rs diff --git a/src/test/mir-opt/inline/inline_options.main.Inline.after.mir b/tests/mir-opt/inline/inline_options.main.Inline.after.mir index 1c590be94..1c590be94 100644 --- a/src/test/mir-opt/inline/inline_options.main.Inline.after.mir +++ b/tests/mir-opt/inline/inline_options.main.Inline.after.mir diff --git a/src/test/mir-opt/inline/inline_options.rs b/tests/mir-opt/inline/inline_options.rs index 477f050b6..477f050b6 100644 --- a/src/test/mir-opt/inline/inline_options.rs +++ b/tests/mir-opt/inline/inline_options.rs diff --git a/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir b/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir index 60149ff36..60149ff36 100644 --- a/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir +++ b/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir diff --git a/src/test/mir-opt/inline/inline_retag.rs b/tests/mir-opt/inline/inline_retag.rs index c6950f269..c6950f269 100644 --- a/src/test/mir-opt/inline/inline_retag.rs +++ b/tests/mir-opt/inline/inline_retag.rs diff --git a/src/test/mir-opt/inline/inline_shims.clone.Inline.diff b/tests/mir-opt/inline/inline_shims.clone.Inline.diff index 969573ba3..09dd35c4c 100644 --- a/src/test/mir-opt/inline/inline_shims.clone.Inline.diff +++ b/tests/mir-opt/inline/inline_shims.clone.Inline.diff @@ -5,7 +5,7 @@ debug f => _1; // in scope 0 at $DIR/inline_shims.rs:+0:20: +0:21 let mut _0: fn(A, B); // return place in scope 0 at $DIR/inline_shims.rs:+0:36: +0:44 let mut _2: &fn(A, B); // in scope 0 at $DIR/inline_shims.rs:+1:5: +1:14 -+ scope 1 (inlined <fn(A, B) as Clone>::clone - shim(fn(A, B))) { // at $DIR/inline_shims.rs:6:5: 6:14 ++ scope 1 (inlined <fn(A, B) as Clone>::clone - shim(fn(A, B))) { // at $DIR/inline_shims.rs:6:7: 6:14 + } bb0: { diff --git a/src/test/mir-opt/inline/inline_shims.drop.Inline.diff b/tests/mir-opt/inline/inline_shims.drop.Inline.diff index 7a54beca2..36ddb189e 100644 --- a/src/test/mir-opt/inline/inline_shims.drop.Inline.diff +++ b/tests/mir-opt/inline/inline_shims.drop.Inline.diff @@ -39,7 +39,7 @@ + StorageLive(_6); // scope 2 at $DIR/inline_shims.rs:+2:14: +2:40 + StorageLive(_7); // scope 2 at $DIR/inline_shims.rs:+2:14: +2:40 + _6 = discriminant((*_5)); // scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL -+ switchInt(move _6) -> [0_isize: bb2, otherwise: bb3]; // scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL ++ switchInt(move _6) -> [0: bb2, otherwise: bb3]; // scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL } bb2: { diff --git a/src/test/mir-opt/inline/inline_shims.rs b/tests/mir-opt/inline/inline_shims.rs index 7c8618f71..7c8618f71 100644 --- a/src/test/mir-opt/inline/inline_shims.rs +++ b/tests/mir-opt/inline/inline_shims.rs diff --git a/src/test/mir-opt/inline/inline_specialization.main.Inline.diff b/tests/mir-opt/inline/inline_specialization.main.Inline.diff index af08296ed..af08296ed 100644 --- a/src/test/mir-opt/inline/inline_specialization.main.Inline.diff +++ b/tests/mir-opt/inline/inline_specialization.main.Inline.diff diff --git a/src/test/mir-opt/inline/inline_specialization.rs b/tests/mir-opt/inline/inline_specialization.rs index 87275b4e5..87275b4e5 100644 --- a/src/test/mir-opt/inline/inline_specialization.rs +++ b/tests/mir-opt/inline/inline_specialization.rs diff --git a/src/test/mir-opt/inline/inline_trait_method.rs b/tests/mir-opt/inline/inline_trait_method.rs index 74be53f55..74be53f55 100644 --- a/src/test/mir-opt/inline/inline_trait_method.rs +++ b/tests/mir-opt/inline/inline_trait_method.rs diff --git a/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.mir index 637bf282a..637bf282a 100644 --- a/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir +++ b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.mir diff --git a/src/test/mir-opt/inline/inline_trait_method_2.rs b/tests/mir-opt/inline/inline_trait_method_2.rs index 378e71a25..378e71a25 100644 --- a/src/test/mir-opt/inline/inline_trait_method_2.rs +++ b/tests/mir-opt/inline/inline_trait_method_2.rs diff --git a/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir index 73aea719e..73aea719e 100644 --- a/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir +++ b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir diff --git a/tests/mir-opt/inline/issue_106141.outer.Inline.diff b/tests/mir-opt/inline/issue_106141.outer.Inline.diff new file mode 100644 index 000000000..97361fa5f --- /dev/null +++ b/tests/mir-opt/inline/issue_106141.outer.Inline.diff @@ -0,0 +1,55 @@ +- // MIR for `outer` before Inline ++ // MIR for `outer` after Inline + + fn outer() -> usize { + let mut _0: usize; // return place in scope 0 at $DIR/issue_106141.rs:+0:19: +0:24 ++ scope 1 (inlined inner) { // at $DIR/issue_106141.rs:2:5: 2:12 ++ let mut _1: bool; // in scope 1 at $DIR/issue_106141.rs:13:8: 13:21 ++ let mut _2: bool; // in scope 1 at $DIR/issue_106141.rs:13:8: 13:21 ++ let mut _3: &[bool; 1]; // in scope 1 at $DIR/issue_106141.rs:11:18: 11:25 ++ scope 2 { ++ debug buffer => _3; // in scope 2 at $DIR/issue_106141.rs:11:9: 11:15 ++ scope 3 { ++ debug index => _0; // in scope 3 at $DIR/issue_106141.rs:12:9: 12:14 ++ } ++ } ++ } + + bb0: { +- _0 = inner() -> bb1; // scope 0 at $DIR/issue_106141.rs:+1:5: +1:12 ++ StorageLive(_3); // scope 0 at $DIR/issue_106141.rs:+1:5: +1:12 ++ _3 = const _; // scope 1 at $DIR/issue_106141.rs:11:18: 11:25 + // mir::Constant +- // + span: $DIR/issue_106141.rs:2:5: 2:10 +- // + literal: Const { ty: fn() -> usize {inner}, val: Value(<ZST>) } ++ // + span: $DIR/issue_106141.rs:11:18: 11:25 ++ // + literal: Const { ty: &[bool; 1], val: Unevaluated(inner, [], Some(promoted[0])) } ++ _0 = index() -> bb1; // scope 2 at $DIR/issue_106141.rs:12:17: 12:24 ++ // mir::Constant ++ // + span: $DIR/issue_106141.rs:12:17: 12:22 ++ // + literal: Const { ty: fn() -> usize {index}, val: Value(<ZST>) } + } + + bb1: { ++ StorageLive(_1); // scope 3 at $DIR/issue_106141.rs:13:8: 13:21 ++ _2 = Lt(_0, const 1_usize); // scope 3 at $DIR/issue_106141.rs:13:8: 13:21 ++ assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, _0) -> bb2; // scope 3 at $DIR/issue_106141.rs:13:8: 13:21 ++ } ++ ++ bb2: { ++ _1 = (*_3)[_0]; // scope 3 at $DIR/issue_106141.rs:13:8: 13:21 ++ switchInt(move _1) -> [0: bb3, otherwise: bb4]; // scope 3 at $DIR/issue_106141.rs:13:8: 13:21 ++ } ++ ++ bb3: { ++ _0 = const 0_usize; // scope 3 at $DIR/issue_106141.rs:16:9: 16:10 ++ goto -> bb4; // scope 3 at $DIR/issue_106141.rs:13:5: 17:6 ++ } ++ ++ bb4: { ++ StorageDead(_1); // scope 3 at $DIR/issue_106141.rs:17:5: 17:6 ++ StorageDead(_3); // scope 0 at $DIR/issue_106141.rs:+1:5: +1:12 + return; // scope 0 at $DIR/issue_106141.rs:+2:2: +2:2 + } + } + diff --git a/tests/mir-opt/inline/issue_106141.rs b/tests/mir-opt/inline/issue_106141.rs new file mode 100644 index 000000000..c8288b7f3 --- /dev/null +++ b/tests/mir-opt/inline/issue_106141.rs @@ -0,0 +1,24 @@ +pub fn outer() -> usize { + inner() +} + +fn index() -> usize { + loop {} +} + +#[inline] +fn inner() -> usize { + let buffer = &[true]; + let index = index(); + if buffer[index] { + index + } else { + 0 + } +} + +fn main() { + outer(); +} + +// EMIT_MIR issue_106141.outer.Inline.diff diff --git a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir index 777681e1c..dc0c32350 100644 --- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir @@ -6,7 +6,7 @@ fn a(_1: &mut [T]) -> &mut [T] { let mut _2: &mut [T]; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15 let mut _3: &mut [T]; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15 let mut _4: &mut [T]; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15 - scope 1 (inlined <[T] as AsMut<[T]>>::as_mut) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:3:5: 3:15 + scope 1 (inlined <[T] as AsMut<[T]>>::as_mut) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:3:7: 3:15 debug self => _4; // in scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL let mut _5: &mut [T]; // in scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL } diff --git a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir index 83545c991..b6aff3014 100644 --- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir @@ -6,7 +6,7 @@ fn b(_1: &mut Box<T>) -> &mut T { let mut _2: &mut T; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15 let mut _3: &mut T; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15 let mut _4: &mut std::boxed::Box<T>; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15 - scope 1 (inlined <Box<T> as AsMut<T>>::as_mut) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:8:5: 8:15 + scope 1 (inlined <Box<T> as AsMut<T>>::as_mut) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:8:7: 8:15 debug self => _4; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL let mut _5: &mut T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL let mut _6: &mut T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL diff --git a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir index ed4e9927c..af830d249 100644 --- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir @@ -5,7 +5,7 @@ fn c(_1: &[T]) -> &[T] { let mut _0: &[T]; // return place in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+0:25: +0:29 let _2: &[T]; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15 let mut _3: &[T]; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15 - scope 1 (inlined <[T] as AsRef<[T]>>::as_ref) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:13:5: 13:15 + scope 1 (inlined <[T] as AsRef<[T]>>::as_ref) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:13:7: 13:15 debug self => _3; // in scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL } diff --git a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir index 18a2670be..4f9342247 100644 --- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir @@ -5,7 +5,7 @@ fn d(_1: &Box<T>) -> &T { let mut _0: &T; // return place in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+0:28: +0:30 let _2: &T; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15 let mut _3: &std::boxed::Box<T>; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15 - scope 1 (inlined <Box<T> as AsRef<T>>::as_ref) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:18:5: 18:15 + scope 1 (inlined <Box<T> as AsRef<T>>::as_ref) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:18:7: 18:15 debug self => _3; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL let mut _4: std::boxed::Box<T>; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL let mut _5: *const T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL diff --git a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs index 94f926d39..94f926d39 100644 --- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs diff --git a/src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir b/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir index d99ae1a6c..d99ae1a6c 100644 --- a/src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir +++ b/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir diff --git a/src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.rs b/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.rs index 76d806acc..76d806acc 100644 --- a/src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.rs +++ b/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.rs diff --git a/src/test/mir-opt/inline/issue_78442.bar.Inline.diff b/tests/mir-opt/inline/issue_78442.bar.Inline.diff index 51a98465f..51a98465f 100644 --- a/src/test/mir-opt/inline/issue_78442.bar.Inline.diff +++ b/tests/mir-opt/inline/issue_78442.bar.Inline.diff diff --git a/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff b/tests/mir-opt/inline/issue_78442.bar.RevealAll.diff index e47466c5e..e47466c5e 100644 --- a/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff +++ b/tests/mir-opt/inline/issue_78442.bar.RevealAll.diff diff --git a/src/test/mir-opt/inline/issue_78442.rs b/tests/mir-opt/inline/issue_78442.rs index aa8ede2df..aa8ede2df 100644 --- a/src/test/mir-opt/inline/issue_78442.rs +++ b/tests/mir-opt/inline/issue_78442.rs diff --git a/src/test/mir-opt/inline/polymorphic_recursion.rs b/tests/mir-opt/inline/polymorphic_recursion.rs index 7388722b7..7388722b7 100644 --- a/src/test/mir-opt/inline/polymorphic_recursion.rs +++ b/tests/mir-opt/inline/polymorphic_recursion.rs diff --git a/src/test/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff b/tests/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff index a3cee3ecf..a3cee3ecf 100644 --- a/src/test/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff +++ b/tests/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff diff --git a/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff b/tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff index 81d552823..2f6f5f87e 100644 --- a/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff +++ b/tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff @@ -26,7 +26,7 @@ } bb3: { - switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17 + switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17 } bb4: { diff --git a/src/test/mir-opt/instrument_coverage.rs b/tests/mir-opt/instrument_coverage.rs index 7f6a0a0eb..7f6a0a0eb 100644 --- a/src/test/mir-opt/instrument_coverage.rs +++ b/tests/mir-opt/instrument_coverage.rs diff --git a/src/test/mir-opt/issue_101973.inner.ConstProp.diff b/tests/mir-opt/issue_101973.inner.ConstProp.diff index 8fe60a024..b2706e5a4 100644 --- a/src/test/mir-opt/issue_101973.inner.ConstProp.diff +++ b/tests/mir-opt/issue_101973.inner.ConstProp.diff @@ -23,7 +23,7 @@ debug out => _4; // in scope 2 at $DIR/issue_101973.rs:6:9: 6:16 } } - scope 3 (inlined core::num::<impl u32>::rotate_right) { // at $DIR/issue_101973.rs:14:5: 14:58 + scope 3 (inlined core::num::<impl u32>::rotate_right) { // at $DIR/issue_101973.rs:14:18: 14:58 debug self => _4; // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL debug n => _6; // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL let mut _15: u32; // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL diff --git a/src/test/mir-opt/issue_101973.rs b/tests/mir-opt/issue_101973.rs index 216659a23..216659a23 100644 --- a/src/test/mir-opt/issue_101973.rs +++ b/tests/mir-opt/issue_101973.rs diff --git a/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir b/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir index 822100818..b0d5b291b 100644 --- a/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir @@ -26,7 +26,7 @@ fn main() -> () { StorageLive(_3); // scope 1 at $DIR/issue_38669.rs:+3:9: +5:10 StorageLive(_4); // scope 1 at $DIR/issue_38669.rs:+3:12: +3:24 _4 = _1; // scope 1 at $DIR/issue_38669.rs:+3:12: +3:24 - switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/issue_38669.rs:+3:12: +3:24 + switchInt(move _4) -> [0: bb4, otherwise: bb3]; // scope 1 at $DIR/issue_38669.rs:+3:12: +3:24 } bb3: { diff --git a/src/test/mir-opt/issue_38669.rs b/tests/mir-opt/issue_38669.rs index db3f89472..db3f89472 100644 --- a/src/test/mir-opt/issue_38669.rs +++ b/tests/mir-opt/issue_38669.rs diff --git a/src/test/mir-opt/issue_41110.main.ElaborateDrops.after.mir b/tests/mir-opt/issue_41110.main.ElaborateDrops.after.mir index c573ad5a8..c2ea3ac50 100644 --- a/src/test/mir-opt/issue_41110.main.ElaborateDrops.after.mir +++ b/tests/mir-opt/issue_41110.main.ElaborateDrops.after.mir @@ -65,6 +65,6 @@ fn main() -> () { } bb8 (cleanup): { - switchInt(_5) -> [false: bb6, otherwise: bb7]; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28 + switchInt(_5) -> [0: bb6, otherwise: bb7]; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28 } } diff --git a/src/test/mir-opt/issue_41110.rs b/tests/mir-opt/issue_41110.rs index 638dc601e..638dc601e 100644 --- a/src/test/mir-opt/issue_41110.rs +++ b/tests/mir-opt/issue_41110.rs diff --git a/src/test/mir-opt/issue_41110.test.ElaborateDrops.after.mir b/tests/mir-opt/issue_41110.test.ElaborateDrops.after.mir index 470b03232..82989c3f0 100644 --- a/src/test/mir-opt/issue_41110.test.ElaborateDrops.after.mir +++ b/tests/mir-opt/issue_41110.test.ElaborateDrops.after.mir @@ -96,6 +96,6 @@ fn test() -> () { } bb14 (cleanup): { - switchInt(_6) -> [false: bb10, otherwise: bb13]; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2 + switchInt(_6) -> [0: bb10, otherwise: bb13]; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2 } } diff --git a/src/test/mir-opt/issue_41697.rs b/tests/mir-opt/issue_41697.rs index cbd8633a3..cbd8633a3 100644 --- a/src/test/mir-opt/issue_41697.rs +++ b/tests/mir-opt/issue_41697.rs diff --git a/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir b/tests/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir index 8af087d84..8af087d84 100644 --- a/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir +++ b/tests/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir diff --git a/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir b/tests/mir-opt/issue_41888.main.ElaborateDrops.after.mir index 73372c97b..005042732 100644 --- a/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir +++ b/tests/mir-opt/issue_41888.main.ElaborateDrops.after.mir @@ -33,7 +33,7 @@ fn main() -> () { } bb1: { - switchInt(move _2) -> [false: bb7, otherwise: bb2]; // scope 1 at $DIR/issue_41888.rs:+2:8: +2:14 + switchInt(move _2) -> [0: bb7, otherwise: bb2]; // scope 1 at $DIR/issue_41888.rs:+2:8: +2:14 } bb2: { @@ -52,7 +52,7 @@ fn main() -> () { bb4: { StorageDead(_3); // scope 1 at $DIR/issue_41888.rs:+3:19: +3:20 _5 = discriminant(_1); // scope 2 at $DIR/issue_41888.rs:+4:16: +4:24 - switchInt(move _5) -> [0_isize: bb5, otherwise: bb6]; // scope 2 at $DIR/issue_41888.rs:+4:16: +4:24 + switchInt(move _5) -> [0: bb5, otherwise: bb6]; // scope 2 at $DIR/issue_41888.rs:+4:16: +4:24 } bb5: { @@ -134,19 +134,19 @@ fn main() -> () { bb19: { _10 = discriminant(_1); // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2 - switchInt(move _10) -> [0_isize: bb15, otherwise: bb17]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2 + switchInt(move _10) -> [0: bb15, otherwise: bb17]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2 } bb20: { - switchInt(_7) -> [false: bb15, otherwise: bb19]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2 + switchInt(_7) -> [0: bb15, otherwise: bb19]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2 } bb21 (cleanup): { _11 = discriminant(_1); // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2 - switchInt(move _11) -> [0_isize: bb16, otherwise: bb18]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2 + switchInt(move _11) -> [0: bb16, otherwise: bb18]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2 } bb22 (cleanup): { - switchInt(_7) -> [false: bb12, otherwise: bb21]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2 + switchInt(_7) -> [0: bb12, otherwise: bb21]; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2 } } diff --git a/src/test/mir-opt/issue_41888.rs b/tests/mir-opt/issue_41888.rs index c1046c14d..c1046c14d 100644 --- a/src/test/mir-opt/issue_41888.rs +++ b/tests/mir-opt/issue_41888.rs diff --git a/src/test/mir-opt/issue_62289.rs b/tests/mir-opt/issue_62289.rs index 37e3390d5..37e3390d5 100644 --- a/src/test/mir-opt/issue_62289.rs +++ b/tests/mir-opt/issue_62289.rs diff --git a/src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.mir index 6969a66ac..adfa3a773 100644 --- a/src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir +++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.mir @@ -52,7 +52,7 @@ fn test() -> Option<Box<u32>> { bb2: { StorageDead(_7); // scope 0 at $DIR/issue_62289.rs:+1:19: +1:20 _8 = discriminant(_6); // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20 - switchInt(move _8) -> [0_isize: bb3, 1_isize: bb5, otherwise: bb4]; // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20 + switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb4]; // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20 } bb3: { diff --git a/src/test/mir-opt/issue_72181.bar.built.after.mir b/tests/mir-opt/issue_72181.bar.built.after.mir index ebee89001..ebee89001 100644 --- a/src/test/mir-opt/issue_72181.bar.built.after.mir +++ b/tests/mir-opt/issue_72181.bar.built.after.mir diff --git a/src/test/mir-opt/issue_72181.foo.built.after.mir b/tests/mir-opt/issue_72181.foo.built.after.mir index 90c978520..90c978520 100644 --- a/src/test/mir-opt/issue_72181.foo.built.after.mir +++ b/tests/mir-opt/issue_72181.foo.built.after.mir diff --git a/src/test/mir-opt/issue_72181.main.built.after.mir b/tests/mir-opt/issue_72181.main.built.after.mir index e86836927..e86836927 100644 --- a/src/test/mir-opt/issue_72181.main.built.after.mir +++ b/tests/mir-opt/issue_72181.main.built.after.mir diff --git a/src/test/mir-opt/issue_72181.rs b/tests/mir-opt/issue_72181.rs index 6a32d4bbe..6a32d4bbe 100644 --- a/src/test/mir-opt/issue_72181.rs +++ b/tests/mir-opt/issue_72181.rs diff --git a/src/test/mir-opt/issue_72181_1.f.built.after.mir b/tests/mir-opt/issue_72181_1.f.built.after.mir index 4086da520..4086da520 100644 --- a/src/test/mir-opt/issue_72181_1.f.built.after.mir +++ b/tests/mir-opt/issue_72181_1.f.built.after.mir diff --git a/src/test/mir-opt/issue_72181_1.main.built.after.mir b/tests/mir-opt/issue_72181_1.main.built.after.mir index 2172f3aa9..2172f3aa9 100644 --- a/src/test/mir-opt/issue_72181_1.main.built.after.mir +++ b/tests/mir-opt/issue_72181_1.main.built.after.mir diff --git a/src/test/mir-opt/issue_72181_1.rs b/tests/mir-opt/issue_72181_1.rs index 8ae2599ec..8ae2599ec 100644 --- a/src/test/mir-opt/issue_72181_1.rs +++ b/tests/mir-opt/issue_72181_1.rs diff --git a/tests/mir-opt/issue_73223.main.SimplifyArmIdentity.diff b/tests/mir-opt/issue_73223.main.SimplifyArmIdentity.diff new file mode 100644 index 000000000..bf3bcfdb5 --- /dev/null +++ b/tests/mir-opt/issue_73223.main.SimplifyArmIdentity.diff @@ -0,0 +1,156 @@ +- // MIR for `main` before SimplifyArmIdentity ++ // MIR for `main` after SimplifyArmIdentity + + fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/issue_73223.rs:+0:11: +0:11 + let _1: i32; // in scope 0 at $DIR/issue_73223.rs:+1:9: +1:14 + let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/issue_73223.rs:+1:23: +1:30 + let mut _3: isize; // in scope 0 at $DIR/issue_73223.rs:+2:9: +2:16 + let _4: i32; // in scope 0 at $DIR/issue_73223.rs:+2:14: +2:15 + let mut _6: i32; // in scope 0 at $DIR/issue_73223.rs:+6:22: +6:27 + let mut _7: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _8: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _11: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _12: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _13: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _14: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _16: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _17: core::panicking::AssertKind; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _18: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _19: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _20: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _21: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _22: std::option::Option<std::fmt::Arguments<'_>>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _24: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _25: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 1 { + debug split => _1; // in scope 1 at $DIR/issue_73223.rs:+1:9: +1:14 + let _5: std::option::Option<i32>; // in scope 1 at $DIR/issue_73223.rs:+6:9: +6:14 + scope 3 { + debug _prev => _5; // in scope 3 at $DIR/issue_73223.rs:+6:9: +6:14 + let _9: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _10: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _23: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 4 { + debug left_val => _9; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + debug right_val => _10; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _15: core::panicking::AssertKind; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 5 { + debug kind => _15; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + } + } + } + scope 2 { + debug v => _4; // in scope 2 at $DIR/issue_73223.rs:+2:14: +2:15 + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/issue_73223.rs:+1:9: +1:14 + StorageLive(_2); // scope 0 at $DIR/issue_73223.rs:+1:23: +1:30 + Deinit(_2); // scope 0 at $DIR/issue_73223.rs:+1:23: +1:30 + ((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue_73223.rs:+1:23: +1:30 + discriminant(_2) = 1; // scope 0 at $DIR/issue_73223.rs:+1:23: +1:30 + _3 = const 1_isize; // scope 0 at $DIR/issue_73223.rs:+1:23: +1:30 + goto -> bb3; // scope 0 at $DIR/issue_73223.rs:+1:17: +1:30 + } + + bb1: { + StorageDead(_2); // scope 0 at $DIR/issue_73223.rs:+4:6: +4:7 + StorageDead(_1); // scope 0 at $DIR/issue_73223.rs:+8:1: +8:2 + return; // scope 0 at $DIR/issue_73223.rs:+8:2: +8:2 + } + + bb2: { + unreachable; // scope 0 at $DIR/issue_73223.rs:+1:23: +1:30 + } + + bb3: { + StorageLive(_4); // scope 0 at $DIR/issue_73223.rs:+2:14: +2:15 + _4 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue_73223.rs:+2:14: +2:15 + _1 = _4; // scope 2 at $DIR/issue_73223.rs:+2:20: +2:21 + StorageDead(_4); // scope 0 at $DIR/issue_73223.rs:+2:20: +2:21 + StorageDead(_2); // scope 0 at $DIR/issue_73223.rs:+4:6: +4:7 + StorageLive(_5); // scope 1 at $DIR/issue_73223.rs:+6:9: +6:14 + StorageLive(_6); // scope 1 at $DIR/issue_73223.rs:+6:22: +6:27 + _6 = _1; // scope 1 at $DIR/issue_73223.rs:+6:22: +6:27 + Deinit(_5); // scope 1 at $DIR/issue_73223.rs:+6:17: +6:28 + ((_5 as Some).0: i32) = move _6; // scope 1 at $DIR/issue_73223.rs:+6:17: +6:28 + discriminant(_5) = 1; // scope 1 at $DIR/issue_73223.rs:+6:17: +6:28 + StorageDead(_6); // scope 1 at $DIR/issue_73223.rs:+6:27: +6:28 + StorageLive(_24); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_25); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _7 = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _23 = const _; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + // mir::Constant + // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) } + _8 = _23; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Deinit(_24); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Deinit(_25); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _24 = move _7; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _25 = move _8; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _9 = _24; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_10); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _10 = _25; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _13 = (*_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_14); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _14 = const 1_i32; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _12 = Eq(move _13, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_14); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _11 = Not(move _12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _11) -> [0: bb5, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + + bb4: { + StorageLive(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Deinit(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + discriminant(_15) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_17); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _17 = const core::panicking::AssertKind::Eq; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + // mir::Constant + // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) } + StorageLive(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _19 = _9; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _18 = _19; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_20); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _21 = _10; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _20 = _21; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_22); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Deinit(_22); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + discriminant(_22) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _16 = core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _18, move _20, move _22); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + // mir::Constant + // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a i32, &'b i32, Option<Arguments<'c>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(<ZST>) } + // mir::Constant + // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) } + } + + bb5: { + StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_10); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_24); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_25); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_5); // scope 1 at $DIR/issue_73223.rs:+8:1: +8:2 + StorageDead(_1); // scope 0 at $DIR/issue_73223.rs:+8:1: +8:2 + return; // scope 0 at $DIR/issue_73223.rs:+8:2: +8:2 + } + } + diff --git a/src/test/mir-opt/issue_73223.rs b/tests/mir-opt/issue_73223.rs index be114cab7..be114cab7 100644 --- a/src/test/mir-opt/issue_73223.rs +++ b/tests/mir-opt/issue_73223.rs diff --git a/src/test/mir-opt/issue_76432.rs b/tests/mir-opt/issue_76432.rs index c8b405ca8..c8b405ca8 100644 --- a/src/test/mir-opt/issue_76432.rs +++ b/tests/mir-opt/issue_76432.rs diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff new file mode 100644 index 000000000..c24543dae --- /dev/null +++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff @@ -0,0 +1,84 @@ +- // MIR for `test` before SimplifyComparisonIntegral ++ // MIR for `test` after SimplifyComparisonIntegral + + fn test(_1: T) -> () { + debug x => _1; // in scope 0 at $DIR/issue_76432.rs:+0:38: +0:39 + let mut _0: (); // return place in scope 0 at $DIR/issue_76432.rs:+0:44: +0:44 + let _2: &[T]; // in scope 0 at $DIR/issue_76432.rs:+1:9: +1:10 + let mut _3: &[T; 3]; // in scope 0 at $DIR/issue_76432.rs:+1:19: +1:29 + let _4: &[T; 3]; // in scope 0 at $DIR/issue_76432.rs:+1:19: +1:29 + let _5: [T; 3]; // in scope 0 at $DIR/issue_76432.rs:+1:20: +1:29 + let mut _6: T; // in scope 0 at $DIR/issue_76432.rs:+1:21: +1:22 + let mut _7: T; // in scope 0 at $DIR/issue_76432.rs:+1:24: +1:25 + let mut _8: T; // in scope 0 at $DIR/issue_76432.rs:+1:27: +1:28 + let mut _9: usize; // in scope 0 at $DIR/issue_76432.rs:+3:9: +3:33 + let mut _10: usize; // in scope 0 at $DIR/issue_76432.rs:+3:9: +3:33 + let mut _11: bool; // in scope 0 at $DIR/issue_76432.rs:+3:9: +3:33 + let mut _15: !; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + scope 1 { + debug v => _2; // in scope 1 at $DIR/issue_76432.rs:+1:9: +1:10 + let _12: &T; // in scope 1 at $DIR/issue_76432.rs:+3:10: +3:16 + let _13: &T; // in scope 1 at $DIR/issue_76432.rs:+3:18: +3:24 + let _14: &T; // in scope 1 at $DIR/issue_76432.rs:+3:26: +3:32 + scope 2 { + debug v1 => _12; // in scope 2 at $DIR/issue_76432.rs:+3:10: +3:16 + debug v2 => _13; // in scope 2 at $DIR/issue_76432.rs:+3:18: +3:24 + debug v3 => _14; // in scope 2 at $DIR/issue_76432.rs:+3:26: +3:32 + } + } + + bb0: { + StorageLive(_2); // scope 0 at $DIR/issue_76432.rs:+1:9: +1:10 + StorageLive(_3); // scope 0 at $DIR/issue_76432.rs:+1:19: +1:29 + StorageLive(_4); // scope 0 at $DIR/issue_76432.rs:+1:19: +1:29 + StorageLive(_5); // scope 0 at $DIR/issue_76432.rs:+1:20: +1:29 + StorageLive(_6); // scope 0 at $DIR/issue_76432.rs:+1:21: +1:22 + _6 = _1; // scope 0 at $DIR/issue_76432.rs:+1:21: +1:22 + StorageLive(_7); // scope 0 at $DIR/issue_76432.rs:+1:24: +1:25 + _7 = _1; // scope 0 at $DIR/issue_76432.rs:+1:24: +1:25 + StorageLive(_8); // scope 0 at $DIR/issue_76432.rs:+1:27: +1:28 + _8 = _1; // scope 0 at $DIR/issue_76432.rs:+1:27: +1:28 + _5 = [move _6, move _7, move _8]; // scope 0 at $DIR/issue_76432.rs:+1:20: +1:29 + StorageDead(_8); // scope 0 at $DIR/issue_76432.rs:+1:28: +1:29 + StorageDead(_7); // scope 0 at $DIR/issue_76432.rs:+1:28: +1:29 + StorageDead(_6); // scope 0 at $DIR/issue_76432.rs:+1:28: +1:29 + _4 = &_5; // scope 0 at $DIR/issue_76432.rs:+1:19: +1:29 + _3 = _4; // scope 0 at $DIR/issue_76432.rs:+1:19: +1:29 + _2 = move _3 as &[T] (Pointer(Unsize)); // scope 0 at $DIR/issue_76432.rs:+1:19: +1:29 + StorageDead(_3); // scope 0 at $DIR/issue_76432.rs:+1:28: +1:29 + StorageDead(_4); // scope 0 at $DIR/issue_76432.rs:+1:29: +1:30 + _9 = Len((*_2)); // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33 + _10 = const 3_usize; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33 +- _11 = Eq(move _9, const 3_usize); // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33 +- switchInt(move _11) -> [0: bb1, otherwise: bb2]; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33 ++ nop; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33 ++ switchInt(move _9) -> [3: bb2, otherwise: bb1]; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33 + } + + bb1: { + StorageLive(_15); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL + _15 = core::panicking::panic(const "internal error: entered unreachable code"); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL + // mir::Constant + // + span: $SRC_DIR/core/src/panic.rs:LL:COL + // + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(<ZST>) } + // mir::Constant + // + span: $SRC_DIR/core/src/panic.rs:LL:COL + // + literal: Const { ty: &str, val: Value(Slice(..)) } + } + + bb2: { + StorageLive(_12); // scope 1 at $DIR/issue_76432.rs:+3:10: +3:16 + _12 = &(*_2)[0 of 3]; // scope 1 at $DIR/issue_76432.rs:+3:10: +3:16 + StorageLive(_13); // scope 1 at $DIR/issue_76432.rs:+3:18: +3:24 + _13 = &(*_2)[1 of 3]; // scope 1 at $DIR/issue_76432.rs:+3:18: +3:24 + StorageLive(_14); // scope 1 at $DIR/issue_76432.rs:+3:26: +3:32 + _14 = &(*_2)[2 of 3]; // scope 1 at $DIR/issue_76432.rs:+3:26: +3:32 + StorageDead(_14); // scope 1 at $DIR/issue_76432.rs:+3:84: +3:85 + StorageDead(_13); // scope 1 at $DIR/issue_76432.rs:+3:84: +3:85 + StorageDead(_12); // scope 1 at $DIR/issue_76432.rs:+3:84: +3:85 + StorageDead(_5); // scope 0 at $DIR/issue_76432.rs:+6:1: +6:2 + StorageDead(_2); // scope 0 at $DIR/issue_76432.rs:+6:1: +6:2 + return; // scope 0 at $DIR/issue_76432.rs:+6:2: +6:2 + } + } + diff --git a/src/test/mir-opt/issue_78192.f.InstCombine.diff b/tests/mir-opt/issue_78192.f.InstCombine.diff index 116ca304c..116ca304c 100644 --- a/src/test/mir-opt/issue_78192.f.InstCombine.diff +++ b/tests/mir-opt/issue_78192.f.InstCombine.diff diff --git a/src/test/mir-opt/issue_78192.rs b/tests/mir-opt/issue_78192.rs index 39f665402..39f665402 100644 --- a/src/test/mir-opt/issue_78192.rs +++ b/tests/mir-opt/issue_78192.rs diff --git a/src/test/mir-opt/issue_91633.bar.built.after.mir b/tests/mir-opt/issue_91633.bar.built.after.mir index c3fb90e84..c3fb90e84 100644 --- a/src/test/mir-opt/issue_91633.bar.built.after.mir +++ b/tests/mir-opt/issue_91633.bar.built.after.mir diff --git a/src/test/mir-opt/issue_91633.foo.built.after.mir b/tests/mir-opt/issue_91633.foo.built.after.mir index 4e3dd365e..4e3dd365e 100644 --- a/src/test/mir-opt/issue_91633.foo.built.after.mir +++ b/tests/mir-opt/issue_91633.foo.built.after.mir diff --git a/src/test/mir-opt/issue_91633.fun.built.after.mir b/tests/mir-opt/issue_91633.fun.built.after.mir index 42486d3a5..42486d3a5 100644 --- a/src/test/mir-opt/issue_91633.fun.built.after.mir +++ b/tests/mir-opt/issue_91633.fun.built.after.mir diff --git a/src/test/mir-opt/issue_91633.hey.built.after.mir b/tests/mir-opt/issue_91633.hey.built.after.mir index ccb06dd59..ccb06dd59 100644 --- a/src/test/mir-opt/issue_91633.hey.built.after.mir +++ b/tests/mir-opt/issue_91633.hey.built.after.mir diff --git a/src/test/mir-opt/issue_91633.rs b/tests/mir-opt/issue_91633.rs index 9127cacc9..9127cacc9 100644 --- a/src/test/mir-opt/issue_91633.rs +++ b/tests/mir-opt/issue_91633.rs diff --git a/src/test/mir-opt/issue_99325.main.built.after.mir b/tests/mir-opt/issue_99325.main.built.after.mir index 3db40412b..3e035c18d 100644 --- a/src/test/mir-opt/issue_99325.main.built.after.mir +++ b/tests/mir-opt/issue_99325.main.built.after.mir @@ -109,7 +109,7 @@ fn main() -> () { StorageDead(_12); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _10 = Not(move _11); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_11); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(move _10) -> [false: bb4, otherwise: bb3]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _10) -> [0: bb4, otherwise: bb3]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb3: { @@ -218,7 +218,7 @@ fn main() -> () { StorageDead(_33); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _31 = Not(move _32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(move _31) -> [false: bb13, otherwise: bb12]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _31) -> [0: bb13, otherwise: bb12]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb12: { diff --git a/src/test/mir-opt/issue_99325.rs b/tests/mir-opt/issue_99325.rs index fe819cddb..fe819cddb 100644 --- a/src/test/mir-opt/issue_99325.rs +++ b/tests/mir-opt/issue_99325.rs diff --git a/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir index 5a2f4feff..c17d221f8 100644 --- a/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir +++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir @@ -4,9 +4,9 @@ fn num_to_digit(_1: char) -> u32 { debug num => _1; // in scope 0 at $DIR/issue_59352.rs:+0:21: +0:24 let mut _0: u32; // return place in scope 0 at $DIR/issue_59352.rs:+0:35: +0:38 let mut _2: std::option::Option<u32>; // in scope 0 at $DIR/issue_59352.rs:+2:26: +2:41 - let mut _3: u32; // in scope 0 at $DIR/issue_59352.rs:+2:8: +2:23 + let mut _3: u32; // in scope 0 at $DIR/issue_59352.rs:+2:12: +2:23 let mut _9: isize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - scope 1 (inlined char::methods::<impl char>::is_digit) { // at $DIR/issue_59352.rs:14:8: 14:23 + scope 1 (inlined char::methods::<impl char>::is_digit) { // at $DIR/issue_59352.rs:14:12: 14:23 debug self => _1; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL debug radix => _3; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL let mut _4: &std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL @@ -16,7 +16,7 @@ fn num_to_digit(_1: char) -> u32 { debug self => _4; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL } } - scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { // at $DIR/issue_59352.rs:14:26: 14:50 + scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { // at $DIR/issue_59352.rs:14:42: 14:50 debug self => _2; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL let mut _7: isize; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL let mut _8: !; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL @@ -26,7 +26,7 @@ fn num_to_digit(_1: char) -> u32 { } bb0: { - StorageLive(_3); // scope 0 at $DIR/issue_59352.rs:+2:8: +2:23 + StorageLive(_3); // scope 0 at $DIR/issue_59352.rs:+2:12: +2:23 StorageLive(_4); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL StorageLive(_5); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL StorageLive(_6); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL @@ -47,7 +47,7 @@ fn num_to_digit(_1: char) -> u32 { bb2: { _7 = discriminant(_2); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - switchInt(move _7) -> [0_isize: bb6, 1_isize: bb8, otherwise: bb7]; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + switchInt(move _7) -> [0: bb6, 1: bb8, otherwise: bb7]; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL } bb3: { @@ -65,8 +65,8 @@ fn num_to_digit(_1: char) -> u32 { _9 = discriminant((*_4)); // scope 2 at $SRC_DIR/core/src/option.rs:LL:COL StorageDead(_4); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL StorageDead(_5); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageDead(_3); // scope 0 at $DIR/issue_59352.rs:+2:8: +2:23 - switchInt(move _9) -> [1_isize: bb1, otherwise: bb3]; // scope 0 at $DIR/issue_59352.rs:+2:8: +2:23 + StorageDead(_3); // scope 0 at $DIR/issue_59352.rs:+2:12: +2:23 + switchInt(move _9) -> [1: bb1, otherwise: bb3]; // scope 0 at $DIR/issue_59352.rs:+2:8: +2:23 } bb6: { diff --git a/src/test/mir-opt/issues/issue_59352.rs b/tests/mir-opt/issues/issue_59352.rs index 1e0045555..1e0045555 100644 --- a/src/test/mir-opt/issues/issue_59352.rs +++ b/tests/mir-opt/issues/issue_59352.rs diff --git a/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff b/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff index 87066cc62..938047803 100644 --- a/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff +++ b/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff @@ -26,21 +26,21 @@ _3 = _1; // scope 2 at $DIR/issue_75439.rs:+2:47: +2:52 _2 = transmute::<[u8; 16], [u32; 4]>(move _3) -> bb1; // scope 2 at $DIR/issue_75439.rs:+2:37: +2:53 // mir::Constant - // + span: $DIR/issue_75439.rs:7:37: 7:46 + // + span: $DIR/issue_75439.rs:8:37: 8:46 // + literal: Const { ty: unsafe extern "rust-intrinsic" fn([u8; 16]) -> [u32; 4] {transmute::<[u8; 16], [u32; 4]>}, val: Value(<ZST>) } } bb1: { StorageDead(_3); // scope 2 at $DIR/issue_75439.rs:+2:52: +2:53 - switchInt(_2[0 of 4]) -> [0_u32: bb2, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30 + switchInt(_2[0 of 4]) -> [0: bb2, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30 } bb2: { - switchInt(_2[1 of 4]) -> [0_u32: bb3, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30 + switchInt(_2[1 of 4]) -> [0: bb3, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30 } bb3: { - switchInt(_2[2 of 4]) -> [0_u32: bb5, 4294901760_u32: bb6, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30 + switchInt(_2[2 of 4]) -> [0: bb5, 4294901760: bb6, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30 } bb4: { @@ -49,7 +49,7 @@ _6 = _4; // scope 4 at $DIR/issue_75439.rs:+5:33: +5:35 _5 = transmute::<u32, [u8; 4]>(move _6) -> bb7; // scope 4 at $DIR/issue_75439.rs:+5:23: +5:36 // mir::Constant - // + span: $DIR/issue_75439.rs:10:23: 10:32 + // + span: $DIR/issue_75439.rs:11:23: 11:32 // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u32) -> [u8; 4] {transmute::<u32, [u8; 4]>}, val: Value(<ZST>) } } diff --git a/src/test/mir-opt/issues/issue_75439.rs b/tests/mir-opt/issues/issue_75439.rs index ae2e03631..4c749a150 100644 --- a/src/test/mir-opt/issues/issue_75439.rs +++ b/tests/mir-opt/issues/issue_75439.rs @@ -1,4 +1,5 @@ // EMIT_MIR issue_75439.foo.MatchBranchSimplification.diff +// ignore-endian-big use std::mem::transmute; diff --git a/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir b/tests/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir index 5981ab885..4ee2dae49 100644 --- a/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir +++ b/tests/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir @@ -16,7 +16,7 @@ fn main() -> () { StorageLive(_1); // scope 0 at $DIR/loop_test.rs:+4:5: +6:6 StorageLive(_2); // scope 0 at $DIR/loop_test.rs:+4:8: +4:12 _2 = const true; // scope 0 at $DIR/loop_test.rs:+4:8: +4:12 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/loop_test.rs:+4:8: +4:12 + switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/loop_test.rs:+4:8: +4:12 } bb1: { diff --git a/src/test/mir-opt/loop_test.rs b/tests/mir-opt/loop_test.rs index 7ded5b575..7ded5b575 100644 --- a/src/test/mir-opt/loop_test.rs +++ b/tests/mir-opt/loop_test.rs diff --git a/src/test/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff b/tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff index 049bbeac8..9bc7060e9 100644 --- a/src/test/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff +++ b/tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff @@ -38,7 +38,7 @@ _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27 StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27 StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27 - switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27 + switchInt(move _3) -> [0: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27 } bb2: { diff --git a/src/test/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff b/tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff index 40ec01eeb..cf427cfd1 100644 --- a/src/test/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff +++ b/tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff @@ -41,7 +41,7 @@ _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27 StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27 StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27 - switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27 + switchInt(move _3) -> [0: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27 } bb2: { diff --git a/src/test/mir-opt/lower_array_len.array_len.NormalizeArrayLen.diff b/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.diff index 3ed68f5f7..3ed68f5f7 100644 --- a/src/test/mir-opt/lower_array_len.array_len.NormalizeArrayLen.diff +++ b/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.diff diff --git a/src/test/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.diff b/tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.diff index f0e0cdcfd..f0e0cdcfd 100644 --- a/src/test/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.diff +++ b/tests/mir-opt/lower_array_len.array_len_by_value.NormalizeArrayLen.diff diff --git a/src/test/mir-opt/lower_array_len.rs b/tests/mir-opt/lower_array_len.rs index ea0224b21..ea0224b21 100644 --- a/src/test/mir-opt/lower_array_len.rs +++ b/tests/mir-opt/lower_array_len.rs diff --git a/src/test/mir-opt/lower_array_len_e2e.array_bound.PreCodegen.after.mir b/tests/mir-opt/lower_array_len_e2e.array_bound.PreCodegen.after.mir index 9b1b07f38..701c2ad70 100644 --- a/src/test/mir-opt/lower_array_len_e2e.array_bound.PreCodegen.after.mir +++ b/tests/mir-opt/lower_array_len_e2e.array_bound.PreCodegen.after.mir @@ -19,7 +19,7 @@ fn array_bound(_1: usize, _2: &[u8; N]) -> u8 { _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27 StorageDead(_5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:26: +1:27 StorageDead(_4); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:26: +1:27 - switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27 + switchInt(move _3) -> [0: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27 } bb1: { diff --git a/src/test/mir-opt/lower_array_len_e2e.array_bound_mut.PreCodegen.after.mir b/tests/mir-opt/lower_array_len_e2e.array_bound_mut.PreCodegen.after.mir index 29e379777..0440cfce2 100644 --- a/src/test/mir-opt/lower_array_len_e2e.array_bound_mut.PreCodegen.after.mir +++ b/tests/mir-opt/lower_array_len_e2e.array_bound_mut.PreCodegen.after.mir @@ -22,7 +22,7 @@ fn array_bound_mut(_1: usize, _2: &mut [u8; N]) -> u8 { _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27 StorageDead(_5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:26: +1:27 StorageDead(_4); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:26: +1:27 - switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27 + switchInt(move _3) -> [0: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27 } bb1: { diff --git a/src/test/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir b/tests/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir index 4b19f6795..4b19f6795 100644 --- a/src/test/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir +++ b/tests/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir diff --git a/src/test/mir-opt/lower_array_len_e2e.array_len_by_value.PreCodegen.after.mir b/tests/mir-opt/lower_array_len_e2e.array_len_by_value.PreCodegen.after.mir index 4dc0ba9a2..4dc0ba9a2 100644 --- a/src/test/mir-opt/lower_array_len_e2e.array_len_by_value.PreCodegen.after.mir +++ b/tests/mir-opt/lower_array_len_e2e.array_len_by_value.PreCodegen.after.mir diff --git a/src/test/mir-opt/lower_array_len_e2e.rs b/tests/mir-opt/lower_array_len_e2e.rs index 49b35d509..d8e4e521e 100644 --- a/src/test/mir-opt/lower_array_len_e2e.rs +++ b/tests/mir-opt/lower_array_len_e2e.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z mir-opt-level=4 +// compile-flags: -Z mir-opt-level=4 -Zunsound-mir-opts // EMIT_MIR lower_array_len_e2e.array_bound.PreCodegen.after.mir pub fn array_bound<const N: usize>(index: usize, slice: &[u8; N]) -> u8 { diff --git a/src/test/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff index 3389db733..3389db733 100644 --- a/src/test/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff +++ b/tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff diff --git a/src/test/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff index d9898d8e0..d9898d8e0 100644 --- a/src/test/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff +++ b/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff diff --git a/src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff index d962ef8cb..d962ef8cb 100644 --- a/src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff +++ b/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff diff --git a/src/test/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff index ec15fd1ef..ec15fd1ef 100644 --- a/src/test/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff +++ b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff diff --git a/src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff index 4cbbc02c9..4cbbc02c9 100644 --- a/src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff +++ b/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff diff --git a/src/test/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff index d8cd5f59a..d8cd5f59a 100644 --- a/src/test/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff +++ b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff diff --git a/src/test/mir-opt/lower_intrinsics.rs b/tests/mir-opt/lower_intrinsics.rs index 66dae0e46..66dae0e46 100644 --- a/src/test/mir-opt/lower_intrinsics.rs +++ b/tests/mir-opt/lower_intrinsics.rs diff --git a/src/test/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff index cf0ab73a5..cf0ab73a5 100644 --- a/src/test/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff +++ b/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff diff --git a/src/test/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff index 6f17d4451..6f17d4451 100644 --- a/src/test/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff +++ b/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff diff --git a/src/test/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff index 22ef75fd8..22ef75fd8 100644 --- a/src/test/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff +++ b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff diff --git a/src/test/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir b/tests/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir index f6d8bdd74..f6d8bdd74 100644 --- a/src/test/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir +++ b/tests/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir diff --git a/src/test/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir b/tests/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir index b672e1a6e..b672e1a6e 100644 --- a/src/test/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir +++ b/tests/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir diff --git a/src/test/mir-opt/lower_intrinsics_e2e.rs b/tests/mir-opt/lower_intrinsics_e2e.rs index 872ef59b0..872ef59b0 100644 --- a/src/test/mir-opt/lower_intrinsics_e2e.rs +++ b/tests/mir-opt/lower_intrinsics_e2e.rs diff --git a/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff index 5f5d6e68f..2b0370cf3 100644 --- a/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff +++ b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff @@ -33,7 +33,7 @@ _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_slice_len.rs:+1:8: +1:27 StorageDead(_5); // scope 0 at $DIR/lower_slice_len.rs:+1:26: +1:27 StorageDead(_4); // scope 0 at $DIR/lower_slice_len.rs:+1:26: +1:27 - switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_slice_len.rs:+1:8: +1:27 + switchInt(move _3) -> [0: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_slice_len.rs:+1:8: +1:27 } bb2: { diff --git a/src/test/mir-opt/lower_slice_len.rs b/tests/mir-opt/lower_slice_len.rs index 12955aed1..12955aed1 100644 --- a/src/test/mir-opt/lower_slice_len.rs +++ b/tests/mir-opt/lower_slice_len.rs diff --git a/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/tests/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff index d3db3b182..84e4d35f9 100644 --- a/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff +++ b/tests/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff @@ -32,18 +32,18 @@ bb0: { - FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_arm_scopes.rs:+1:11: +1:16 -- switchInt((_2.0: bool)) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16 -+ switchInt((_2.0: bool)) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16 +- switchInt((_2.0: bool)) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16 ++ switchInt((_2.0: bool)) -> [0: bb5, otherwise: bb1]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16 } bb1: { - falseEdge -> [real: bb8, imaginary: bb3]; // scope 0 at $DIR/match_arm_scopes.rs:+2:9: +2:22 -+ switchInt((_2.1: bool)) -> [false: bb10, otherwise: bb2]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16 ++ switchInt((_2.1: bool)) -> [0: bb10, otherwise: bb2]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16 } bb2: { -- switchInt((_2.1: bool)) -> [false: bb3, otherwise: bb4]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16 -+ switchInt((_2.0: bool)) -> [false: bb3, otherwise: bb17]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16 +- switchInt((_2.1: bool)) -> [0: bb3, otherwise: bb4]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16 ++ switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb17]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16 } bb3: { @@ -51,7 +51,7 @@ - } - - bb4: { -- switchInt((_2.0: bool)) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16 +- switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb5]; // scope 0 at $DIR/match_arm_scopes.rs:+1:5: +1:16 - } - - bb5: { @@ -85,8 +85,8 @@ StorageLive(_9); // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73 StorageLive(_10); // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49 _10 = _1; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49 -- switchInt(move _10) -> [false: bb10, otherwise: bb9]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49 -+ switchInt(move _10) -> [false: bb7, otherwise: bb6]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49 +- switchInt(move _10) -> [0: bb10, otherwise: bb9]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49 ++ switchInt(move _10) -> [0: bb7, otherwise: bb6]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49 } - bb9: { @@ -101,8 +101,8 @@ - bb10: { + bb7: { _9 = (*_6); // scope 0 at $DIR/match_arm_scopes.rs:+2:70: +2:71 -- switchInt(move _9) -> [false: bb12, otherwise: bb11]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73 -+ switchInt(move _9) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73 +- switchInt(move _9) -> [0: bb12, otherwise: bb11]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73 ++ switchInt(move _9) -> [0: bb9, otherwise: bb8]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73 } - bb11: { @@ -142,8 +142,8 @@ StorageLive(_12); // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73 StorageLive(_13); // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49 _13 = _1; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49 -- switchInt(move _13) -> [false: bb15, otherwise: bb14]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49 -+ switchInt(move _13) -> [false: bb12, otherwise: bb11]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49 +- switchInt(move _13) -> [0: bb15, otherwise: bb14]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49 ++ switchInt(move _13) -> [0: bb12, otherwise: bb11]; // scope 0 at $DIR/match_arm_scopes.rs:+2:45: +2:49 } - bb14: { @@ -158,8 +158,8 @@ - bb15: { + bb12: { _12 = (*_6); // scope 0 at $DIR/match_arm_scopes.rs:+2:70: +2:71 -- switchInt(move _12) -> [false: bb17, otherwise: bb16]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73 -+ switchInt(move _12) -> [false: bb14, otherwise: bb13]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73 +- switchInt(move _12) -> [0: bb17, otherwise: bb16]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73 ++ switchInt(move _12) -> [0: bb14, otherwise: bb13]; // scope 0 at $DIR/match_arm_scopes.rs:+2:42: +2:73 } - bb16: { diff --git a/src/test/mir-opt/match_arm_scopes.rs b/tests/mir-opt/match_arm_scopes.rs index 7b7de7788..7b7de7788 100644 --- a/src/test/mir-opt/match_arm_scopes.rs +++ b/tests/mir-opt/match_arm_scopes.rs diff --git a/src/test/mir-opt/match_test.main.SimplifyCfg-initial.after.mir b/tests/mir-opt/match_test.main.SimplifyCfg-initial.after.mir index b184ffc40..d51dbf425 100644 --- a/src/test/mir-opt/match_test.main.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/match_test.main.SimplifyCfg-initial.after.mir @@ -28,12 +28,12 @@ fn main() -> () { StorageLive(_3); // scope 2 at $DIR/match_test.rs:+6:5: +11:6 FakeRead(ForMatchedPlace(None), _1); // scope 2 at $DIR/match_test.rs:+6:11: +6:12 _6 = Le(const 0_i32, _1); // scope 2 at $DIR/match_test.rs:+7:9: +7:14 - switchInt(move _6) -> [false: bb4, otherwise: bb1]; // scope 2 at $DIR/match_test.rs:+7:9: +7:14 + switchInt(move _6) -> [0: bb4, otherwise: bb1]; // scope 2 at $DIR/match_test.rs:+7:9: +7:14 } bb1: { _7 = Lt(_1, const 10_i32); // scope 2 at $DIR/match_test.rs:+7:9: +7:14 - switchInt(move _7) -> [false: bb4, otherwise: bb2]; // scope 2 at $DIR/match_test.rs:+7:9: +7:14 + switchInt(move _7) -> [0: bb4, otherwise: bb2]; // scope 2 at $DIR/match_test.rs:+7:9: +7:14 } bb2: { @@ -47,12 +47,12 @@ fn main() -> () { bb4: { _4 = Le(const 10_i32, _1); // scope 2 at $DIR/match_test.rs:+8:9: +8:16 - switchInt(move _4) -> [false: bb7, otherwise: bb5]; // scope 2 at $DIR/match_test.rs:+8:9: +8:16 + switchInt(move _4) -> [0: bb7, otherwise: bb5]; // scope 2 at $DIR/match_test.rs:+8:9: +8:16 } bb5: { _5 = Le(_1, const 20_i32); // scope 2 at $DIR/match_test.rs:+8:9: +8:16 - switchInt(move _5) -> [false: bb7, otherwise: bb6]; // scope 2 at $DIR/match_test.rs:+8:9: +8:16 + switchInt(move _5) -> [0: bb7, otherwise: bb6]; // scope 2 at $DIR/match_test.rs:+8:9: +8:16 } bb6: { @@ -60,7 +60,7 @@ fn main() -> () { } bb7: { - switchInt(_1) -> [-1_i32: bb8, otherwise: bb3]; // scope 2 at $DIR/match_test.rs:+6:5: +6:12 + switchInt(_1) -> [4294967295: bb8, otherwise: bb3]; // scope 2 at $DIR/match_test.rs:+6:5: +6:12 } bb8: { @@ -71,7 +71,7 @@ fn main() -> () { _8 = &shallow _1; // scope 2 at $DIR/match_test.rs:+6:11: +6:12 StorageLive(_9); // scope 2 at $DIR/match_test.rs:+7:18: +7:19 _9 = _2; // scope 2 at $DIR/match_test.rs:+7:18: +7:19 - switchInt(move _9) -> [false: bb11, otherwise: bb10]; // scope 2 at $DIR/match_test.rs:+7:18: +7:19 + switchInt(move _9) -> [0: bb11, otherwise: bb10]; // scope 2 at $DIR/match_test.rs:+7:18: +7:19 } bb10: { diff --git a/src/test/mir-opt/match_test.rs b/tests/mir-opt/match_test.rs index 3a2107790..3a2107790 100644 --- a/src/test/mir-opt/match_test.rs +++ b/tests/mir-opt/match_test.rs diff --git a/src/test/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff index f9eeb1ea5..be91b0bfe 100644 --- a/src/test/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff @@ -33,7 +33,7 @@ StorageLive(_4); // scope 2 at $DIR/matches_reduce_branches.rs:+3:9: +3:10 StorageLive(_5); // scope 3 at $DIR/matches_reduce_branches.rs:+4:9: +4:10 StorageLive(_6); // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +21:6 -- switchInt(_1) -> [7_i32: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12 +- switchInt(_1) -> [7: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12 - } - - bb1: { diff --git a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff index 0b40b3be8..aa8092ece 100644 --- a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff @@ -11,12 +11,12 @@ bb0: { StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _3 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+1:17: +1:20 -- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- switchInt(move _3) -> [0: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _4 = move _3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _2 = Eq(_4, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL -+ switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL ++ switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb1: { @@ -30,7 +30,7 @@ - } - - bb3: { -- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb4: { diff --git a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff index b8c7722cd..193104dd3 100644 --- a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff @@ -26,7 +26,7 @@ StorageLive(_5); // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52 StorageLive(_6); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28 _6 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28 -- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28 +- switchInt(move _6) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28 - } - - bb1: { @@ -45,7 +45,7 @@ + _5 = Ne(_7, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+2:45: +2:50 + StorageDead(_7); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28 StorageDead(_6); // scope 0 at $DIR/matches_reduce_branches.rs:+2:51: +2:52 -- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52 +- switchInt(move _5) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52 - } - - bb4: { @@ -64,7 +64,7 @@ + _4 = Ne(_8, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+2:69: +2:74 + StorageDead(_8); // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52 StorageDead(_5); // scope 0 at $DIR/matches_reduce_branches.rs:+2:75: +2:76 -- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76 +- switchInt(move _4) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76 - } - - bb7: { @@ -78,7 +78,7 @@ - } - - bb9: { -- switchInt(move _3) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10 +- switchInt(move _3) -> [0: bb11, otherwise: bb10]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10 - } - - bb10: { diff --git a/src/test/mir-opt/matches_reduce_branches.rs b/tests/mir-opt/matches_reduce_branches.rs index a81d5f7b4..a81d5f7b4 100644 --- a/src/test/mir-opt/matches_reduce_branches.rs +++ b/tests/mir-opt/matches_reduce_branches.rs diff --git a/src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff b/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff index 1b4dddc1d..3766d99a4 100644 --- a/src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff @@ -8,7 +8,7 @@ bb0: { _2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12 - switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12 + switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12 } bb1: { diff --git a/src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff index 6e734852e..b5146cd53 100644 --- a/src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff @@ -8,7 +8,7 @@ bb0: { _2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12 - switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12 + switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12 } bb1: { diff --git a/src/test/mir-opt/matches_u8.rs b/tests/mir-opt/matches_u8.rs index 422c3a95e..422c3a95e 100644 --- a/src/test/mir-opt/matches_u8.rs +++ b/tests/mir-opt/matches_u8.rs diff --git a/src/test/mir-opt/multiple_return_terminators.rs b/tests/mir-opt/multiple_return_terminators.rs index a2b902d14..a2b902d14 100644 --- a/src/test/mir-opt/multiple_return_terminators.rs +++ b/tests/mir-opt/multiple_return_terminators.rs diff --git a/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff b/tests/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff index 48a11c950..48a11c950 100644 --- a/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff +++ b/tests/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff diff --git a/src/test/mir-opt/nll/named_lifetimes_basic.rs b/tests/mir-opt/nll/named_lifetimes_basic.rs index 843716033..843716033 100644 --- a/src/test/mir-opt/nll/named_lifetimes_basic.rs +++ b/tests/mir-opt/nll/named_lifetimes_basic.rs diff --git a/src/test/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir b/tests/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir index 6cd6d8b77..6cd6d8b77 100644 --- a/src/test/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir +++ b/tests/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir diff --git a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir index 3e3fda614..798e45df8 100644 --- a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir +++ b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir @@ -22,7 +22,7 @@ | fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/region_subtyping_basic.rs:+0:11: +0:11 - let mut _1: [usize; Const { ty: usize, kind: Value(Leaf(0x00000003)) }]; // in scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14 + let mut _1: [usize; Const(Value(Leaf(0x00000003)): usize)]; // in scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14 let _3: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:16: +2:17 let mut _4: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:14: +2:18 let mut _5: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:14: +2:18 @@ -62,7 +62,7 @@ fn main() -> () { FakeRead(ForLet(None), _6); // bb1[4]: scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10 StorageLive(_7); // bb1[5]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12 _7 = const ConstValue(Scalar(0x01): bool); // bb1[6]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12 - switchInt(move _7) -> [ConstValue(Scalar(0x00): bool): bb4, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12 + switchInt(move _7) -> [0: bb4, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12 } bb2: { diff --git a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir index 39a53702a..4767bfc76 100644 --- a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir +++ b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir @@ -22,7 +22,7 @@ | fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/region_subtyping_basic.rs:+0:11: +0:11 - let mut _1: [usize; Const { ty: usize, kind: Value(Leaf(0x0000000000000003)) }]; // in scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14 + let mut _1: [usize; Const(Value(Leaf(0x0000000000000003)): usize)]; // in scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14 let _3: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:16: +2:17 let mut _4: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:14: +2:18 let mut _5: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:14: +2:18 @@ -62,7 +62,7 @@ fn main() -> () { FakeRead(ForLet(None), _6); // bb1[4]: scope 2 at $DIR/region_subtyping_basic.rs:+3:9: +3:10 StorageLive(_7); // bb1[5]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12 _7 = const ConstValue(Scalar(0x01): bool); // bb1[6]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12 - switchInt(move _7) -> [ConstValue(Scalar(0x00): bool): bb4, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12 + switchInt(move _7) -> [0: bb4, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region_subtyping_basic.rs:+4:8: +4:12 } bb2: { diff --git a/src/test/mir-opt/nll/region_subtyping_basic.rs b/tests/mir-opt/nll/region_subtyping_basic.rs index 64332f302..64332f302 100644 --- a/src/test/mir-opt/nll/region_subtyping_basic.rs +++ b/tests/mir-opt/nll/region_subtyping_basic.rs diff --git a/src/test/mir-opt/no_drop_for_inactive_variant.rs b/tests/mir-opt/no_drop_for_inactive_variant.rs index 34e2b1a13..34e2b1a13 100644 --- a/src/test/mir-opt/no_drop_for_inactive_variant.rs +++ b/tests/mir-opt/no_drop_for_inactive_variant.rs diff --git a/src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir index e708255ce..69327b7af 100644 --- a/src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir @@ -15,7 +15,7 @@ fn unwrap(_1: Option<T>) -> T { bb0: { _2 = discriminant(_1); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+1:11: +1:14 - switchInt(move _2) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+1:5: +1:14 + switchInt(move _2) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+1:5: +1:14 } bb1: { diff --git a/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir b/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir index 0cb34a2f2..0cb34a2f2 100644 --- a/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir +++ b/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir diff --git a/src/test/mir-opt/no_spurious_drop_after_call.rs b/tests/mir-opt/no_spurious_drop_after_call.rs index bb5bb9aa4..bb5bb9aa4 100644 --- a/src/test/mir-opt/no_spurious_drop_after_call.rs +++ b/tests/mir-opt/no_spurious_drop_after_call.rs diff --git a/src/test/mir-opt/not_equal_false.opt.InstCombine.diff b/tests/mir-opt/not_equal_false.opt.InstCombine.diff index 5009d0906..b558c35ac 100644 --- a/src/test/mir-opt/not_equal_false.opt.InstCombine.diff +++ b/tests/mir-opt/not_equal_false.opt.InstCombine.diff @@ -14,7 +14,7 @@ - _2 = Ne(move _3, const false); // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:18 + _2 = move _3; // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:18 StorageDead(_3); // scope 0 at $DIR/not_equal_false.rs:+1:17: +1:18 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:18 + switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/not_equal_false.rs:+1:8: +1:18 } bb1: { diff --git a/src/test/mir-opt/not_equal_false.rs b/tests/mir-opt/not_equal_false.rs index 2ae03da40..2ae03da40 100644 --- a/src/test/mir-opt/not_equal_false.rs +++ b/tests/mir-opt/not_equal_false.rs diff --git a/src/test/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff index 61a16065b..61a16065b 100644 --- a/src/test/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff +++ b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff diff --git a/src/test/mir-opt/nrvo_simple.rs b/tests/mir-opt/nrvo_simple.rs index 5786ae621..5786ae621 100644 --- a/src/test/mir-opt/nrvo_simple.rs +++ b/tests/mir-opt/nrvo_simple.rs diff --git a/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir index e52253486..e52253486 100644 --- a/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir diff --git a/src/test/mir-opt/packed_struct_drop_aligned.rs b/tests/mir-opt/packed_struct_drop_aligned.rs index cb6524260..cb6524260 100644 --- a/src/test/mir-opt/packed_struct_drop_aligned.rs +++ b/tests/mir-opt/packed_struct_drop_aligned.rs diff --git a/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.diff b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.diff new file mode 100644 index 000000000..0b3da98a5 --- /dev/null +++ b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.diff @@ -0,0 +1,74 @@ +- // MIR for `match_guard` before CleanupPostBorrowck ++ // MIR for `match_guard` after CleanupPostBorrowck + + fn match_guard(_1: Option<&&i32>, _2: bool) -> i32 { + debug x => _1; // in scope 0 at $DIR/remove_fake_borrows.rs:+0:16: +0:17 + debug c => _2; // in scope 0 at $DIR/remove_fake_borrows.rs:+0:34: +0:35 + let mut _0: i32; // return place in scope 0 at $DIR/remove_fake_borrows.rs:+0:46: +0:49 + let mut _3: isize; // in scope 0 at $DIR/remove_fake_borrows.rs:+2:9: +2:16 + let mut _4: &std::option::Option<&&i32>; // in scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 + let mut _5: &&i32; // in scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 + let mut _6: &&&i32; // in scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 + let mut _7: &i32; // in scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 + let mut _8: bool; // in scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 + + bb0: { +- FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 ++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 + _3 = discriminant(_1); // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 + switchInt(move _3) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:+1:5: +1:12 + } + + bb1: { + _0 = const 1_i32; // scope 0 at $DIR/remove_fake_borrows.rs:+3:14: +3:15 + goto -> bb7; // scope 0 at $DIR/remove_fake_borrows.rs:+3:14: +3:15 + } + + bb2: { + switchInt((*(*((_1 as Some).0: &&i32)))) -> [0: bb3, otherwise: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:+1:5: +1:12 + } + + bb3: { +- falseEdge -> [real: bb4, imaginary: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:+2:9: +2:16 ++ goto -> bb4; // scope 0 at $DIR/remove_fake_borrows.rs:+2:9: +2:16 + } + + bb4: { +- _4 = &shallow _1; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 +- _5 = &shallow (*((_1 as Some).0: &&i32)); // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 +- _6 = &shallow ((_1 as Some).0: &&i32); // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 +- _7 = &shallow (*(*((_1 as Some).0: &&i32))); // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 ++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 ++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 ++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 ++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+1:11: +1:12 + StorageLive(_8); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 + _8 = _2; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 + switchInt(move _8) -> [0: bb6, otherwise: bb5]; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 + } + + bb5: { + StorageDead(_8); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 +- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 +- FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 +- FakeRead(ForMatchGuard, _6); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 +- FakeRead(ForMatchGuard, _7); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 ++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 ++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 ++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 ++ nop; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 + _0 = const 0_i32; // scope 0 at $DIR/remove_fake_borrows.rs:+2:25: +2:26 + goto -> bb7; // scope 0 at $DIR/remove_fake_borrows.rs:+2:25: +2:26 + } + + bb6: { + StorageDead(_8); // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 +- falseEdge -> [real: bb1, imaginary: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 ++ goto -> bb1; // scope 0 at $DIR/remove_fake_borrows.rs:+2:20: +2:21 + } + + bb7: { + return; // scope 0 at $DIR/remove_fake_borrows.rs:+5:2: +5:2 + } + } + diff --git a/src/test/mir-opt/remove_fake_borrows.rs b/tests/mir-opt/remove_fake_borrows.rs index a980f386b..d26c6f5d7 100644 --- a/src/test/mir-opt/remove_fake_borrows.rs +++ b/tests/mir-opt/remove_fake_borrows.rs @@ -2,7 +2,7 @@ // ignore-wasm32-bare compiled with panic=abort by default -// EMIT_MIR remove_fake_borrows.match_guard.CleanupNonCodegenStatements.diff +// EMIT_MIR remove_fake_borrows.match_guard.CleanupPostBorrowck.diff fn match_guard(x: Option<&&i32>, c: bool) -> i32 { match x { Some(0) if c => 0, diff --git a/src/test/mir-opt/remove_never_const.no_codegen.PreCodegen.after.mir b/tests/mir-opt/remove_never_const.no_codegen.PreCodegen.after.mir index 8eb0e9c8f..8eb0e9c8f 100644 --- a/src/test/mir-opt/remove_never_const.no_codegen.PreCodegen.after.mir +++ b/tests/mir-opt/remove_never_const.no_codegen.PreCodegen.after.mir diff --git a/src/test/mir-opt/remove_never_const.rs b/tests/mir-opt/remove_never_const.rs index 16095cfdd..160cc9555 100644 --- a/src/test/mir-opt/remove_never_const.rs +++ b/tests/mir-opt/remove_never_const.rs @@ -1,6 +1,6 @@ // This was originally a regression test for #66975 - ensure that we do not generate never typed // consts in codegen. We also have tests for this that catches the error, see -// src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs. +// tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs. // Force generation of optimized mir for functions that do not reach codegen. // compile-flags: --emit mir,link diff --git a/src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff index 188aa5564..ed1d0b87f 100644 --- a/src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff +++ b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff @@ -63,7 +63,7 @@ bb3: { - StorageDead(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:18: +2:19 _10 = discriminant(_7); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19 - switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19 + switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5]; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19 } bb4: { diff --git a/src/test/mir-opt/remove_storage_markers.rs b/tests/mir-opt/remove_storage_markers.rs index f00b82691..f00b82691 100644 --- a/src/test/mir-opt/remove_storage_markers.rs +++ b/tests/mir-opt/remove_storage_markers.rs diff --git a/src/test/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff b/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff index 07e4dd418..07e4dd418 100644 --- a/src/test/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff +++ b/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff diff --git a/src/test/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff b/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff index e809ca4e9..e809ca4e9 100644 --- a/src/test/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff +++ b/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff diff --git a/src/test/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff index 087f76dbd..087f76dbd 100644 --- a/src/test/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff diff --git a/src/test/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff index 933d6895f..933d6895f 100644 --- a/src/test/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff diff --git a/src/test/mir-opt/remove_unneeded_drops.rs b/tests/mir-opt/remove_unneeded_drops.rs index 1052f2886..1052f2886 100644 --- a/src/test/mir-opt/remove_unneeded_drops.rs +++ b/tests/mir-opt/remove_unneeded_drops.rs diff --git a/src/test/mir-opt/remove_zsts.get_union.PreCodegen.after.mir b/tests/mir-opt/remove_zsts.get_union.PreCodegen.after.mir index 12e914e25..12e914e25 100644 --- a/src/test/mir-opt/remove_zsts.get_union.PreCodegen.after.mir +++ b/tests/mir-opt/remove_zsts.get_union.PreCodegen.after.mir diff --git a/src/test/mir-opt/remove_zsts.get_union.RemoveZsts.diff b/tests/mir-opt/remove_zsts.get_union.RemoveZsts.diff index 169b7b105..169b7b105 100644 --- a/src/test/mir-opt/remove_zsts.get_union.RemoveZsts.diff +++ b/tests/mir-opt/remove_zsts.get_union.RemoveZsts.diff diff --git a/src/test/mir-opt/remove_zsts.rs b/tests/mir-opt/remove_zsts.rs index 1cf7ad6e3..1cf7ad6e3 100644 --- a/src/test/mir-opt/remove_zsts.rs +++ b/tests/mir-opt/remove_zsts.rs diff --git a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir index 7b69b3e07..19b726e74 100644 --- a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir @@ -145,7 +145,7 @@ fn array_casts() -> () { StorageDead(_24); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _22 = Not(move _23); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_23); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(move _22) -> [false: bb4, otherwise: bb3]; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _22) -> [0: bb4, otherwise: bb3]; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb3: { diff --git a/tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir b/tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir new file mode 100644 index 000000000..f495f147b --- /dev/null +++ b/tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir @@ -0,0 +1,22 @@ +// MIR for `std::ptr::drop_in_place` after SimplifyCfg-make_shim + +fn std::ptr::drop_in_place(_1: *mut Test) -> () { + let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + let mut _2: &mut Test; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + let mut _3: &mut Test; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + let mut _4: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + + bb0: { + _2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + Retag([fn entry] _2); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + _3 = &mut (*_2); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + _4 = <Test as Drop>::drop(move _3) -> bb1; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + // mir::Constant + // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL + // + literal: Const { ty: for<'a> fn(&'a mut Test) {<Test as Drop>::drop}, val: Value(<ZST>) } + } + + bb1: { + return; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + } +} diff --git a/src/test/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir index 9e5c119a2..9e5c119a2 100644 --- a/src/test/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir diff --git a/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir index b853e4505..b853e4505 100644 --- a/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir diff --git a/src/test/mir-opt/retag.rs b/tests/mir-opt/retag.rs index 86deb0e7c..86deb0e7c 100644 --- a/src/test/mir-opt/retag.rs +++ b/tests/mir-opt/retag.rs diff --git a/src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir index 4b50205fa..4b50205fa 100644 --- a/src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir diff --git a/src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir index f32a84e4c..f32a84e4c 100644 --- a/src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir diff --git a/src/test/mir-opt/return_an_array.rs b/tests/mir-opt/return_an_array.rs index bea3c317c..bea3c317c 100644 --- a/src/test/mir-opt/return_an_array.rs +++ b/tests/mir-opt/return_an_array.rs diff --git a/src/test/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff b/tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff index b28c6f687..e57544e09 100644 --- a/src/test/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff +++ b/tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff @@ -22,6 +22,9 @@ let mut _18: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL scope 9 { debug e => _16; // in scope 9 at $SRC_DIR/core/src/result.rs:LL:COL + scope 10 (inlined <i32 as From<i32>>::from) { // at $SRC_DIR/core/src/result.rs:LL:COL + debug t => _18; // in scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL + } } } } @@ -53,14 +56,14 @@ StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9 _4 = _1; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9 _10 = discriminant(_4); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL -- switchInt(move _10) -> [0_isize: bb7, 1_isize: bb5, otherwise: bb6]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL -+ switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL +- switchInt(move _10) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL ++ switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL } bb1: { - StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10 - _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10 -- switchInt(move _5) -> [0_isize: bb2, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10 +- switchInt(move _5) -> [0: bb2, 1: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10 - } - - bb2: { @@ -92,11 +95,18 @@ StorageLive(_17); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL StorageLive(_18); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL _18 = move _16; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL -- _17 = <i32 as From<i32>>::from(move _18) -> bb8; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL -+ _17 = <i32 as From<i32>>::from(move _18) -> bb7; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL - // mir::Constant - // + span: $SRC_DIR/core/src/result.rs:LL:COL - // + literal: Const { ty: fn(i32) -> i32 {<i32 as From<i32>>::from}, val: Value(<ZST>) } + _17 = move _18; // scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL + StorageDead(_18); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL + Deinit(_0); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL + ((_0 as Err).0: i32) = move _17; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL + discriminant(_0) = 1; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL + StorageDead(_17); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL + StorageDead(_16); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL + StorageDead(_8); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10 + StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10 + StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:10: +1:11 + StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:+2:1: +2:2 + return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2 } - bb5: { @@ -118,7 +128,7 @@ - goto -> bb1; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL + StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10 + _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10 -+ switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10 ++ switchInt(move _5) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10 } - bb6: { @@ -140,22 +150,7 @@ - goto -> bb1; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL + StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10 + _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10 -+ switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10 - } - -- bb8: { -+ bb7: { - StorageDead(_18); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL - Deinit(_0); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL - ((_0 as Err).0: i32) = move _17; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL - discriminant(_0) = 1; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL - StorageDead(_17); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL - StorageDead(_16); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL - StorageDead(_8); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10 - StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10 - StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:10: +1:11 - StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:+2:1: +2:2 - return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2 ++ switchInt(move _5) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10 } } diff --git a/src/test/mir-opt/separate_const_switch.rs b/tests/mir-opt/separate_const_switch.rs index c809e5629..c809e5629 100644 --- a/src/test/mir-opt/separate_const_switch.rs +++ b/tests/mir-opt/separate_const_switch.rs diff --git a/src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff b/tests/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff index 437979081..8cc0c6a18 100644 --- a/src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff +++ b/tests/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff @@ -30,7 +30,7 @@ bb0: { StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6 _3 = discriminant(_1); // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16 - switchInt(move _3) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+6:9: +6:16 + switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+6:9: +6:16 } bb1: { @@ -45,7 +45,7 @@ StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44 - goto -> bb4; // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44 + _8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6 -+ switchInt(move _8) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6 ++ switchInt(move _8) -> [0: bb6, 1: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6 } bb2: { @@ -67,8 +67,8 @@ - - bb4: { _8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6 -- switchInt(move _8) -> [0_isize: bb7, 1_isize: bb5, otherwise: bb6]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6 -+ switchInt(move _8) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6 +- switchInt(move _8) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6 ++ switchInt(move _8) -> [0: bb6, 1: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6 } - bb5: { diff --git a/tests/mir-opt/simple_option_map_e2e.ezmap.PreCodegen.after.mir b/tests/mir-opt/simple_option_map_e2e.ezmap.PreCodegen.after.mir new file mode 100644 index 000000000..916f99049 --- /dev/null +++ b/tests/mir-opt/simple_option_map_e2e.ezmap.PreCodegen.after.mir @@ -0,0 +1,52 @@ +// MIR for `ezmap` after PreCodegen + +fn ezmap(_1: Option<i32>) -> Option<i32> { + debug x => _1; // in scope 0 at $DIR/simple_option_map_e2e.rs:+0:14: +0:15 + let mut _0: std::option::Option<i32>; // return place in scope 0 at $DIR/simple_option_map_e2e.rs:+0:33: +0:44 + let mut _2: [closure@$DIR/simple_option_map_e2e.rs:14:12: 14:15]; // in scope 0 at $DIR/simple_option_map_e2e.rs:+1:12: +1:21 + scope 1 (inlined map::<i32, i32, [closure@$DIR/simple_option_map_e2e.rs:14:12: 14:15]>) { // at $DIR/simple_option_map_e2e.rs:14:5: 14:22 + debug slf => _1; // in scope 1 at $DIR/simple_option_map_e2e.rs:2:17: 2:20 + debug f => _2; // in scope 1 at $DIR/simple_option_map_e2e.rs:2:33: 2:34 + let mut _3: isize; // in scope 1 at $DIR/simple_option_map_e2e.rs:7:9: 7:16 + let mut _4: i32; // in scope 1 at $DIR/simple_option_map_e2e.rs:7:25: 7:29 + let mut _5: i32; // in scope 1 at $DIR/simple_option_map_e2e.rs:7:25: 7:29 + scope 2 { + debug x => _5; // in scope 2 at $DIR/simple_option_map_e2e.rs:7:14: 7:15 + scope 3 (inlined ezmap::{closure#0}) { // at $DIR/simple_option_map_e2e.rs:7:25: 7:29 + debug n => _5; // in scope 3 at $DIR/simple_option_map_e2e.rs:+1:13: +1:14 + } + } + } + + bb0: { + StorageLive(_2); // scope 0 at $DIR/simple_option_map_e2e.rs:+1:12: +1:21 + _3 = discriminant(_1); // scope 1 at $DIR/simple_option_map_e2e.rs:6:11: 6:14 + switchInt(move _3) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 1 at $DIR/simple_option_map_e2e.rs:6:5: 6:14 + } + + bb1: { + Deinit(_0); // scope 1 at $DIR/simple_option_map_e2e.rs:8:17: 8:21 + discriminant(_0) = 0; // scope 1 at $DIR/simple_option_map_e2e.rs:8:17: 8:21 + goto -> bb4; // scope 1 at $DIR/simple_option_map_e2e.rs:8:17: 8:21 + } + + bb2: { + unreachable; // scope 1 at $DIR/simple_option_map_e2e.rs:6:11: 6:14 + } + + bb3: { + _5 = move ((_1 as Some).0: i32); // scope 1 at $DIR/simple_option_map_e2e.rs:7:14: 7:15 + StorageLive(_4); // scope 2 at $DIR/simple_option_map_e2e.rs:7:25: 7:29 + _4 = Add(move _5, const 1_i32); // scope 3 at $DIR/simple_option_map_e2e.rs:+1:16: +1:21 + Deinit(_0); // scope 2 at $DIR/simple_option_map_e2e.rs:7:20: 7:30 + ((_0 as Some).0: i32) = move _4; // scope 2 at $DIR/simple_option_map_e2e.rs:7:20: 7:30 + discriminant(_0) = 1; // scope 2 at $DIR/simple_option_map_e2e.rs:7:20: 7:30 + StorageDead(_4); // scope 2 at $DIR/simple_option_map_e2e.rs:7:29: 7:30 + goto -> bb4; // scope 1 at $DIR/simple_option_map_e2e.rs:10:1: 10:2 + } + + bb4: { + StorageDead(_2); // scope 0 at $DIR/simple_option_map_e2e.rs:+1:21: +1:22 + return; // scope 0 at $DIR/simple_option_map_e2e.rs:+2:2: +2:2 + } +} diff --git a/tests/mir-opt/simple_option_map_e2e.rs b/tests/mir-opt/simple_option_map_e2e.rs new file mode 100644 index 000000000..2acd2a227 --- /dev/null +++ b/tests/mir-opt/simple_option_map_e2e.rs @@ -0,0 +1,19 @@ +#[inline(always)] +fn map<T, U, F>(slf: Option<T>, f: F) -> Option<U> +where + F: FnOnce(T) -> U, +{ + match slf { + Some(x) => Some(f(x)), + None => None, + } +} + +// EMIT_MIR simple_option_map_e2e.ezmap.PreCodegen.after.mir +pub fn ezmap(x: Option<i32>) -> Option<i32> { + map(x, |n| n + 1) +} + +fn main() { + assert_eq!(None, ezmap(None)); +} diff --git a/src/test/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff b/tests/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff index cff9afc38..cff9afc38 100644 --- a/src/test/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff +++ b/tests/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff diff --git a/src/test/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff b/tests/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff index 9d38b9350..9d38b9350 100644 --- a/src/test/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff +++ b/tests/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff diff --git a/src/test/mir-opt/simplify_arm.rs b/tests/mir-opt/simplify_arm.rs index c247872e2..c247872e2 100644 --- a/src/test/mir-opt/simplify_arm.rs +++ b/tests/mir-opt/simplify_arm.rs diff --git a/src/test/mir-opt/simplify_arm_identity.rs b/tests/mir-opt/simplify_arm_identity.rs index cf6ff57aa..cf6ff57aa 100644 --- a/src/test/mir-opt/simplify_arm_identity.rs +++ b/tests/mir-opt/simplify_arm_identity.rs diff --git a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff b/tests/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff index e068b81bc..8eb1aa1f3 100644 --- a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff +++ b/tests/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff @@ -25,9 +25,9 @@ } - bb3: { -- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17 +- switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17 + bb2: { -+ switchInt(move _2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17 ++ switchInt(move _2) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17 } - bb4: { diff --git a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff b/tests/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff index f693798eb..1e66b1f70 100644 --- a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff +++ b/tests/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff @@ -26,7 +26,7 @@ } bb3: { - switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17 + switchInt(move _2) -> [0: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:+2:12: +2:17 } bb4: { diff --git a/src/test/mir-opt/simplify_cfg.rs b/tests/mir-opt/simplify_cfg.rs index cf7eac440..cf7eac440 100644 --- a/src/test/mir-opt/simplify_cfg.rs +++ b/tests/mir-opt/simplify_cfg.rs diff --git a/src/test/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff index 9b1bea270..f9e22866b 100644 --- a/src/test/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff +++ b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff @@ -9,7 +9,7 @@ bb0: { StorageLive(_1); // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13 _1 = const false; // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13 -- switchInt(const false) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13 +- switchInt(const false) -> [0: bb3, otherwise: bb1]; // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13 + goto -> bb3; // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13 } @@ -23,12 +23,10 @@ bb2: { StorageDead(_2); // scope 0 at $DIR/simplify_if.rs:+2:15: +2:16 - nop; // scope 0 at $DIR/simplify_if.rs:+1:14: +3:6 goto -> bb4; // scope 0 at $DIR/simplify_if.rs:+1:5: +3:6 } bb3: { - nop; // scope 0 at $DIR/simplify_if.rs:+3:6: +3:6 goto -> bb4; // scope 0 at $DIR/simplify_if.rs:+1:5: +3:6 } diff --git a/src/test/mir-opt/simplify_if.rs b/tests/mir-opt/simplify_if.rs index 2d093d926..2d093d926 100644 --- a/src/test/mir-opt/simplify_if.rs +++ b/tests/mir-opt/simplify_if.rs diff --git a/tests/mir-opt/simplify_locals.c.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.c.SimplifyLocals-before-const-prop.diff new file mode 100644 index 000000000..1be27e963 --- /dev/null +++ b/tests/mir-opt/simplify_locals.c.SimplifyLocals-before-const-prop.diff @@ -0,0 +1,33 @@ +- // MIR for `c` before SimplifyLocals-before-const-prop ++ // MIR for `c` after SimplifyLocals-before-const-prop + + fn c() -> () { + let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:8: +0:8 + let _1: [u8; 10]; // in scope 0 at $DIR/simplify_locals.rs:+1:9: +1:14 +- let mut _2: &[u8]; // in scope 0 at $DIR/simplify_locals.rs:+3:20: +3:26 +- let mut _3: &[u8; 10]; // in scope 0 at $DIR/simplify_locals.rs:+3:20: +3:26 +- let _4: &[u8; 10]; // in scope 0 at $DIR/simplify_locals.rs:+3:20: +3:26 + scope 1 { + debug bytes => _1; // in scope 1 at $DIR/simplify_locals.rs:+1:9: +1:14 + scope 2 { + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+1:9: +1:14 + _1 = [const 0_u8; 10]; // scope 0 at $DIR/simplify_locals.rs:+1:17: +1:26 +- StorageLive(_2); // scope 1 at $DIR/simplify_locals.rs:+3:20: +3:26 +- StorageLive(_3); // scope 1 at $DIR/simplify_locals.rs:+3:20: +3:26 +- StorageLive(_4); // scope 1 at $DIR/simplify_locals.rs:+3:20: +3:26 +- _4 = &_1; // scope 1 at $DIR/simplify_locals.rs:+3:20: +3:26 +- _3 = &(*_4); // scope 1 at $DIR/simplify_locals.rs:+3:20: +3:26 +- _2 = move _3 as &[u8] (Pointer(Unsize)); // scope 1 at $DIR/simplify_locals.rs:+3:20: +3:26 +- StorageDead(_3); // scope 1 at $DIR/simplify_locals.rs:+3:25: +3:26 +- StorageDead(_4); // scope 1 at $DIR/simplify_locals.rs:+3:26: +3:27 +- StorageDead(_2); // scope 1 at $DIR/simplify_locals.rs:+3:26: +3:27 + _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:8: +4:2 + StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+4:1: +4:2 + return; // scope 0 at $DIR/simplify_locals.rs:+4:2: +4:2 + } + } + diff --git a/tests/mir-opt/simplify_locals.d1.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.d1.SimplifyLocals-before-const-prop.diff new file mode 100644 index 000000000..981738030 --- /dev/null +++ b/tests/mir-opt/simplify_locals.d1.SimplifyLocals-before-const-prop.diff @@ -0,0 +1,19 @@ +- // MIR for `d1` before SimplifyLocals-before-const-prop ++ // MIR for `d1` after SimplifyLocals-before-const-prop + + fn d1() -> () { + let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:9: +0:9 +- let mut _1: E; // in scope 0 at $DIR/simplify_locals.rs:+2:13: +2:17 + scope 1 { + } + + bb0: { +- StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+2:13: +2:17 +- Deinit(_1); // scope 0 at $DIR/simplify_locals.rs:+2:13: +2:17 +- discriminant(_1) = 0; // scope 0 at $DIR/simplify_locals.rs:+2:13: +2:17 +- StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+2:17: +2:18 + _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:9: +3:2 + return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2 + } + } + diff --git a/tests/mir-opt/simplify_locals.d2.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.d2.SimplifyLocals-before-const-prop.diff new file mode 100644 index 000000000..b152dc8cc --- /dev/null +++ b/tests/mir-opt/simplify_locals.d2.SimplifyLocals-before-const-prop.diff @@ -0,0 +1,29 @@ +- // MIR for `d2` before SimplifyLocals-before-const-prop ++ // MIR for `d2` after SimplifyLocals-before-const-prop + + fn d2() -> () { + let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:9: +0:9 +- let mut _1: E; // in scope 0 at $DIR/simplify_locals.rs:+2:22: +2:26 +- let mut _2: (i32, E); // in scope 0 at $DIR/simplify_locals.rs:+2:5: +2:17 +- let mut _3: E; // in scope 0 at $DIR/simplify_locals.rs:+2:11: +2:15 + + bb0: { +- StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+2:22: +2:26 +- Deinit(_1); // scope 0 at $DIR/simplify_locals.rs:+2:22: +2:26 +- discriminant(_1) = 1; // scope 0 at $DIR/simplify_locals.rs:+2:22: +2:26 +- StorageLive(_2); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:17 +- StorageLive(_3); // scope 0 at $DIR/simplify_locals.rs:+2:11: +2:15 +- Deinit(_3); // scope 0 at $DIR/simplify_locals.rs:+2:11: +2:15 +- discriminant(_3) = 0; // scope 0 at $DIR/simplify_locals.rs:+2:11: +2:15 +- Deinit(_2); // scope 0 at $DIR/simplify_locals.rs:+2:6: +2:16 +- (_2.0: i32) = const 10_i32; // scope 0 at $DIR/simplify_locals.rs:+2:6: +2:16 +- (_2.1: E) = move _3; // scope 0 at $DIR/simplify_locals.rs:+2:6: +2:16 +- StorageDead(_3); // scope 0 at $DIR/simplify_locals.rs:+2:15: +2:16 +- (_2.1: E) = move _1; // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:26 +- StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+2:25: +2:26 +- StorageDead(_2); // scope 0 at $DIR/simplify_locals.rs:+2:26: +2:27 + _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:9: +3:2 + return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2 + } + } + diff --git a/tests/mir-opt/simplify_locals.expose_addr.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.expose_addr.SimplifyLocals-before-const-prop.diff new file mode 100644 index 000000000..9ca1dbbd0 --- /dev/null +++ b/tests/mir-opt/simplify_locals.expose_addr.SimplifyLocals-before-const-prop.diff @@ -0,0 +1,21 @@ +- // MIR for `expose_addr` before SimplifyLocals-before-const-prop ++ // MIR for `expose_addr` after SimplifyLocals-before-const-prop + + fn expose_addr(_1: *const usize) -> () { + debug p => _1; // in scope 0 at $DIR/simplify_locals.rs:+0:16: +0:17 + let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:33: +0:33 + let _2: usize; // in scope 0 at $DIR/simplify_locals.rs:+2:5: +2:15 + let mut _3: *const usize; // in scope 0 at $DIR/simplify_locals.rs:+2:5: +2:6 + + bb0: { + StorageLive(_2); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:15 + StorageLive(_3); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:6 + _3 = _1; // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:6 + _2 = move _3 as usize (PointerExposeAddress); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:15 + StorageDead(_3); // scope 0 at $DIR/simplify_locals.rs:+2:14: +2:15 + StorageDead(_2); // scope 0 at $DIR/simplify_locals.rs:+2:15: +2:16 + _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:33: +3:2 + return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2 + } + } + diff --git a/tests/mir-opt/simplify_locals.r.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.r.SimplifyLocals-before-const-prop.diff new file mode 100644 index 000000000..19dacb427 --- /dev/null +++ b/tests/mir-opt/simplify_locals.r.SimplifyLocals-before-const-prop.diff @@ -0,0 +1,31 @@ +- // MIR for `r` before SimplifyLocals-before-const-prop ++ // MIR for `r` after SimplifyLocals-before-const-prop + + fn r() -> () { + let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:8: +0:8 + let mut _1: i32; // in scope 0 at $DIR/simplify_locals.rs:+1:9: +1:14 +- let mut _2: &i32; // in scope 0 at $DIR/simplify_locals.rs:+3:13: +3:15 +- let mut _3: &mut i32; // in scope 0 at $DIR/simplify_locals.rs:+4:13: +4:19 + scope 1 { + debug a => _1; // in scope 1 at $DIR/simplify_locals.rs:+1:9: +1:14 + scope 2 { + scope 3 { + } + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+1:9: +1:14 + _1 = const 1_i32; // scope 0 at $DIR/simplify_locals.rs:+1:17: +1:18 +- StorageLive(_2); // scope 1 at $DIR/simplify_locals.rs:+3:13: +3:15 +- _2 = &_1; // scope 1 at $DIR/simplify_locals.rs:+3:13: +3:15 +- StorageDead(_2); // scope 1 at $DIR/simplify_locals.rs:+3:15: +3:16 +- StorageLive(_3); // scope 2 at $DIR/simplify_locals.rs:+4:13: +4:19 +- _3 = &mut _1; // scope 2 at $DIR/simplify_locals.rs:+4:13: +4:19 +- StorageDead(_3); // scope 2 at $DIR/simplify_locals.rs:+4:19: +4:20 + _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:8: +5:2 + StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+5:1: +5:2 + return; // scope 0 at $DIR/simplify_locals.rs:+5:2: +5:2 + } + } + diff --git a/tests/mir-opt/simplify_locals.rs b/tests/mir-opt/simplify_locals.rs new file mode 100644 index 000000000..7bbc0481c --- /dev/null +++ b/tests/mir-opt/simplify_locals.rs @@ -0,0 +1,81 @@ +// unit-test: SimplifyLocals-before-const-prop + + +#![feature(thread_local)] + +#[derive(Copy, Clone)] +enum E { + A, + B, +} + +// EMIT_MIR simplify_locals.c.SimplifyLocals-before-const-prop.diff +fn c() { + let bytes = [0u8; 10]; + // Unused cast + let _: &[u8] = &bytes; +} + +// EMIT_MIR simplify_locals.d1.SimplifyLocals-before-const-prop.diff +fn d1() { + // Unused set discriminant + let _ = E::A; +} + +// EMIT_MIR simplify_locals.d2.SimplifyLocals-before-const-prop.diff +fn d2() { + // Unused set discriminant + {(10, E::A)}.1 = E::B; +} + +// EMIT_MIR simplify_locals.r.SimplifyLocals-before-const-prop.diff +fn r() { + let mut a = 1; + // Unused references + let _ = &a; + let _ = &mut a; +} + +#[thread_local] static mut X: u32 = 0; + +// EMIT_MIR simplify_locals.t1.SimplifyLocals-before-const-prop.diff +fn t1() { + // Unused thread local + unsafe { X }; +} + +// EMIT_MIR simplify_locals.t2.SimplifyLocals-before-const-prop.diff +fn t2() { + // Unused thread local + unsafe { &mut X }; +} + +// EMIT_MIR simplify_locals.t3.SimplifyLocals-before-const-prop.diff +fn t3() { + // Unused thread local + unsafe { *&mut X }; +} + +// EMIT_MIR simplify_locals.t4.SimplifyLocals-before-const-prop.diff +fn t4() -> u32 { + // Used thread local + unsafe { X + 1 } +} + +// EMIT_MIR simplify_locals.expose_addr.SimplifyLocals-before-const-prop.diff +fn expose_addr(p: *const usize) { + // Used pointer to address cast. Has a side effect of exposing the provenance. + p as usize; +} + +fn main() { + c(); + d1(); + d2(); + r(); + t1(); + t2(); + t3(); + t4(); + expose_addr(&0); +} diff --git a/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff new file mode 100644 index 000000000..1b2e1158e --- /dev/null +++ b/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff @@ -0,0 +1,22 @@ +- // MIR for `t1` before SimplifyLocals-before-const-prop ++ // MIR for `t1` after SimplifyLocals-before-const-prop + + fn t1() -> () { + let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:9: +0:9 +- let _1: u32; // in scope 0 at $DIR/simplify_locals.rs:+2:14: +2:15 +- let mut _2: *mut u32; // in scope 0 at $DIR/simplify_locals.rs:+2:14: +2:15 + scope 1 { + } + + bb0: { +- StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:17 +- StorageLive(_2); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15 +- _2 = &/*tls*/ mut X; // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15 +- _1 = (*_2); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15 +- StorageDead(_2); // scope 0 at $DIR/simplify_locals.rs:+2:17: +2:18 +- StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+2:17: +2:18 + _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:9: +3:2 + return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2 + } + } + diff --git a/tests/mir-opt/simplify_locals.t2.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t2.SimplifyLocals-before-const-prop.diff new file mode 100644 index 000000000..cf019357b --- /dev/null +++ b/tests/mir-opt/simplify_locals.t2.SimplifyLocals-before-const-prop.diff @@ -0,0 +1,22 @@ +- // MIR for `t2` before SimplifyLocals-before-const-prop ++ // MIR for `t2` after SimplifyLocals-before-const-prop + + fn t2() -> () { + let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:9: +0:9 +- let _1: &mut u32; // in scope 0 at $DIR/simplify_locals.rs:+2:14: +2:20 +- let mut _2: *mut u32; // in scope 0 at $DIR/simplify_locals.rs:+2:19: +2:20 + scope 1 { + } + + bb0: { +- StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:22 +- StorageLive(_2); // scope 1 at $DIR/simplify_locals.rs:+2:19: +2:20 +- _2 = &/*tls*/ mut X; // scope 1 at $DIR/simplify_locals.rs:+2:19: +2:20 +- _1 = &mut (*_2); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:20 +- StorageDead(_2); // scope 0 at $DIR/simplify_locals.rs:+2:22: +2:23 +- StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+2:22: +2:23 + _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:9: +3:2 + return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2 + } + } + diff --git a/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff new file mode 100644 index 000000000..90ee21580 --- /dev/null +++ b/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff @@ -0,0 +1,26 @@ +- // MIR for `t3` before SimplifyLocals-before-const-prop ++ // MIR for `t3` after SimplifyLocals-before-const-prop + + fn t3() -> () { + let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:9: +0:9 +- let _1: u32; // in scope 0 at $DIR/simplify_locals.rs:+2:14: +2:21 +- let mut _2: &mut u32; // in scope 0 at $DIR/simplify_locals.rs:+2:15: +2:21 +- let mut _3: *mut u32; // in scope 0 at $DIR/simplify_locals.rs:+2:20: +2:21 + scope 1 { + } + + bb0: { +- StorageLive(_1); // scope 0 at $DIR/simplify_locals.rs:+2:5: +2:23 +- StorageLive(_2); // scope 1 at $DIR/simplify_locals.rs:+2:15: +2:21 +- StorageLive(_3); // scope 1 at $DIR/simplify_locals.rs:+2:20: +2:21 +- _3 = &/*tls*/ mut X; // scope 1 at $DIR/simplify_locals.rs:+2:20: +2:21 +- _2 = &mut (*_3); // scope 1 at $DIR/simplify_locals.rs:+2:15: +2:21 +- _1 = (*_2); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:21 +- StorageDead(_3); // scope 0 at $DIR/simplify_locals.rs:+2:23: +2:24 +- StorageDead(_2); // scope 0 at $DIR/simplify_locals.rs:+2:23: +2:24 +- StorageDead(_1); // scope 0 at $DIR/simplify_locals.rs:+2:23: +2:24 + _0 = const (); // scope 0 at $DIR/simplify_locals.rs:+0:9: +3:2 + return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2 + } + } + diff --git a/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff new file mode 100644 index 000000000..9add9a6c5 --- /dev/null +++ b/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff @@ -0,0 +1,22 @@ +- // MIR for `t4` before SimplifyLocals-before-const-prop ++ // MIR for `t4` after SimplifyLocals-before-const-prop + + fn t4() -> u32 { + let mut _0: u32; // return place in scope 0 at $DIR/simplify_locals.rs:+0:12: +0:15 + let mut _1: u32; // in scope 0 at $DIR/simplify_locals.rs:+2:14: +2:15 + let mut _2: *mut u32; // in scope 0 at $DIR/simplify_locals.rs:+2:14: +2:15 + scope 1 { + } + + bb0: { + StorageLive(_1); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15 + StorageLive(_2); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15 + _2 = &/*tls*/ mut X; // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15 + _1 = (*_2); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:15 + _0 = Add(move _1, const 1_u32); // scope 1 at $DIR/simplify_locals.rs:+2:14: +2:19 + StorageDead(_1); // scope 1 at $DIR/simplify_locals.rs:+2:18: +2:19 + StorageDead(_2); // scope 0 at $DIR/simplify_locals.rs:+3:1: +3:2 + return; // scope 0 at $DIR/simplify_locals.rs:+3:2: +3:2 + } + } + diff --git a/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.diff b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.diff new file mode 100644 index 000000000..f888c622d --- /dev/null +++ b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.diff @@ -0,0 +1,62 @@ +- // MIR for `foo` before SimplifyLocals-final ++ // MIR for `foo` after SimplifyLocals-final + + fn foo() -> () { + let mut _0: (); // return place in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+0:13: +0:13 + let mut _1: (std::option::Option<u8>, std::option::Option<T>); // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+1:30: +1:69 + let mut _2: std::option::Option<u8>; // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+1:31: +1:49 + let mut _3: std::option::Option<T>; // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+1:51: +1:68 + let mut _4: isize; // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+1:22: +1:26 + let mut _5: isize; // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+1:13: +1:20 +- let mut _7: bool; // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+2:12: +2:20 +- let mut _8: u8; // in scope 0 at $DIR/simplify_locals_fixedpoint.rs:+2:12: +2:13 + scope 1 { + debug a => _6; // in scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:18: +1:19 + let _6: u8; // in scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:18: +1:19 + } + + bb0: { + StorageLive(_1); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:30: +1:69 + StorageLive(_2); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:31: +1:49 + Deinit(_2); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:31: +1:49 + discriminant(_2) = 0; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:31: +1:49 + StorageLive(_3); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:51: +1:68 + Deinit(_3); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:51: +1:68 + discriminant(_3) = 0; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:51: +1:68 + Deinit(_1); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:30: +1:69 + (_1.0: std::option::Option<u8>) = move _2; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:30: +1:69 + (_1.1: std::option::Option<T>) = move _3; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:30: +1:69 + StorageDead(_3); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:68: +1:69 + StorageDead(_2); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:68: +1:69 + _5 = discriminant((_1.0: std::option::Option<u8>)); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27 + switchInt(move _5) -> [1: bb1, otherwise: bb3]; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27 + } + + bb1: { + _4 = discriminant((_1.1: std::option::Option<T>)); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27 + switchInt(move _4) -> [0: bb2, otherwise: bb3]; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:12: +1:27 + } + + bb2: { + StorageLive(_6); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:18: +1:19 + _6 = (((_1.0: std::option::Option<u8>) as Some).0: u8); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+1:18: +1:19 +- StorageLive(_7); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+2:12: +2:20 +- StorageLive(_8); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+2:12: +2:13 +- _8 = _6; // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+2:12: +2:13 +- _7 = Gt(move _8, const 42_u8); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+2:12: +2:20 +- StorageDead(_8); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+2:19: +2:20 +- StorageDead(_7); // scope 1 at $DIR/simplify_locals_fixedpoint.rs:+4:9: +4:10 + StorageDead(_6); // scope 0 at $DIR/simplify_locals_fixedpoint.rs:+5:5: +5:6 + goto -> bb3; // scope 0 at $DIR/simplify_locals_fixedpoint.rs:+1:5: +5:6 + } + + bb3: { + drop(_1) -> bb4; // scope 0 at $DIR/simplify_locals_fixedpoint.rs:+6:1: +6:2 + } + + bb4: { + StorageDead(_1); // scope 0 at $DIR/simplify_locals_fixedpoint.rs:+6:1: +6:2 + return; // scope 0 at $DIR/simplify_locals_fixedpoint.rs:+6:2: +6:2 + } + } + diff --git a/tests/mir-opt/simplify_locals_fixedpoint.rs b/tests/mir-opt/simplify_locals_fixedpoint.rs new file mode 100644 index 000000000..1fdba6e99 --- /dev/null +++ b/tests/mir-opt/simplify_locals_fixedpoint.rs @@ -0,0 +1,15 @@ +// compile-flags: -Zmir-opt-level=1 + +fn foo<T>() { + if let (Some(a), None) = (Option::<u8>::None, Option::<T>::None) { + if a > 42u8 { + + } + } +} + +fn main() { + foo::<()>(); +} + +// EMIT_MIR simplify_locals_fixedpoint.foo.SimplifyLocals-final.diff diff --git a/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.diff new file mode 100644 index 000000000..efb2b0961 --- /dev/null +++ b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.diff @@ -0,0 +1,109 @@ +- // MIR for `main` before SimplifyLocals-before-const-prop ++ // MIR for `main` after SimplifyLocals-before-const-prop + + fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+0:11: +0:11 +- let mut _1: ((), ()); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:20: +1:28 +- let mut _2: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:21: +1:23 +- let mut _3: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:25: +1:27 +- let _4: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:5: +2:22 +- let mut _5: ((), ()); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21 +- let mut _6: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:14: +2:16 +- let mut _7: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:18: +2:20 +- let _8: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:5: +4:35 +- let mut _9: u8; // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:34 +- let mut _10: u8; // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:30 +- let mut _11: Temp; // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28 ++ let _1: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:5: +2:22 ++ let mut _2: ((), ()); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21 ++ let mut _3: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:14: +2:16 ++ let mut _4: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+2:18: +2:20 ++ let _5: (); // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:5: +4:35 ++ let mut _6: u8; // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:34 ++ let mut _7: u8; // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:30 ++ let mut _8: Temp; // in scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28 + scope 1 { + } + + bb0: { +- StorageLive(_1); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:20: +1:28 +- StorageLive(_2); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:21: +1:23 +- Deinit(_2); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:21: +1:23 +- StorageLive(_3); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:25: +1:27 +- Deinit(_3); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:25: +1:27 +- Deinit(_1); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:20: +1:28 +- (_1.0: ()) = move _2; // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:20: +1:28 +- (_1.1: ()) = move _3; // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:20: +1:28 +- StorageDead(_3); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:27: +1:28 +- StorageDead(_2); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:27: +1:28 +- StorageDead(_1); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+1:28: +1:29 +- StorageLive(_4); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:5: +2:22 +- StorageLive(_5); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21 +- StorageLive(_6); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:14: +2:16 +- Deinit(_6); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:14: +2:16 +- StorageLive(_7); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:18: +2:20 +- Deinit(_7); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:18: +2:20 +- Deinit(_5); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21 +- (_5.0: ()) = move _6; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21 +- (_5.1: ()) = move _7; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21 +- StorageDead(_7); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:20: +2:21 +- StorageDead(_6); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:20: +2:21 +- _4 = use_zst(move _5) -> bb1; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:5: +2:22 ++ StorageLive(_1); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:5: +2:22 ++ StorageLive(_2); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21 ++ StorageLive(_3); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:14: +2:16 ++ Deinit(_3); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:14: +2:16 ++ StorageLive(_4); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:18: +2:20 ++ Deinit(_4); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:18: +2:20 ++ Deinit(_2); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21 ++ (_2.0: ()) = move _3; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21 ++ (_2.1: ()) = move _4; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:13: +2:21 ++ StorageDead(_4); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:20: +2:21 ++ StorageDead(_3); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:20: +2:21 ++ _1 = use_zst(move _2) -> bb1; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:5: +2:22 + // mir::Constant + // + span: $DIR/simplify_locals_removes_unused_consts.rs:15:5: 15:12 + // + literal: Const { ty: fn(((), ())) {use_zst}, val: Value(<ZST>) } + } + + bb1: { +- StorageDead(_5); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:21: +2:22 +- StorageDead(_4); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:22: +2:23 +- StorageLive(_8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:5: +4:35 +- StorageLive(_9); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:34 +- StorageLive(_10); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:30 +- StorageLive(_11); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28 +- Deinit(_11); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28 +- (_11.0: u8) = const 40_u8; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28 +- _10 = (_11.0: u8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:30 +- _9 = Add(move _10, const 2_u8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:34 +- StorageDead(_10); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:33: +4:34 +- _8 = use_u8(move _9) -> bb2; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:5: +4:35 ++ StorageDead(_2); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:21: +2:22 ++ StorageDead(_1); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+2:22: +2:23 ++ StorageLive(_5); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:5: +4:35 ++ StorageLive(_6); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:34 ++ StorageLive(_7); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:30 ++ StorageLive(_8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28 ++ Deinit(_8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28 ++ (_8.0: u8) = const 40_u8; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:28 ++ _7 = (_8.0: u8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:30 ++ _6 = Add(move _7, const 2_u8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:12: +4:34 ++ StorageDead(_7); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:33: +4:34 ++ _5 = use_u8(move _6) -> bb2; // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:5: +4:35 + // mir::Constant + // + span: $DIR/simplify_locals_removes_unused_consts.rs:17:5: 17:11 + // + literal: Const { ty: fn(u8) {use_u8}, val: Value(<ZST>) } + } + + bb2: { +- StorageDead(_9); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:34: +4:35 +- StorageDead(_11); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:35: +4:36 ++ StorageDead(_6); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:34: +4:35 + StorageDead(_8); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:35: +4:36 ++ StorageDead(_5); // scope 1 at $DIR/simplify_locals_removes_unused_consts.rs:+4:35: +4:36 + _0 = const (); // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+0:11: +5:2 + return; // scope 0 at $DIR/simplify_locals_removes_unused_consts.rs:+5:2: +5:2 + } + } + diff --git a/src/test/mir-opt/simplify_locals_removes_unused_consts.rs b/tests/mir-opt/simplify_locals_removes_unused_consts.rs index 39b7911d4..7a03a2837 100644 --- a/src/test/mir-opt/simplify_locals_removes_unused_consts.rs +++ b/tests/mir-opt/simplify_locals_removes_unused_consts.rs @@ -1,4 +1,4 @@ -// unit-test: SimplifyLocals +// unit-test: SimplifyLocals-before-const-prop // compile-flags: -C overflow-checks=no fn use_zst(_: ((), ())) {} @@ -9,7 +9,7 @@ struct Temp { fn use_u8(_: u8) {} -// EMIT_MIR simplify_locals_removes_unused_consts.main.SimplifyLocals.diff +// EMIT_MIR simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.diff fn main() { let ((), ()) = ((), ()); use_zst(((), ())); diff --git a/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals-before-const-prop.diff new file mode 100644 index 000000000..027c983e6 --- /dev/null +++ b/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals-before-const-prop.diff @@ -0,0 +1,52 @@ +- // MIR for `map` before SimplifyLocals-before-const-prop ++ // MIR for `map` after SimplifyLocals-before-const-prop + + fn map(_1: Option<Box<()>>) -> Option<Box<()>> { + debug x => _1; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+0:8: +0:9 + let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+0:31: +0:46 + let mut _2: isize; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+2:9: +2:13 + let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:14: +3:15 + let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:25: +3:26 +- let mut _5: bool; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+5:1: +5:2 +- let mut _6: isize; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+5:1: +5:2 +- let mut _7: isize; // in scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+5:1: +5:2 + scope 1 { + debug x => _3; // in scope 1 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:14: +3:15 + } + + bb0: { +- _5 = const false; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:11: +1:12 +- _5 = const true; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:11: +1:12 + _2 = discriminant(_1); // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:11: +1:12 + switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:5: +1:12 + } + + bb1: { + StorageLive(_3); // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:14: +3:15 + _3 = move ((_1 as Some).0: std::boxed::Box<()>); // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:14: +3:15 + StorageLive(_4); // scope 1 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:25: +3:26 + _4 = move _3; // scope 1 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:25: +3:26 + Deinit(_0); // scope 1 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:20: +3:27 + ((_0 as Some).0: std::boxed::Box<()>) = move _4; // scope 1 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:20: +3:27 + discriminant(_0) = 1; // scope 1 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:20: +3:27 + StorageDead(_4); // scope 1 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:26: +3:27 + StorageDead(_3); // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:26: +3:27 + goto -> bb4; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+3:26: +3:27 + } + + bb2: { + unreachable; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+1:11: +1:12 + } + + bb3: { + Deinit(_0); // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+2:17: +2:21 + discriminant(_0) = 0; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+2:17: +2:21 + goto -> bb4; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+2:17: +2:21 + } + + bb4: { +- _6 = discriminant(_1); // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+5:1: +5:2 + return; // scope 0 at $DIR/simplify_locals_removes_unused_discriminant_reads.rs:+5:2: +5:2 + } + } + diff --git a/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs b/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs new file mode 100644 index 000000000..de6585741 --- /dev/null +++ b/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs @@ -0,0 +1,14 @@ +// unit-test: SimplifyLocals-before-const-prop + +fn map(x: Option<Box<()>>) -> Option<Box<()>> { + match x { + None => None, + Some(x) => Some(x), + } +} + +fn main() { + map(None); +} + +// EMIT_MIR simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals-before-const-prop.diff diff --git a/src/test/mir-opt/simplify_match.main.ConstProp.diff b/tests/mir-opt/simplify_match.main.ConstProp.diff index e4f9a4c12..70bfbf1b3 100644 --- a/src/test/mir-opt/simplify_match.main.ConstProp.diff +++ b/tests/mir-opt/simplify_match.main.ConstProp.diff @@ -16,12 +16,11 @@ - _1 = _2; // scope 1 at $DIR/simplify_match.rs:+1:28: +1:29 + _1 = const false; // scope 1 at $DIR/simplify_match.rs:+1:28: +1:29 StorageDead(_2); // scope 0 at $DIR/simplify_match.rs:+1:30: +1:31 -- switchInt(_1) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:+1:5: +1:31 -+ switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:+1:5: +1:31 +- switchInt(_1) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:+1:5: +1:31 ++ switchInt(const false) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:+1:5: +1:31 } bb1: { - nop; // scope 0 at $DIR/simplify_match.rs:+3:18: +3:20 goto -> bb3; // scope 0 at $DIR/simplify_match.rs:+3:18: +3:20 } diff --git a/src/test/mir-opt/simplify_match.rs b/tests/mir-opt/simplify_match.rs index 216203f9f..216203f9f 100644 --- a/src/test/mir-opt/simplify_match.rs +++ b/tests/mir-opt/simplify_match.rs diff --git a/src/test/mir-opt/simplify_try_if_let.rs b/tests/mir-opt/simplify_try_if_let.rs index fba67de40..fba67de40 100644 --- a/src/test/mir-opt/simplify_try_if_let.rs +++ b/tests/mir-opt/simplify_try_if_let.rs diff --git a/src/test/mir-opt/simplify_try_if_let.{impl#0}-append.SimplifyArmIdentity.diff b/tests/mir-opt/simplify_try_if_let.{impl#0}-append.SimplifyArmIdentity.diff index 11f6b5337..11f6b5337 100644 --- a/src/test/mir-opt/simplify_try_if_let.{impl#0}-append.SimplifyArmIdentity.diff +++ b/tests/mir-opt/simplify_try_if_let.{impl#0}-append.SimplifyArmIdentity.diff diff --git a/src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir b/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir index 31ccf1454..391b00eff 100644 --- a/src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir +++ b/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir @@ -37,7 +37,7 @@ fn std::ptr::drop_in_place(_1: *mut [String]) -> () { bb4 (cleanup): { _6 = Eq(_4, _3); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 - switchInt(move _6) -> [false: bb3, otherwise: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + switchInt(move _6) -> [0: bb3, otherwise: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 } bb5: { @@ -48,7 +48,7 @@ fn std::ptr::drop_in_place(_1: *mut [String]) -> () { bb6: { _8 = Eq(_4, _3); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 - switchInt(move _8) -> [false: bb5, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + switchInt(move _8) -> [0: bb5, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 } bb7: { @@ -68,7 +68,7 @@ fn std::ptr::drop_in_place(_1: *mut [String]) -> () { bb10 (cleanup): { _12 = Eq(_9, _10); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 - switchInt(move _12) -> [false: bb9, otherwise: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + switchInt(move _12) -> [0: bb9, otherwise: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 } bb11: { @@ -79,7 +79,7 @@ fn std::ptr::drop_in_place(_1: *mut [String]) -> () { bb12: { _14 = Eq(_9, _10); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 - switchInt(move _14) -> [false: bb11, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + switchInt(move _14) -> [0: bb11, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 } bb13: { @@ -96,6 +96,6 @@ fn std::ptr::drop_in_place(_1: *mut [String]) -> () { bb15: { _2 = SizeOf(std::string::String); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 _3 = Len((*_1)); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 - switchInt(move _2) -> [0_usize: bb8, otherwise: bb14]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 + switchInt(move _2) -> [0: bb8, otherwise: bb14]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56 } } diff --git a/src/test/mir-opt/slice_drop_shim.rs b/tests/mir-opt/slice_drop_shim.rs index 344c1af2c..344c1af2c 100644 --- a/src/test/mir-opt/slice_drop_shim.rs +++ b/tests/mir-opt/slice_drop_shim.rs diff --git a/src/test/mir-opt/spanview_block.main.built.after.html b/tests/mir-opt/spanview_block.main.built.after.html index b962d80c5..b962d80c5 100644 --- a/src/test/mir-opt/spanview_block.main.built.after.html +++ b/tests/mir-opt/spanview_block.main.built.after.html diff --git a/src/test/mir-opt/spanview_block.rs b/tests/mir-opt/spanview_block.rs index 0ecf35ad6..0ecf35ad6 100644 --- a/src/test/mir-opt/spanview_block.rs +++ b/tests/mir-opt/spanview_block.rs diff --git a/src/test/mir-opt/spanview_statement.main.built.after.html b/tests/mir-opt/spanview_statement.main.built.after.html index 43bff7d09..43bff7d09 100644 --- a/src/test/mir-opt/spanview_statement.main.built.after.html +++ b/tests/mir-opt/spanview_statement.main.built.after.html diff --git a/src/test/mir-opt/spanview_statement.rs b/tests/mir-opt/spanview_statement.rs index 457052617..457052617 100644 --- a/src/test/mir-opt/spanview_statement.rs +++ b/tests/mir-opt/spanview_statement.rs diff --git a/src/test/mir-opt/spanview_terminator.main.built.after.html b/tests/mir-opt/spanview_terminator.main.built.after.html index aa7e44c15..aa7e44c15 100644 --- a/src/test/mir-opt/spanview_terminator.main.built.after.html +++ b/tests/mir-opt/spanview_terminator.main.built.after.html diff --git a/src/test/mir-opt/spanview_terminator.rs b/tests/mir-opt/spanview_terminator.rs index 76fced188..76fced188 100644 --- a/src/test/mir-opt/spanview_terminator.rs +++ b/tests/mir-opt/spanview_terminator.rs diff --git a/src/test/mir-opt/sroa.dropping.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.dropping.ScalarReplacementOfAggregates.diff index eb8830446..eb8830446 100644 --- a/src/test/mir-opt/sroa.dropping.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa.dropping.ScalarReplacementOfAggregates.diff diff --git a/src/test/mir-opt/sroa.enums.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.enums.ScalarReplacementOfAggregates.diff index 7c7e87c32..a5488c1ec 100644 --- a/src/test/mir-opt/sroa.enums.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa.enums.ScalarReplacementOfAggregates.diff @@ -21,7 +21,7 @@ discriminant(_2) = 1; // scope 1 at $DIR/sroa.rs:+1:22: +1:29 StorageDead(_3); // scope 1 at $DIR/sroa.rs:+1:28: +1:29 _4 = discriminant(_2); // scope 1 at $DIR/sroa.rs:+1:12: +1:19 - switchInt(move _4) -> [1_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/sroa.rs:+1:12: +1:19 + switchInt(move _4) -> [1: bb1, otherwise: bb2]; // scope 1 at $DIR/sroa.rs:+1:12: +1:19 } bb1: { diff --git a/src/test/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff index 64559b58f..64559b58f 100644 --- a/src/test/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff diff --git a/src/test/mir-opt/sroa.flat.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.flat.ScalarReplacementOfAggregates.diff index d4c04d5e6..d4c04d5e6 100644 --- a/src/test/mir-opt/sroa.flat.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa.flat.ScalarReplacementOfAggregates.diff diff --git a/src/test/mir-opt/sroa.rs b/tests/mir-opt/sroa.rs index ff8deb40d..ff8deb40d 100644 --- a/src/test/mir-opt/sroa.rs +++ b/tests/mir-opt/sroa.rs diff --git a/src/test/mir-opt/sroa.structs.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.structs.ScalarReplacementOfAggregates.diff index 69d74c351..69d74c351 100644 --- a/src/test/mir-opt/sroa.structs.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa.structs.ScalarReplacementOfAggregates.diff diff --git a/src/test/mir-opt/sroa.unions.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.unions.ScalarReplacementOfAggregates.diff index 03ca976df..03ca976df 100644 --- a/src/test/mir-opt/sroa.unions.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa.unions.ScalarReplacementOfAggregates.diff diff --git a/src/test/mir-opt/storage_ranges.main.nll.0.mir b/tests/mir-opt/storage_ranges.main.nll.0.mir index 8e10e70f1..8e10e70f1 100644 --- a/src/test/mir-opt/storage_ranges.main.nll.0.mir +++ b/tests/mir-opt/storage_ranges.main.nll.0.mir diff --git a/src/test/mir-opt/storage_ranges.rs b/tests/mir-opt/storage_ranges.rs index 996051a29..996051a29 100644 --- a/src/test/mir-opt/storage_ranges.rs +++ b/tests/mir-opt/storage_ranges.rs diff --git a/src/test/mir-opt/tls_access.main.PreCodegen.after.mir b/tests/mir-opt/tls_access.main.PreCodegen.after.mir index 09453b8ba..09453b8ba 100644 --- a/src/test/mir-opt/tls_access.main.PreCodegen.after.mir +++ b/tests/mir-opt/tls_access.main.PreCodegen.after.mir diff --git a/src/test/mir-opt/tls_access.rs b/tests/mir-opt/tls_access.rs index 19344c868..19344c868 100644 --- a/src/test/mir-opt/tls_access.rs +++ b/tests/mir-opt/tls_access.rs diff --git a/src/test/mir-opt/try_identity_e2e.new.PreCodegen.after.mir b/tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir index 30185f3ff..b254bfeb7 100644 --- a/src/test/mir-opt/try_identity_e2e.new.PreCodegen.after.mir +++ b/tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir @@ -26,7 +26,7 @@ fn new(_1: Result<T, E>) -> Result<T, E> { bb0: { StorageLive(_2); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10 _3 = discriminant(_1); // scope 0 at $DIR/try_identity_e2e.rs:+3:19: +3:20 - switchInt(move _3) -> [0_isize: bb2, 1_isize: bb1, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+3:13: +3:20 + switchInt(move _3) -> [0: bb2, 1: bb1, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+3:13: +3:20 } bb1: { @@ -35,7 +35,7 @@ fn new(_1: Result<T, E>) -> Result<T, E> { ((_2 as Break).0: E) = move _5; // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48 discriminant(_2) = 1; // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48 _6 = discriminant(_2); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10 - switchInt(move _6) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10 + switchInt(move _6) -> [0: bb5, 1: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10 } bb2: { @@ -44,7 +44,7 @@ fn new(_1: Result<T, E>) -> Result<T, E> { ((_2 as Continue).0: T) = move _4; // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50 discriminant(_2) = 0; // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50 _6 = discriminant(_2); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10 - switchInt(move _6) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10 + switchInt(move _6) -> [0: bb5, 1: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10 } bb3: { diff --git a/src/test/mir-opt/try_identity_e2e.old.PreCodegen.after.mir b/tests/mir-opt/try_identity_e2e.old.PreCodegen.after.mir index 2a9c7408c..cdbc0681c 100644 --- a/src/test/mir-opt/try_identity_e2e.old.PreCodegen.after.mir +++ b/tests/mir-opt/try_identity_e2e.old.PreCodegen.after.mir @@ -15,7 +15,7 @@ fn old(_1: Result<T, E>) -> Result<T, E> { bb0: { _2 = discriminant(_1); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +2:16 - switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +2:16 + switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +2:16 } bb1: { diff --git a/src/test/mir-opt/try_identity_e2e.rs b/tests/mir-opt/try_identity_e2e.rs index 00cb80f50..00cb80f50 100644 --- a/src/test/mir-opt/try_identity_e2e.rs +++ b/tests/mir-opt/try_identity_e2e.rs diff --git a/tests/mir-opt/uninhabited_enum.process_never.SimplifyLocals-final.after.mir b/tests/mir-opt/uninhabited_enum.process_never.SimplifyLocals-final.after.mir new file mode 100644 index 000000000..b4fb330f3 --- /dev/null +++ b/tests/mir-opt/uninhabited_enum.process_never.SimplifyLocals-final.after.mir @@ -0,0 +1,16 @@ +// MIR for `process_never` after SimplifyLocals-final + +fn process_never(_1: *const !) -> () { + debug input => _1; // in scope 0 at $DIR/uninhabited_enum.rs:+0:22: +0:27 + let mut _0: (); // return place in scope 0 at $DIR/uninhabited_enum.rs:+0:39: +0:39 + let _2: &!; // in scope 0 at $DIR/uninhabited_enum.rs:+1:8: +1:14 + scope 1 { + debug _input => _2; // in scope 1 at $DIR/uninhabited_enum.rs:+1:8: +1:14 + } + scope 2 { + } + + bb0: { + unreachable; // scope 0 at $DIR/uninhabited_enum.rs:+0:39: +2:2 + } +} diff --git a/tests/mir-opt/uninhabited_enum.process_void.SimplifyLocals-final.after.mir b/tests/mir-opt/uninhabited_enum.process_void.SimplifyLocals-final.after.mir new file mode 100644 index 000000000..2af864998 --- /dev/null +++ b/tests/mir-opt/uninhabited_enum.process_void.SimplifyLocals-final.after.mir @@ -0,0 +1,18 @@ +// MIR for `process_void` after SimplifyLocals-final + +fn process_void(_1: *const Void) -> () { + debug input => _1; // in scope 0 at $DIR/uninhabited_enum.rs:+0:21: +0:26 + let mut _0: (); // return place in scope 0 at $DIR/uninhabited_enum.rs:+0:41: +0:41 + let _2: &Void; // in scope 0 at $DIR/uninhabited_enum.rs:+1:8: +1:14 + scope 1 { + debug _input => _2; // in scope 1 at $DIR/uninhabited_enum.rs:+1:8: +1:14 + } + scope 2 { + } + + bb0: { + StorageLive(_2); // scope 0 at $DIR/uninhabited_enum.rs:+1:8: +1:14 + StorageDead(_2); // scope 0 at $DIR/uninhabited_enum.rs:+4:1: +4:2 + return; // scope 0 at $DIR/uninhabited_enum.rs:+4:2: +4:2 + } +} diff --git a/tests/mir-opt/uninhabited_enum.rs b/tests/mir-opt/uninhabited_enum.rs new file mode 100644 index 000000000..19db54815 --- /dev/null +++ b/tests/mir-opt/uninhabited_enum.rs @@ -0,0 +1,19 @@ +#![feature(never_type)] + +pub enum Void {} + +// EMIT_MIR uninhabited_enum.process_never.SimplifyLocals-final.after.mir +#[no_mangle] +pub fn process_never(input: *const !) { + let _input = unsafe { &*input }; +} + +// EMIT_MIR uninhabited_enum.process_void.SimplifyLocals-final.after.mir +#[no_mangle] +pub fn process_void(input: *const Void) { + let _input = unsafe { &*input }; + // In the future, this should end with `unreachable`, but we currently only do + // unreachability analysis for `!`. +} + +fn main() {} diff --git a/src/test/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir b/tests/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir index 4aa5ba007..39ec05277 100644 --- a/src/test/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir +++ b/tests/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir @@ -18,7 +18,7 @@ fn main() -> () { Deinit(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19 discriminant(_2) = 2; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19 _3 = discriminant(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19 - switchInt(move _3) -> [2_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19 + switchInt(move _3) -> [2: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19 } bb1: { @@ -36,7 +36,7 @@ fn main() -> () { Deinit(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19 discriminant(_7) = 0; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19 _8 = discriminant(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19 - switchInt(move _8) -> [4_isize: bb5, 5_isize: bb3, otherwise: bb4]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19 + switchInt(move _8) -> [4: bb5, 5: bb3, otherwise: bb4]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19 } bb2: { diff --git a/src/test/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff index c3d356aed..598413a1d 100644 --- a/src/test/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff +++ b/tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff @@ -19,8 +19,8 @@ Deinit(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19 discriminant(_2) = 2; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19 _3 = discriminant(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19 -- switchInt(move _3) -> [0_isize: bb3, 1_isize: bb4, 2_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19 -+ switchInt(move _3) -> [2_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19 +- switchInt(move _3) -> [0: bb3, 1: bb4, 2: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19 ++ switchInt(move _3) -> [2: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19 } bb1: { @@ -65,7 +65,7 @@ Deinit(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19 discriminant(_7) = 0; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19 _8 = discriminant(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19 - switchInt(move _8) -> [4_isize: bb8, 5_isize: bb6, otherwise: bb7]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19 + switchInt(move _8) -> [4: bb8, 5: bb6, otherwise: bb7]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19 } bb6: { diff --git a/src/test/mir-opt/uninhabited_enum_branching.rs b/tests/mir-opt/uninhabited_enum_branching.rs index 0ef604c30..0ef604c30 100644 --- a/src/test/mir-opt/uninhabited_enum_branching.rs +++ b/tests/mir-opt/uninhabited_enum_branching.rs diff --git a/src/test/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir b/tests/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir index ec5612ad7..c8cd6f6c1 100644 --- a/src/test/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir +++ b/tests/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir @@ -32,7 +32,7 @@ fn main() -> () { StorageLive(_4); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22 _4 = &(_1.1: Test1); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22 _5 = discriminant((*_4)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22 - switchInt(move _5) -> [2_isize: bb3, 3_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22 + switchInt(move _5) -> [2: bb3, 3: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22 } bb1: { @@ -66,7 +66,7 @@ fn main() -> () { StorageDead(_3); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+8:6: +8:7 StorageLive(_9); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +15:6 _10 = discriminant((_1.1: Test1)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:11: +10:21 - switchInt(move _10) -> [2_isize: bb7, 3_isize: bb5, otherwise: bb6]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21 + switchInt(move _10) -> [2: bb7, 3: bb5, otherwise: bb6]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21 } bb5: { diff --git a/src/test/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff index 77b358a48..2aee6d268 100644 --- a/src/test/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff +++ b/tests/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff @@ -33,8 +33,8 @@ StorageLive(_4); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22 _4 = &(_1.1: Test1); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22 _5 = discriminant((*_4)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22 -- switchInt(move _5) -> [0_isize: bb3, 1_isize: bb4, 2_isize: bb5, 3_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22 -+ switchInt(move _5) -> [2_isize: bb5, 3_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22 +- switchInt(move _5) -> [0: bb3, 1: bb4, 2: bb5, 3: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22 ++ switchInt(move _5) -> [2: bb5, 3: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22 } bb1: { @@ -87,8 +87,8 @@ StorageDead(_3); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+8:6: +8:7 StorageLive(_9); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +15:6 _10 = discriminant((_1.1: Test1)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:11: +10:21 -- switchInt(move _10) -> [0_isize: bb9, 1_isize: bb10, 2_isize: bb11, 3_isize: bb7, otherwise: bb8]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21 -+ switchInt(move _10) -> [2_isize: bb11, 3_isize: bb7, otherwise: bb8]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21 +- switchInt(move _10) -> [0: bb9, 1: bb10, 2: bb11, 3: bb7, otherwise: bb8]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21 ++ switchInt(move _10) -> [2: bb11, 3: bb7, otherwise: bb8]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21 } bb7: { diff --git a/src/test/mir-opt/uninhabited_enum_branching2.rs b/tests/mir-opt/uninhabited_enum_branching2.rs index e22e94314..e22e94314 100644 --- a/src/test/mir-opt/uninhabited_enum_branching2.rs +++ b/tests/mir-opt/uninhabited_enum_branching2.rs diff --git a/src/test/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff index 11d93fca7..58e085dd0 100644 --- a/src/test/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff +++ b/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UninhabitedEnumBranching.diff @@ -8,8 +8,8 @@ bb0: { _2 = discriminant(_1); // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:11: +1:12 -- switchInt(move _2) -> [1_isize: bb3, 2_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12 -+ switchInt(move _2) -> [1_isize: bb3, 2_isize: bb2, otherwise: bb5]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12 +- switchInt(move _2) -> [1: bb3, 2: bb2, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12 ++ switchInt(move _2) -> [1: bb3, 2: bb2, otherwise: bb5]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12 } bb1: { diff --git a/src/test/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff index a7f8321ae..e765851eb 100644 --- a/src/test/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff +++ b/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UninhabitedEnumBranching.diff @@ -8,8 +8,8 @@ bb0: { _2 = discriminant(_1); // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:11: +1:12 -- switchInt(move _2) -> [0_isize: bb2, 1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12 -+ switchInt(move _2) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12 +- switchInt(move _2) -> [0: bb2, 1: bb3, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12 ++ switchInt(move _2) -> [1: bb3, otherwise: bb1]; // scope 0 at $DIR/uninhabited_fallthrough_elimination.rs:+1:5: +1:12 } bb1: { diff --git a/src/test/mir-opt/uninhabited_fallthrough_elimination.rs b/tests/mir-opt/uninhabited_fallthrough_elimination.rs index 0853883f8..0853883f8 100644 --- a/src/test/mir-opt/uninhabited_fallthrough_elimination.rs +++ b/tests/mir-opt/uninhabited_fallthrough_elimination.rs diff --git a/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff b/tests/mir-opt/unreachable.main.UnreachablePropagation.diff index 9cd4b8ccf..848bff1d4 100644 --- a/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff +++ b/tests/mir-opt/unreachable.main.UnreachablePropagation.diff @@ -27,8 +27,8 @@ bb1: { _2 = discriminant(_1); // scope 1 at $DIR/unreachable.rs:+1:12: +1:20 -- switchInt(move _2) -> [1_isize: bb2, otherwise: bb6]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20 -+ switchInt(move _2) -> [1_isize: bb2, otherwise: bb3]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20 +- switchInt(move _2) -> [1: bb2, otherwise: bb6]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20 ++ switchInt(move _2) -> [1: bb2, otherwise: bb3]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20 } bb2: { @@ -38,7 +38,7 @@ - StorageLive(_5); // scope 2 at $DIR/unreachable.rs:+4:9: +8:10 - StorageLive(_6); // scope 2 at $DIR/unreachable.rs:+4:12: +4:16 - _6 = const true; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16 -- switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16 +- switchInt(move _6) -> [0: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16 + unreachable; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16 } diff --git a/src/test/mir-opt/unreachable.rs b/tests/mir-opt/unreachable.rs index 6098b525b..6098b525b 100644 --- a/src/test/mir-opt/unreachable.rs +++ b/tests/mir-opt/unreachable.rs diff --git a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff index afd6b00aa..fb778470e 100644 --- a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff +++ b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff @@ -29,7 +29,7 @@ bb1: { _3 = discriminant(_2); // scope 2 at $DIR/unreachable_diverging.rs:+2:12: +2:22 - switchInt(move _3) -> [1_isize: bb2, otherwise: bb6]; // scope 2 at $DIR/unreachable_diverging.rs:+2:12: +2:22 + switchInt(move _3) -> [1: bb2, otherwise: bb6]; // scope 2 at $DIR/unreachable_diverging.rs:+2:12: +2:22 } bb2: { @@ -38,7 +38,7 @@ StorageLive(_5); // scope 2 at $DIR/unreachable_diverging.rs:+3:9: +5:10 StorageLive(_6); // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13 _6 = _1; // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13 - switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13 + switchInt(move _6) -> [0: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13 } bb3: { diff --git a/src/test/mir-opt/unreachable_diverging.rs b/tests/mir-opt/unreachable_diverging.rs index bbf28efc7..bbf28efc7 100644 --- a/src/test/mir-opt/unreachable_diverging.rs +++ b/tests/mir-opt/unreachable_diverging.rs diff --git a/src/test/mir-opt/unusual_item_types.E-V-{constant#0}.built.after.mir b/tests/mir-opt/unusual_item_types.E-V-{constant#0}.built.after.mir index 5257491f0..5257491f0 100644 --- a/src/test/mir-opt/unusual_item_types.E-V-{constant#0}.built.after.mir +++ b/tests/mir-opt/unusual_item_types.E-V-{constant#0}.built.after.mir diff --git a/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.built.after.mir b/tests/mir-opt/unusual_item_types.Test-X-{constructor#0}.built.after.mir index ee0296763..ee0296763 100644 --- a/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.built.after.mir +++ b/tests/mir-opt/unusual_item_types.Test-X-{constructor#0}.built.after.mir diff --git a/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir b/tests/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir index ed9f3bdbd..ed9f3bdbd 100644 --- a/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir +++ b/tests/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir diff --git a/src/test/mir-opt/unusual_item_types.rs b/tests/mir-opt/unusual_item_types.rs index 6dad63641..6dad63641 100644 --- a/src/test/mir-opt/unusual_item_types.rs +++ b/tests/mir-opt/unusual_item_types.rs diff --git a/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.built.after.mir b/tests/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.built.after.mir index 90444b481..90444b481 100644 --- a/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.built.after.mir +++ b/tests/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.built.after.mir diff --git a/tests/mir-opt/while_let_loops.change_loop_body.ConstProp.diff b/tests/mir-opt/while_let_loops.change_loop_body.ConstProp.diff new file mode 100644 index 000000000..bb1de59d4 --- /dev/null +++ b/tests/mir-opt/while_let_loops.change_loop_body.ConstProp.diff @@ -0,0 +1,46 @@ +- // MIR for `change_loop_body` before ConstProp ++ // MIR for `change_loop_body` after ConstProp + + fn change_loop_body() -> () { + let mut _0: (); // return place in scope 0 at $DIR/while_let_loops.rs:+0:27: +0:27 + let mut _1: i32; // in scope 0 at $DIR/while_let_loops.rs:+1:9: +1:15 + let mut _2: std::option::Option<u32>; // in scope 0 at $DIR/while_let_loops.rs:+2:28: +2:32 + let mut _3: isize; // in scope 0 at $DIR/while_let_loops.rs:+2:15: +2:25 + scope 1 { + debug _x => _1; // in scope 1 at $DIR/while_let_loops.rs:+1:9: +1:15 + scope 2 { + } + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/while_let_loops.rs:+1:9: +1:15 + _1 = const 0_i32; // scope 0 at $DIR/while_let_loops.rs:+1:18: +1:19 + StorageLive(_2); // scope 2 at $DIR/while_let_loops.rs:+2:28: +2:32 + Deinit(_2); // scope 2 at $DIR/while_let_loops.rs:+2:28: +2:32 + discriminant(_2) = 0; // scope 2 at $DIR/while_let_loops.rs:+2:28: +2:32 +- _3 = discriminant(_2); // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25 +- switchInt(move _3) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25 ++ _3 = const 0_isize; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25 ++ switchInt(const 0_isize) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25 + } + + bb1: { + switchInt(((_2 as Some).0: u32)) -> [0: bb2, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25 + } + + bb2: { + _1 = const 1_i32; // scope 2 at $DIR/while_let_loops.rs:+3:9: +3:15 + goto -> bb4; // scope 2 at $DIR/while_let_loops.rs:+4:9: +4:14 + } + + bb3: { + goto -> bb4; // scope 1 at no-location + } + + bb4: { + StorageDead(_2); // scope 1 at $DIR/while_let_loops.rs:+5:5: +5:6 + StorageDead(_1); // scope 0 at $DIR/while_let_loops.rs:+6:1: +6:2 + return; // scope 0 at $DIR/while_let_loops.rs:+6:2: +6:2 + } + } + diff --git a/src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.mir b/tests/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.mir index 15b0aece8..15b0aece8 100644 --- a/src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.mir +++ b/tests/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.mir diff --git a/src/test/mir-opt/while_let_loops.rs b/tests/mir-opt/while_let_loops.rs index fc56cd698..fc56cd698 100644 --- a/src/test/mir-opt/while_let_loops.rs +++ b/tests/mir-opt/while_let_loops.rs diff --git a/src/test/mir-opt/while_storage.rs b/tests/mir-opt/while_storage.rs index afd083acb..afd083acb 100644 --- a/src/test/mir-opt/while_storage.rs +++ b/tests/mir-opt/while_storage.rs diff --git a/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir b/tests/mir-opt/while_storage.while_loop.PreCodegen.after.mir index 68aa3e5db..b95d91b13 100644 --- a/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir +++ b/tests/mir-opt/while_storage.while_loop.PreCodegen.after.mir @@ -24,7 +24,7 @@ fn while_loop(_1: bool) -> () { bb2: { StorageDead(_3); // scope 0 at $DIR/while_storage.rs:+1:21: +1:22 - switchInt(move _2) -> [false: bb7, otherwise: bb3]; // scope 0 at $DIR/while_storage.rs:+1:11: +1:22 + switchInt(move _2) -> [0: bb7, otherwise: bb3]; // scope 0 at $DIR/while_storage.rs:+1:11: +1:22 } bb3: { @@ -39,12 +39,12 @@ fn while_loop(_1: bool) -> () { bb4: { StorageDead(_5); // scope 0 at $DIR/while_storage.rs:+2:22: +2:23 - switchInt(move _4) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/while_storage.rs:+2:12: +2:23 + switchInt(move _4) -> [0: bb6, otherwise: bb5]; // scope 0 at $DIR/while_storage.rs:+2:12: +2:23 } bb5: { StorageDead(_4); // scope 0 at $DIR/while_storage.rs:+4:9: +4:10 - goto -> bb8; // scope 0 at no-location + goto -> bb7; // scope 0 at no-location } bb6: { @@ -54,10 +54,6 @@ fn while_loop(_1: bool) -> () { } bb7: { - goto -> bb8; // scope 0 at no-location - } - - bb8: { StorageDead(_2); // scope 0 at $DIR/while_storage.rs:+5:5: +5:6 return; // scope 0 at $DIR/while_storage.rs:+6:2: +6:2 } |