From db83fdc46c9d866578de418f17461593f829988c Mon Sep 17 00:00:00 2001 From: Bastian Kauschke Date: Thu, 9 Apr 2020 12:24:53 +0200 Subject: [PATCH 1/3] unit rvalue: use constant `()` instead of tuple --- src/librustc_mir/transform/promote_consts.rs | 6 +++++- src/librustc_mir_build/build/block.rs | 2 +- src/librustc_mir_build/build/cfg.rs | 8 +++++++- src/librustc_mir_build/build/expr/as_rvalue.rs | 6 +++++- src/librustc_mir_build/build/expr/into.rs | 2 +- src/librustc_mir_build/build/misc.rs | 4 ---- src/librustc_mir_build/build/scope.rs | 2 +- 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/librustc_mir/transform/promote_consts.rs b/src/librustc_mir/transform/promote_consts.rs index 9579fe1f405..71c2e3bf060 100644 --- a/src/librustc_mir/transform/promote_consts.rs +++ b/src/librustc_mir/transform/promote_consts.rs @@ -835,7 +835,11 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { if self.keep_original { rhs.clone() } else { - let unit = Rvalue::Aggregate(box AggregateKind::Tuple, vec![]); + let unit = Rvalue::Use(Operand::Constant(box Constant { + span: statement.source_info.span, + user_ty: None, + literal: ty::Const::zero_sized(self.tcx, self.tcx.types.unit), + })); mem::replace(rhs, unit) }, statement.source_info, diff --git a/src/librustc_mir_build/build/block.rs b/src/librustc_mir_build/build/block.rs index 8c41554bc85..4e8d5e04a63 100644 --- a/src/librustc_mir_build/build/block.rs +++ b/src/librustc_mir_build/build/block.rs @@ -187,7 +187,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { if destination_ty.is_unit() { // We only want to assign an implicit `()` as the return value of the block if the // block does not diverge. (Otherwise, we may try to assign a unit to a `!`-type.) - this.cfg.push_assign_unit(block, source_info, destination); + this.cfg.push_assign_unit(block, source_info, destination, this.hir.tcx()); } } // Finally, we pop all the let scopes before exiting out from the scope of block diff --git a/src/librustc_mir_build/build/cfg.rs b/src/librustc_mir_build/build/cfg.rs index f5828c4ac1f..42e2b242d77 100644 --- a/src/librustc_mir_build/build/cfg.rs +++ b/src/librustc_mir_build/build/cfg.rs @@ -2,6 +2,7 @@ use crate::build::CFG; use rustc_middle::mir::*; +use rustc_middle::ty::{self, TyCtxt}; impl<'tcx> CFG<'tcx> { crate fn block_data(&self, blk: BasicBlock) -> &BasicBlockData<'tcx> { @@ -58,12 +59,17 @@ impl<'tcx> CFG<'tcx> { block: BasicBlock, source_info: SourceInfo, place: Place<'tcx>, + tcx: TyCtxt<'tcx>, ) { self.push_assign( block, source_info, place, - Rvalue::Aggregate(box AggregateKind::Tuple, vec![]), + Rvalue::Use(Operand::Constant(box Constant { + span: source_info.span, + user_ty: None, + literal: ty::Const::zero_sized(tcx, tcx.types.unit), + })), ); } diff --git a/src/librustc_mir_build/build/expr/as_rvalue.rs b/src/librustc_mir_build/build/expr/as_rvalue.rs index 20ef763e90c..b6f46aab416 100644 --- a/src/librustc_mir_build/build/expr/as_rvalue.rs +++ b/src/librustc_mir_build/build/expr/as_rvalue.rs @@ -225,7 +225,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } ExprKind::Assign { .. } | ExprKind::AssignOp { .. } => { block = unpack!(this.stmt_expr(block, expr, None)); - block.and(this.unit_rvalue()) + block.and(Rvalue::Use(Operand::Constant(box Constant { + span: expr_span, + user_ty: None, + literal: ty::Const::zero_sized(this.hir.tcx(), this.hir.tcx().types.unit), + }))) } ExprKind::Yield { .. } | ExprKind::Literal { .. } diff --git a/src/librustc_mir_build/build/expr/into.rs b/src/librustc_mir_build/build/expr/into.rs index 6b93755e9da..cd5bb738aed 100644 --- a/src/librustc_mir_build/build/expr/into.rs +++ b/src/librustc_mir_build/build/expr/into.rs @@ -331,7 +331,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { | ExprKind::LlvmInlineAsm { .. } | ExprKind::Return { .. } => { unpack!(block = this.stmt_expr(block, expr, None)); - this.cfg.push_assign_unit(block, source_info, destination); + this.cfg.push_assign_unit(block, source_info, destination, this.hir.tcx()); block.unit() } diff --git a/src/librustc_mir_build/build/misc.rs b/src/librustc_mir_build/build/misc.rs index 8f98dd9b70e..578b862b905 100644 --- a/src/librustc_mir_build/build/misc.rs +++ b/src/librustc_mir_build/build/misc.rs @@ -32,10 +32,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { Operand::Constant(constant) } - crate fn unit_rvalue(&mut self) -> Rvalue<'tcx> { - Rvalue::Aggregate(box AggregateKind::Tuple, vec![]) - } - // Returns a zero literal operand for the appropriate type, works for // bool, char and integers. crate fn zero_literal(&mut self, span: Span, ty: Ty<'tcx>) -> Operand<'tcx> { diff --git a/src/librustc_mir_build/build/scope.rs b/src/librustc_mir_build/build/scope.rs index 3689e5cb9d8..d88cbf94513 100644 --- a/src/librustc_mir_build/build/scope.rs +++ b/src/librustc_mir_build/build/scope.rs @@ -523,7 +523,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { unpack!(block = self.into(destination, block, value)); self.block_context.pop(); } else { - self.cfg.push_assign_unit(block, source_info, destination) + self.cfg.push_assign_unit(block, source_info, destination, self.hir.tcx()) } } else { assert!(value.is_none(), "`return` and `break` should have a destination"); From 4714e202ae828f4da28c003433b2501006657082 Mon Sep 17 00:00:00 2001 From: Bastian Kauschke Date: Thu, 9 Apr 2020 12:58:36 +0200 Subject: [PATCH 2/3] bless mir opt tests --- ..._of_reborrow.SimplifyCfg-initial.after.mir | 8 ++- ...row_and_cast.SimplifyCfg-initial.after.mir | 8 ++- ...main.SimplifyCfg-elaborate-drops.after.mir | 8 ++- .../rustc.main.SimplifyCfg-initial.after.mir | 8 ++- .../rustc.main.ElaborateDrops.before.mir | 8 ++- ...main.SimplifyCfg-elaborate-drops.after.mir | 8 ++- .../64bit/rustc.main.ConstProp.after.mir | 8 ++- .../64bit/rustc.main.ConstProp.after.mir | 8 ++- .../64bit/rustc.main.ConstProp.after.mir | 8 ++- .../aggregate/rustc.main.ConstProp.diff | 8 ++- .../64bit/rustc.main.ConstProp.diff | 8 ++- .../boxes/rustc.main.ConstProp.diff | 8 ++- .../const_prop/cast/rustc.main.ConstProp.diff | 8 ++- .../checked_add/rustc.main.ConstProp.diff | 8 ++- .../rustc.main.ConstProp.diff | 8 ++- .../rustc.hello.ConstProp.diff | 8 ++- .../rustc.hello.PreCodegen.before.mir | 9 +++- .../64bit/rustc.main.ConstProp.diff | 8 ++- .../indirect/rustc.main.ConstProp.diff | 8 ++- .../issue-66971/rustc.main.ConstProp.diff | 8 ++- .../issue-67019/rustc.main.ConstProp.diff | 8 ++- .../64bit/rustc.main.ConstProp.diff | 8 ++- .../64bit/rustc.main.SimplifyLocals.after.mir | 15 ++++-- .../rustc.main.ConstProp.diff | 8 ++- .../ref_deref/rustc.main.ConstProp.diff | 8 ++- .../ref_deref/rustc.main.PromoteTemps.diff | 12 +++-- .../rustc.main.ConstProp.diff | 8 ++- .../rustc.main.PromoteTemps.diff | 24 +++++---- .../reify_fn_ptr/rustc.main.ConstProp.diff | 8 ++- .../repeat/64bit/rustc.main.ConstProp.diff | 8 ++- .../slice_len/64bit/rustc.main.ConstProp.diff | 8 ++- .../rustc.bar.CopyPropagation.diff | 8 ++- .../rustc.baz.CopyPropagation.diff | 8 ++- .../rustc.foo.CopyPropagation.diff | 8 ++- ...main-{{closure}}.StateTransform.before.mir | 8 ++- ...tc.main-{{closure}}.generator_resume.0.mir | 8 ++- .../mir-opt/graphviz/rustc.main.mir_map.0.dot | 2 +- .../64bit/rustc.main.Inline.diff | 39 +++++++++------ .../rustc.main.Inline.diff | 14 ++++-- .../rustc.main.SimplifyCfg-initial.after.mir | 24 +++++++-- .../rustc.main.ElaborateDrops.after.mir | 8 ++- .../rustc.test.ElaborateDrops.after.mir | 8 ++- .../rustc.main.ElaborateDrops.after.mir | 24 +++++++-- .../issue-49232/rustc.main.mir_map.0.mir | 24 +++++++-- ....main.SimplifyCfg-qualify-consts.after.mir | 16 +++++- ...c.full_tested_match.PromoteTemps.after.mir | 8 ++- ...full_tested_match2.PromoteTemps.before.mir | 8 ++- .../rustc.main.PromoteTemps.before.mir | 8 ++- .../rustc.main.SimplifyCfg-initial.after.mir | 8 ++- .../64bit/rustc.main.nll.0.mir | 16 +++++- .../rustc.main.ElaborateDrops.before.mir | 8 ++- ...main.SimplifyCfg-elaborate-drops.after.mir | 8 ++- ...main.SimplifyCfg-elaborate-drops.after.mir | 16 +++++- .../rustc.main.SimplifyArmIdentity.diff | 11 +++- .../rustc.main.SimplifyLocals.diff | 12 ++++- .../rustc.main.SimplifyCfg-early-opt.diff | 36 ++++++++----- .../rustc.main.SimplifyCfg-initial.diff | 24 ++++++--- ...ain.SimplifyBranches-after-const-prop.diff | 16 +++++- ...main.SimplifyBranches-after-copy-prop.diff | 8 ++- .../storage_ranges/rustc.main.nll.0.mir | 16 +++++- .../rustc.move_out_by_subslice.mir_map.0.mir | 8 ++- .../rustc.move_out_from_end.mir_map.0.mir | 8 ++- ...ustc.process_void.SimplifyLocals.after.mir | 11 +++- ...after-uninhabited-enum-branching.after.mir | 8 ++- .../rustc.main.UninhabitedEnumBranching.diff | 8 ++- .../rustc.main.UnreachablePropagation.diff | 24 +++++++-- .../rustc.main.UnreachablePropagation.diff | 32 ++++++++++-- .../rustc.main.UnreachablePropagation.diff | 40 +++++++++++++-- .../rustc.main.UnreachablePropagation.diff | 20 ++++++-- .../rustc.while_loop.PreCodegen.after.mir | 50 +++++++++++++------ 70 files changed, 730 insertions(+), 157 deletions(-) diff --git a/src/test/mir-opt/address-of/rustc.address_of_reborrow.SimplifyCfg-initial.after.mir b/src/test/mir-opt/address-of/rustc.address_of_reborrow.SimplifyCfg-initial.after.mir index af07da4cfe0..d0b5c401bea 100644 --- a/src/test/mir-opt/address-of/rustc.address_of_reborrow.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/address-of/rustc.address_of_reborrow.SimplifyCfg-initial.after.mir @@ -298,7 +298,13 @@ fn address_of_reborrow() -> () { StorageDead(_48); // bb0[157]: scope 13 at $DIR/address-of.rs:36:25: 36:26 FakeRead(ForLet, _47); // bb0[158]: scope 13 at $DIR/address-of.rs:36:9: 36:10 AscribeUserType(_47, o, UserTypeProjection { base: UserType(29), projs: [] }); // bb0[159]: scope 13 at $DIR/address-of.rs:36:12: 36:22 - _0 = (); // bb0[160]: scope 0 at $DIR/address-of.rs:3:26: 37:2 + _0 = const (); // bb0[160]: scope 0 at $DIR/address-of.rs:3:26: 37:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/address-of.rs:3:26: 37:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_47); // bb0[161]: scope 13 at $DIR/address-of.rs:37:1: 37:2 StorageDead(_45); // bb0[162]: scope 12 at $DIR/address-of.rs:37:1: 37:2 StorageDead(_44); // bb0[163]: scope 11 at $DIR/address-of.rs:37:1: 37:2 diff --git a/src/test/mir-opt/address-of/rustc.borrow_and_cast.SimplifyCfg-initial.after.mir b/src/test/mir-opt/address-of/rustc.borrow_and_cast.SimplifyCfg-initial.after.mir index 29ccff49202..0ed76f230fd 100644 --- a/src/test/mir-opt/address-of/rustc.borrow_and_cast.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/address-of/rustc.borrow_and_cast.SimplifyCfg-initial.after.mir @@ -38,7 +38,13 @@ fn borrow_and_cast(_1: i32) -> () { _6 = &raw mut (*_7); // bb0[15]: scope 2 at $DIR/address-of.rs:44:13: 44:19 FakeRead(ForLet, _6); // bb0[16]: scope 2 at $DIR/address-of.rs:44:9: 44:10 StorageDead(_7); // bb0[17]: scope 2 at $DIR/address-of.rs:44:31: 44:32 - _0 = (); // bb0[18]: scope 0 at $DIR/address-of.rs:41:32: 45:2 + _0 = const (); // bb0[18]: scope 0 at $DIR/address-of.rs:41:32: 45:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/address-of.rs:41:32: 45:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_6); // bb0[19]: scope 2 at $DIR/address-of.rs:45:1: 45:2 StorageDead(_4); // bb0[20]: scope 1 at $DIR/address-of.rs:45:1: 45:2 StorageDead(_2); // bb0[21]: scope 0 at $DIR/address-of.rs:45:1: 45:2 diff --git a/src/test/mir-opt/array-index-is-temporary/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/array-index-is-temporary/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir index a004ab4a06a..c75acef2a27 100644 --- a/src/test/mir-opt/array-index-is-temporary/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/array-index-is-temporary/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir @@ -82,7 +82,13 @@ fn main() -> () { _1[_7] = move _5; // bb2[0]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:29 StorageDead(_5); // bb2[1]: scope 3 at $DIR/array-index-is-temporary.rs:16:28: 16:29 StorageDead(_7); // bb2[2]: scope 3 at $DIR/array-index-is-temporary.rs:16:29: 16:30 - _0 = (); // bb2[3]: scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2 + _0 = const (); // bb2[3]: scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/array-index-is-temporary.rs:12:11: 17:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_3); // bb2[4]: scope 2 at $DIR/array-index-is-temporary.rs:17:1: 17:2 StorageDead(_2); // bb2[5]: scope 1 at $DIR/array-index-is-temporary.rs:17:1: 17:2 StorageDead(_1); // bb2[6]: scope 0 at $DIR/array-index-is-temporary.rs:17:1: 17:2 diff --git a/src/test/mir-opt/basic_assignment/rustc.main.SimplifyCfg-initial.after.mir b/src/test/mir-opt/basic_assignment/rustc.main.SimplifyCfg-initial.after.mir index a3f4573964c..86ee1be6f74 100644 --- a/src/test/mir-opt/basic_assignment/rustc.main.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/basic_assignment/rustc.main.SimplifyCfg-initial.after.mir @@ -72,7 +72,13 @@ fn main() -> () { bb6: { StorageDead(_6); // bb6[0]: scope 4 at $DIR/basic_assignment.rs:23:19: 23:20 - _0 = (); // bb6[1]: scope 0 at $DIR/basic_assignment.rs:10:11: 24:2 + _0 = const (); // bb6[1]: scope 0 at $DIR/basic_assignment.rs:10:11: 24:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/basic_assignment.rs:10:11: 24:2 + // + literal: Const { ty: (), val: Value(Scalar()) } drop(_5) -> [return: bb7, unwind: bb3]; // bb6[2]: scope 3 at $DIR/basic_assignment.rs:24:1: 24:2 } diff --git a/src/test/mir-opt/box_expr/rustc.main.ElaborateDrops.before.mir b/src/test/mir-opt/box_expr/rustc.main.ElaborateDrops.before.mir index 61986535dd3..aef0da9d6f0 100644 --- a/src/test/mir-opt/box_expr/rustc.main.ElaborateDrops.before.mir +++ b/src/test/mir-opt/box_expr/rustc.main.ElaborateDrops.before.mir @@ -53,7 +53,13 @@ fn main() -> () { bb5: { StorageDead(_4); // bb5[0]: scope 1 at $DIR/box_expr.rs:8:11: 8:12 StorageDead(_3); // bb5[1]: scope 1 at $DIR/box_expr.rs:8:12: 8:13 - _0 = (); // bb5[2]: scope 0 at $DIR/box_expr.rs:6:11: 9:2 + _0 = const (); // bb5[2]: scope 0 at $DIR/box_expr.rs:6:11: 9:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/box_expr.rs:6:11: 9:2 + // + literal: Const { ty: (), val: Value(Scalar()) } drop(_1) -> bb8; // bb5[3]: scope 0 at $DIR/box_expr.rs:9:1: 9:2 } diff --git a/src/test/mir-opt/byte_slice/rustc.main.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/byte_slice/rustc.main.SimplifyCfg-elaborate-drops.after.mir index 14be9c990bd..84f4e5bfd63 100644 --- a/src/test/mir-opt/byte_slice/rustc.main.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/byte_slice/rustc.main.SimplifyCfg-elaborate-drops.after.mir @@ -34,7 +34,13 @@ fn main() -> () { // mir::Constant // + span: $DIR/byte_slice.rs:6:19: 6:23 // + literal: Const { ty: u8, val: Value(Scalar(0x78)) } - _0 = (); // bb0[4]: scope 0 at $DIR/byte_slice.rs:4:11: 7:2 + _0 = const (); // bb0[4]: scope 0 at $DIR/byte_slice.rs:4:11: 7:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/byte_slice.rs:4:11: 7:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_2); // bb0[5]: scope 1 at $DIR/byte_slice.rs:7:1: 7:2 StorageDead(_1); // bb0[6]: scope 0 at $DIR/byte_slice.rs:7:1: 7:2 return; // bb0[7]: scope 0 at $DIR/byte_slice.rs:7:2: 7:2 diff --git a/src/test/mir-opt/const_allocation/64bit/rustc.main.ConstProp.after.mir b/src/test/mir-opt/const_allocation/64bit/rustc.main.ConstProp.after.mir index b60d23aa3f1..d6cca185ab0 100644 --- a/src/test/mir-opt/const_allocation/64bit/rustc.main.ConstProp.after.mir +++ b/src/test/mir-opt/const_allocation/64bit/rustc.main.ConstProp.after.mir @@ -18,7 +18,13 @@ fn main() -> () { _1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8 StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9 StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9 - _0 = (); // bb0[6]: scope 0 at $DIR/const_allocation.rs:7:11: 9:2 + _0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation.rs:7:11: 9:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/const_allocation.rs:7:11: 9:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb0[7]: scope 0 at $DIR/const_allocation.rs:9:2: 9:2 } } diff --git a/src/test/mir-opt/const_allocation2/64bit/rustc.main.ConstProp.after.mir b/src/test/mir-opt/const_allocation2/64bit/rustc.main.ConstProp.after.mir index 52e7c2aec2b..e61f0a8b69f 100644 --- a/src/test/mir-opt/const_allocation2/64bit/rustc.main.ConstProp.after.mir +++ b/src/test/mir-opt/const_allocation2/64bit/rustc.main.ConstProp.after.mir @@ -18,7 +18,13 @@ fn main() -> () { _1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8 StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9 StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9 - _0 = (); // bb0[6]: scope 0 at $DIR/const_allocation2.rs:4:11: 6:2 + _0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation2.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/const_allocation2.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb0[7]: scope 0 at $DIR/const_allocation2.rs:6:2: 6:2 } } diff --git a/src/test/mir-opt/const_allocation3/64bit/rustc.main.ConstProp.after.mir b/src/test/mir-opt/const_allocation3/64bit/rustc.main.ConstProp.after.mir index ae5ebe70437..952fe8336cd 100644 --- a/src/test/mir-opt/const_allocation3/64bit/rustc.main.ConstProp.after.mir +++ b/src/test/mir-opt/const_allocation3/64bit/rustc.main.ConstProp.after.mir @@ -18,7 +18,13 @@ fn main() -> () { _1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8 StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9 StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9 - _0 = (); // bb0[6]: scope 0 at $DIR/const_allocation3.rs:4:11: 6:2 + _0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation3.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/const_allocation3.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb0[7]: scope 0 at $DIR/const_allocation3.rs:6:2: 6:2 } } diff --git a/src/test/mir-opt/const_prop/aggregate/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/aggregate/rustc.main.ConstProp.diff index d20019287b0..50e6cfc37ee 100644 --- a/src/test/mir-opt/const_prop/aggregate/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/aggregate/rustc.main.ConstProp.diff @@ -54,7 +54,13 @@ + // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) } StorageDead(_2); // bb0[6]: scope 0 at $DIR/aggregate.rs:5:27: 5:28 StorageDead(_3); // bb0[7]: scope 0 at $DIR/aggregate.rs:5:28: 5:29 - _0 = (); // bb0[8]: scope 0 at $DIR/aggregate.rs:4:11: 6:2 + _0 = const (); // bb0[8]: scope 0 at $DIR/aggregate.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/aggregate.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb0[9]: scope 0 at $DIR/aggregate.rs:6:1: 6:2 return; // bb0[10]: scope 0 at $DIR/aggregate.rs:6:2: 6:2 } diff --git a/src/test/mir-opt/const_prop/array_index/64bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/array_index/64bit/rustc.main.ConstProp.diff index 629ca226f2a..b3d353bd487 100644 --- a/src/test/mir-opt/const_prop/array_index/64bit/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/array_index/64bit/rustc.main.ConstProp.diff @@ -84,7 +84,13 @@ + // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) } StorageDead(_3); // bb1[1]: scope 0 at $DIR/array_index.rs:5:33: 5:34 StorageDead(_2); // bb1[2]: scope 0 at $DIR/array_index.rs:5:33: 5:34 - _0 = (); // bb1[3]: scope 0 at $DIR/array_index.rs:4:11: 6:2 + _0 = const (); // bb1[3]: scope 0 at $DIR/array_index.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/array_index.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb1[4]: scope 0 at $DIR/array_index.rs:6:1: 6:2 return; // bb1[5]: scope 0 at $DIR/array_index.rs:6:2: 6:2 } diff --git a/src/test/mir-opt/const_prop/boxes/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/boxes/rustc.main.ConstProp.diff index 50ee2abecfe..bf5aff0cf46 100644 --- a/src/test/mir-opt/const_prop/boxes/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/boxes/rustc.main.ConstProp.diff @@ -44,7 +44,13 @@ bb2: { StorageDead(_3); // bb2[0]: scope 0 at $DIR/boxes.rs:12:26: 12:27 - _0 = (); // bb2[1]: scope 0 at $DIR/boxes.rs:11:11: 13:2 + _0 = const (); // bb2[1]: scope 0 at $DIR/boxes.rs:11:11: 13:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/boxes.rs:11:11: 13:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb2[2]: scope 0 at $DIR/boxes.rs:13:1: 13:2 return; // bb2[3]: scope 0 at $DIR/boxes.rs:13:2: 13:2 } diff --git a/src/test/mir-opt/const_prop/cast/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/cast/rustc.main.ConstProp.diff index ee6a0e87b12..ca0a309b1b5 100644 --- a/src/test/mir-opt/const_prop/cast/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/cast/rustc.main.ConstProp.diff @@ -39,7 +39,13 @@ + // mir::Constant + // + span: $DIR/cast.rs:6:13: 6:24 + // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) } - _0 = (); // bb0[4]: scope 0 at $DIR/cast.rs:3:11: 7:2 + _0 = const (); // bb0[4]: scope 0 at $DIR/cast.rs:3:11: 7:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/cast.rs:3:11: 7:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_2); // bb0[5]: scope 1 at $DIR/cast.rs:7:1: 7:2 StorageDead(_1); // bb0[6]: scope 0 at $DIR/cast.rs:7:1: 7:2 return; // bb0[7]: scope 0 at $DIR/cast.rs:7:2: 7:2 diff --git a/src/test/mir-opt/const_prop/checked_add/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/checked_add/rustc.main.ConstProp.diff index 0a0a4ff852f..762927575f0 100644 --- a/src/test/mir-opt/const_prop/checked_add/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/checked_add/rustc.main.ConstProp.diff @@ -51,7 +51,13 @@ + // mir::Constant + // + span: $DIR/checked_add.rs:5:18: 5:23 + // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) } - _0 = (); // bb1[1]: scope 0 at $DIR/checked_add.rs:4:11: 6:2 + _0 = const (); // bb1[1]: scope 0 at $DIR/checked_add.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/checked_add.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb1[2]: scope 0 at $DIR/checked_add.rs:6:1: 6:2 return; // bb1[3]: scope 0 at $DIR/checked_add.rs:6:2: 6:2 } diff --git a/src/test/mir-opt/const_prop/const_prop_fails_gracefully/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/const_prop_fails_gracefully/rustc.main.ConstProp.diff index f4a5b64f0d9..d3a6105a852 100644 --- a/src/test/mir-opt/const_prop/const_prop_fails_gracefully/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/const_prop_fails_gracefully/rustc.main.ConstProp.diff @@ -42,7 +42,13 @@ bb1: { StorageDead(_5); // bb1[0]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:11: 8:12 StorageDead(_4); // bb1[1]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:12: 8:13 - _0 = (); // bb1[2]: scope 0 at $DIR/const_prop_fails_gracefully.rs:5:11: 9:2 + _0 = const (); // bb1[2]: scope 0 at $DIR/const_prop_fails_gracefully.rs:5:11: 9:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/const_prop_fails_gracefully.rs:5:11: 9:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb1[3]: scope 0 at $DIR/const_prop_fails_gracefully.rs:9:1: 9:2 return; // bb1[4]: scope 0 at $DIR/const_prop_fails_gracefully.rs:9:2: 9:2 } diff --git a/src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.ConstProp.diff b/src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.ConstProp.diff index c551bd77d40..cbda5e4ef86 100644 --- a/src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.ConstProp.diff +++ b/src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.ConstProp.diff @@ -29,7 +29,13 @@ } bb1: { - _0 = (); // bb1[0]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 + _0 = const (); // bb1[0]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/control-flow-simplification.rs:12:5: 14:6 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb1[1]: scope 0 at $DIR/control-flow-simplification.rs:15:1: 15:2 return; // bb1[2]: scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2 } diff --git a/src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.PreCodegen.before.mir b/src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.PreCodegen.before.mir index 53296f8714b..73922b56669 100644 --- a/src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.PreCodegen.before.mir +++ b/src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.PreCodegen.before.mir @@ -4,6 +4,13 @@ fn hello() -> () { let mut _0: (); // return place in scope 0 at $DIR/control-flow-simplification.rs:11:14: 11:14 bb0: { - return; // bb0[0]: scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2 + _0 = const (); // bb0[0]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/control-flow-simplification.rs:12:5: 14:6 + // + literal: Const { ty: (), val: Value(Scalar()) } + return; // bb0[1]: scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2 } } diff --git a/src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff index 60d18cdc942..06f43db50f4 100644 --- a/src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff @@ -87,7 +87,13 @@ // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) } StorageDead(_2); // bb4[1]: scope 0 at $DIR/discriminant.rs:6:67: 6:68 StorageDead(_3); // bb4[2]: scope 0 at $DIR/discriminant.rs:6:68: 6:69 - _0 = (); // bb4[3]: scope 0 at $DIR/discriminant.rs:5:11: 7:2 + _0 = const (); // bb4[3]: scope 0 at $DIR/discriminant.rs:5:11: 7:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/discriminant.rs:5:11: 7:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb4[4]: scope 0 at $DIR/discriminant.rs:7:1: 7:2 return; // bb4[5]: scope 0 at $DIR/discriminant.rs:7:2: 7:2 } diff --git a/src/test/mir-opt/const_prop/indirect/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/indirect/rustc.main.ConstProp.diff index ca3e3bb5d2d..4c80d0d1278 100644 --- a/src/test/mir-opt/const_prop/indirect/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/indirect/rustc.main.ConstProp.diff @@ -62,7 +62,13 @@ + // + span: $DIR/indirect.rs:5:13: 5:29 + // + literal: Const { ty: u8, val: Value(Scalar(0x03)) } StorageDead(_2); // bb1[1]: scope 0 at $DIR/indirect.rs:5:28: 5:29 - _0 = (); // bb1[2]: scope 0 at $DIR/indirect.rs:4:11: 6:2 + _0 = const (); // bb1[2]: scope 0 at $DIR/indirect.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/indirect.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb1[3]: scope 0 at $DIR/indirect.rs:6:1: 6:2 return; // bb1[4]: scope 0 at $DIR/indirect.rs:6:2: 6:2 } diff --git a/src/test/mir-opt/const_prop/issue-66971/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/issue-66971/rustc.main.ConstProp.diff index d3ebaa0a632..76c6759f700 100644 --- a/src/test/mir-opt/const_prop/issue-66971/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/issue-66971/rustc.main.ConstProp.diff @@ -45,7 +45,13 @@ bb1: { StorageDead(_2); // bb1[0]: scope 0 at $DIR/issue-66971.rs:16:22: 16:23 StorageDead(_1); // bb1[1]: scope 0 at $DIR/issue-66971.rs:16:23: 16:24 - _0 = (); // bb1[2]: scope 0 at $DIR/issue-66971.rs:15:11: 17:2 + _0 = const (); // bb1[2]: scope 0 at $DIR/issue-66971.rs:15:11: 17:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/issue-66971.rs:15:11: 17:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb1[3]: scope 0 at $DIR/issue-66971.rs:17:2: 17:2 } } diff --git a/src/test/mir-opt/const_prop/issue-67019/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/issue-67019/rustc.main.ConstProp.diff index 96a20edd91a..05e1a615953 100644 --- a/src/test/mir-opt/const_prop/issue-67019/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/issue-67019/rustc.main.ConstProp.diff @@ -40,7 +40,13 @@ bb1: { StorageDead(_2); // bb1[0]: scope 0 at $DIR/issue-67019.rs:11:19: 11:20 StorageDead(_1); // bb1[1]: scope 0 at $DIR/issue-67019.rs:11:20: 11:21 - _0 = (); // bb1[2]: scope 0 at $DIR/issue-67019.rs:10:11: 12:2 + _0 = const (); // bb1[2]: scope 0 at $DIR/issue-67019.rs:10:11: 12:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/issue-67019.rs:10:11: 12:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb1[3]: scope 0 at $DIR/issue-67019.rs:12:2: 12:2 } } diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable/64bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/optimizes_into_variable/64bit/rustc.main.ConstProp.diff index fd3281f5273..0097d9448c8 100644 --- a/src/test/mir-opt/const_prop/optimizes_into_variable/64bit/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/optimizes_into_variable/64bit/rustc.main.ConstProp.diff @@ -171,7 +171,13 @@ + // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38 + // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) } StorageDead(_9); // bb2[7]: scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39 - _0 = (); // bb2[8]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2 + _0 = const (); // bb2[8]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/optimizes_into_variable.rs:11:11: 15:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_8); // bb2[9]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2 StorageDead(_3); // bb2[10]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2 StorageDead(_1); // bb2[11]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2 diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable/64bit/rustc.main.SimplifyLocals.after.mir b/src/test/mir-opt/const_prop/optimizes_into_variable/64bit/rustc.main.SimplifyLocals.after.mir index db4d2d13792..5e2a8af060b 100644 --- a/src/test/mir-opt/const_prop/optimizes_into_variable/64bit/rustc.main.SimplifyLocals.after.mir +++ b/src/test/mir-opt/const_prop/optimizes_into_variable/64bit/rustc.main.SimplifyLocals.after.mir @@ -80,9 +80,16 @@ fn main() -> () { // mir::Constant // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38 // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) } - StorageDead(_4); // bb0[9]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2 - StorageDead(_2); // bb0[10]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2 - StorageDead(_1); // bb0[11]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2 - return; // bb0[12]: scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2 + _0 = const (); // bb0[9]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/optimizes_into_variable.rs:11:11: 15:2 + // + literal: Const { ty: (), val: Value(Scalar()) } + StorageDead(_4); // bb0[10]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2 + StorageDead(_2); // bb0[11]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2 + StorageDead(_1); // bb0[12]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2 + return; // bb0[13]: scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2 } } diff --git a/src/test/mir-opt/const_prop/read_immutable_static/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/read_immutable_static/rustc.main.ConstProp.diff index 6183b22a95f..d9852539844 100644 --- a/src/test/mir-opt/const_prop/read_immutable_static/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/read_immutable_static/rustc.main.ConstProp.diff @@ -60,7 +60,13 @@ StorageDead(_2); // bb0[11]: scope 0 at $DIR/read_immutable_static.rs:7:21: 7:22 StorageDead(_5); // bb0[12]: scope 0 at $DIR/read_immutable_static.rs:7:22: 7:23 StorageDead(_3); // bb0[13]: scope 0 at $DIR/read_immutable_static.rs:7:22: 7:23 - _0 = (); // bb0[14]: scope 0 at $DIR/read_immutable_static.rs:6:11: 8:2 + _0 = const (); // bb0[14]: scope 0 at $DIR/read_immutable_static.rs:6:11: 8:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/read_immutable_static.rs:6:11: 8:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb0[15]: scope 0 at $DIR/read_immutable_static.rs:8:1: 8:2 return; // bb0[16]: scope 0 at $DIR/read_immutable_static.rs:8:2: 8:2 } diff --git a/src/test/mir-opt/const_prop/ref_deref/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/ref_deref/rustc.main.ConstProp.diff index 0f8563daba5..591fdaddfcc 100644 --- a/src/test/mir-opt/const_prop/ref_deref/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/ref_deref/rustc.main.ConstProp.diff @@ -29,7 +29,13 @@ + // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) } StorageDead(_2); // bb0[5]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11 StorageDead(_1); // bb0[6]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11 - _0 = (); // bb0[7]: scope 0 at $DIR/ref_deref.rs:4:11: 6:2 + _0 = const (); // bb0[7]: scope 0 at $DIR/ref_deref.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/ref_deref.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb0[8]: scope 0 at $DIR/ref_deref.rs:6:2: 6:2 } } diff --git a/src/test/mir-opt/const_prop/ref_deref/rustc.main.PromoteTemps.diff b/src/test/mir-opt/const_prop/ref_deref/rustc.main.PromoteTemps.diff index ea1baa40f7e..5cd9f43a5c6 100644 --- a/src/test/mir-opt/const_prop/ref_deref/rustc.main.PromoteTemps.diff +++ b/src/test/mir-opt/const_prop/ref_deref/rustc.main.PromoteTemps.diff @@ -27,15 +27,21 @@ - StorageDead(_3); // bb0[6]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11 - StorageDead(_2); // bb0[7]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11 - StorageDead(_1); // bb0[8]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11 -- _0 = (); // bb0[9]: scope 0 at $DIR/ref_deref.rs:4:11: 6:2 -- return; // bb0[10]: scope 0 at $DIR/ref_deref.rs:6:2: 6:2 +- _0 = const (); // bb0[9]: scope 0 at $DIR/ref_deref.rs:4:11: 6:2 + // + span: $DIR/ref_deref.rs:5:6: 5:10 + // + literal: Const { ty: &i32, val: Unevaluated(DefId(0:3 ~ ref_deref[317d]::main[0]), [], Some(promoted[0])) } + _2 = &(*_4); // bb0[3]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10 + _1 = (*_2); // bb0[4]: scope 0 at $DIR/ref_deref.rs:5:5: 5:10 + StorageDead(_2); // bb0[5]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11 + StorageDead(_1); // bb0[6]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11 -+ _0 = (); // bb0[7]: scope 0 at $DIR/ref_deref.rs:4:11: 6:2 ++ _0 = const (); // bb0[7]: scope 0 at $DIR/ref_deref.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/ref_deref.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } +- return; // bb0[10]: scope 0 at $DIR/ref_deref.rs:6:2: 6:2 + return; // bb0[8]: scope 0 at $DIR/ref_deref.rs:6:2: 6:2 } } diff --git a/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.ConstProp.diff index c4b3d6b6c27..6393bad2993 100644 --- a/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.ConstProp.diff @@ -22,7 +22,13 @@ _1 = (*_2); // bb0[4]: scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17 StorageDead(_2); // bb0[5]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18 StorageDead(_1); // bb0[6]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18 - _0 = (); // bb0[7]: scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2 + _0 = const (); // bb0[7]: scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/ref_deref_project.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb0[8]: scope 0 at $DIR/ref_deref_project.rs:6:2: 6:2 } } diff --git a/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.PromoteTemps.diff b/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.PromoteTemps.diff index 852436e13b6..020ad7278c0 100644 --- a/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.PromoteTemps.diff +++ b/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.PromoteTemps.diff @@ -22,7 +22,14 @@ // mir::Constant - // + span: $DIR/ref_deref_project.rs:5:9: 5:10 - // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) } -- // ty::Const ++ // + span: $DIR/ref_deref_project.rs:5:6: 5:17 ++ // + literal: Const { ty: &(i32, i32), val: Unevaluated(DefId(0:3 ~ ref_deref_project[317d]::main[0]), [], Some(promoted[0])) } ++ _2 = &((*_4).1: i32); // bb0[3]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17 ++ _1 = (*_2); // bb0[4]: scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17 ++ StorageDead(_2); // bb0[5]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18 ++ StorageDead(_1); // bb0[6]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18 ++ _0 = const (); // bb0[7]: scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2 + // ty::Const - // + ty: i32 - // + val: Value(Scalar(0x00000005)) - // mir::Constant @@ -33,15 +40,14 @@ - StorageDead(_3); // bb0[6]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18 - StorageDead(_2); // bb0[7]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18 - StorageDead(_1); // bb0[8]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18 -- _0 = (); // bb0[9]: scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2 +- _0 = const (); // bb0[9]: scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2 +- // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/ref_deref_project.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } - return; // bb0[10]: scope 0 at $DIR/ref_deref_project.rs:6:2: 6:2 -+ // + span: $DIR/ref_deref_project.rs:5:6: 5:17 -+ // + literal: Const { ty: &(i32, i32), val: Unevaluated(DefId(0:3 ~ ref_deref_project[317d]::main[0]), [], Some(promoted[0])) } -+ _2 = &((*_4).1: i32); // bb0[3]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17 -+ _1 = (*_2); // bb0[4]: scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17 -+ StorageDead(_2); // bb0[5]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18 -+ StorageDead(_1); // bb0[6]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18 -+ _0 = (); // bb0[7]: scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2 + return; // bb0[8]: scope 0 at $DIR/ref_deref_project.rs:6:2: 6:2 } } diff --git a/src/test/mir-opt/const_prop/reify_fn_ptr/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/reify_fn_ptr/rustc.main.ConstProp.diff index 7a41a8ad74e..388ebe08689 100644 --- a/src/test/mir-opt/const_prop/reify_fn_ptr/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/reify_fn_ptr/rustc.main.ConstProp.diff @@ -25,7 +25,13 @@ _1 = move _2 as *const fn() (Misc); // bb0[6]: scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:41 StorageDead(_2); // bb0[7]: scope 0 at $DIR/reify_fn_ptr.rs:4:40: 4:41 StorageDead(_1); // bb0[8]: scope 0 at $DIR/reify_fn_ptr.rs:4:41: 4:42 - _0 = (); // bb0[9]: scope 0 at $DIR/reify_fn_ptr.rs:3:11: 5:2 + _0 = const (); // bb0[9]: scope 0 at $DIR/reify_fn_ptr.rs:3:11: 5:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/reify_fn_ptr.rs:3:11: 5:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb0[10]: scope 0 at $DIR/reify_fn_ptr.rs:5:2: 5:2 } } diff --git a/src/test/mir-opt/const_prop/repeat/64bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/repeat/64bit/rustc.main.ConstProp.diff index cb84ee82cfe..361ee493378 100644 --- a/src/test/mir-opt/const_prop/repeat/64bit/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/repeat/64bit/rustc.main.ConstProp.diff @@ -80,7 +80,13 @@ StorageDead(_2); // bb1[2]: scope 0 at $DIR/repeat.rs:6:31: 6:32 StorageDead(_4); // bb1[3]: scope 0 at $DIR/repeat.rs:6:32: 6:33 StorageDead(_3); // bb1[4]: scope 0 at $DIR/repeat.rs:6:32: 6:33 - _0 = (); // bb1[5]: scope 0 at $DIR/repeat.rs:5:11: 7:2 + _0 = const (); // bb1[5]: scope 0 at $DIR/repeat.rs:5:11: 7:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/repeat.rs:5:11: 7:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb1[6]: scope 0 at $DIR/repeat.rs:7:1: 7:2 return; // bb1[7]: scope 0 at $DIR/repeat.rs:7:2: 7:2 } diff --git a/src/test/mir-opt/const_prop/slice_len/64bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/slice_len/64bit/rustc.main.ConstProp.diff index 3c4415e0558..f1379446d7a 100644 --- a/src/test/mir-opt/const_prop/slice_len/64bit/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/slice_len/64bit/rustc.main.ConstProp.diff @@ -76,7 +76,13 @@ StorageDead(_4); // bb1[2]: scope 0 at $DIR/slice_len.rs:5:33: 5:34 StorageDead(_2); // bb1[3]: scope 0 at $DIR/slice_len.rs:5:33: 5:34 StorageDead(_1); // bb1[4]: scope 0 at $DIR/slice_len.rs:5:33: 5:34 - _0 = (); // bb1[5]: scope 0 at $DIR/slice_len.rs:4:11: 6:2 + _0 = const (); // bb1[5]: scope 0 at $DIR/slice_len.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/slice_len.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb1[6]: scope 0 at $DIR/slice_len.rs:6:2: 6:2 } } diff --git a/src/test/mir-opt/copy_propagation_arg/rustc.bar.CopyPropagation.diff b/src/test/mir-opt/copy_propagation_arg/rustc.bar.CopyPropagation.diff index 8bdc91109b3..16bdb7d0a99 100644 --- a/src/test/mir-opt/copy_propagation_arg/rustc.bar.CopyPropagation.diff +++ b/src/test/mir-opt/copy_propagation_arg/rustc.bar.CopyPropagation.diff @@ -30,7 +30,13 @@ // mir::Constant // + span: $DIR/copy_propagation_arg.rs:17:5: 17:10 // + literal: Const { ty: u8, val: Value(Scalar(0x05)) } - nop; // bb1[3]: scope 0 at $DIR/copy_propagation_arg.rs:15:19: 18:2 + _0 = const (); // bb1[3]: scope 0 at $DIR/copy_propagation_arg.rs:15:19: 18:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/copy_propagation_arg.rs:15:19: 18:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb1[4]: scope 0 at $DIR/copy_propagation_arg.rs:18:2: 18:2 } } diff --git a/src/test/mir-opt/copy_propagation_arg/rustc.baz.CopyPropagation.diff b/src/test/mir-opt/copy_propagation_arg/rustc.baz.CopyPropagation.diff index 10f2a98b206..7df995c990a 100644 --- a/src/test/mir-opt/copy_propagation_arg/rustc.baz.CopyPropagation.diff +++ b/src/test/mir-opt/copy_propagation_arg/rustc.baz.CopyPropagation.diff @@ -11,7 +11,13 @@ _2 = _1; // bb0[1]: scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10 _1 = move _2; // bb0[2]: scope 0 at $DIR/copy_propagation_arg.rs:23:5: 23:10 StorageDead(_2); // bb0[3]: scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10 - nop; // bb0[4]: scope 0 at $DIR/copy_propagation_arg.rs:21:20: 24:2 + _0 = const (); // bb0[4]: scope 0 at $DIR/copy_propagation_arg.rs:21:20: 24:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/copy_propagation_arg.rs:21:20: 24:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb0[5]: scope 0 at $DIR/copy_propagation_arg.rs:24:2: 24:2 } } diff --git a/src/test/mir-opt/copy_propagation_arg/rustc.foo.CopyPropagation.diff b/src/test/mir-opt/copy_propagation_arg/rustc.foo.CopyPropagation.diff index a47880c540e..67b58c30f05 100644 --- a/src/test/mir-opt/copy_propagation_arg/rustc.foo.CopyPropagation.diff +++ b/src/test/mir-opt/copy_propagation_arg/rustc.foo.CopyPropagation.diff @@ -24,7 +24,13 @@ StorageDead(_3); // bb1[0]: scope 0 at $DIR/copy_propagation_arg.rs:11:16: 11:17 _1 = move _2; // bb1[1]: scope 0 at $DIR/copy_propagation_arg.rs:11:5: 11:17 StorageDead(_2); // bb1[2]: scope 0 at $DIR/copy_propagation_arg.rs:11:16: 11:17 - nop; // bb1[3]: scope 0 at $DIR/copy_propagation_arg.rs:9:19: 12:2 + _0 = const (); // bb1[3]: scope 0 at $DIR/copy_propagation_arg.rs:9:19: 12:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/copy_propagation_arg.rs:9:19: 12:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb1[4]: scope 0 at $DIR/copy_propagation_arg.rs:12:2: 12:2 } } diff --git a/src/test/mir-opt/generator-storage-dead-unwind/rustc.main-{{closure}}.StateTransform.before.mir b/src/test/mir-opt/generator-storage-dead-unwind/rustc.main-{{closure}}.StateTransform.before.mir index cc22982a515..50a48f2eee4 100644 --- a/src/test/mir-opt/generator-storage-dead-unwind/rustc.main-{{closure}}.StateTransform.before.mir +++ b/src/test/mir-opt/generator-storage-dead-unwind/rustc.main-{{closure}}.StateTransform.before.mir @@ -112,7 +112,13 @@ yields () bb10: { StorageDead(_10); // bb10[0]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16 StorageDead(_9); // bb10[1]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17 - _0 = (); // bb10[2]: scope 0 at $DIR/generator-storage-dead-unwind.rs:22:19: 28:6 + _0 = const (); // bb10[2]: scope 0 at $DIR/generator-storage-dead-unwind.rs:22:19: 28:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/generator-storage-dead-unwind.rs:22:19: 28:6 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_4); // bb10[3]: scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 StorageDead(_3); // bb10[4]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 drop(_1) -> [return: bb12, unwind: bb1]; // bb10[5]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6 diff --git a/src/test/mir-opt/generator-tiny/rustc.main-{{closure}}.generator_resume.0.mir b/src/test/mir-opt/generator-tiny/rustc.main-{{closure}}.generator_resume.0.mir index a79f0d53f3c..2e3354699fb 100644 --- a/src/test/mir-opt/generator-tiny/rustc.main-{{closure}}.generator_resume.0.mir +++ b/src/test/mir-opt/generator-tiny/rustc.main-{{closure}}.generator_resume.0.mir @@ -54,7 +54,13 @@ fn main::{{closure}}#0(_1: std::pin::Pin<&mut [generator@$DIR/generator-tiny.rs: bb4: { StorageDead(_8); // bb4[0]: scope 1 at $DIR/generator-tiny.rs:22:21: 22:22 - _5 = (); // bb4[1]: scope 1 at $DIR/generator-tiny.rs:20:14: 23:10 + _5 = const (); // bb4[1]: scope 1 at $DIR/generator-tiny.rs:20:14: 23:10 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/generator-tiny.rs:20:14: 23:10 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb2; // bb4[2]: scope 1 at $DIR/generator-tiny.rs:20:9: 23:10 } diff --git a/src/test/mir-opt/graphviz/rustc.main.mir_map.0.dot b/src/test/mir-opt/graphviz/rustc.main.mir_map.0.dot index 2caef3459b8..f5d8b84812a 100644 --- a/src/test/mir-opt/graphviz/rustc.main.mir_map.0.dot +++ b/src/test/mir-opt/graphviz/rustc.main.mir_map.0.dot @@ -3,7 +3,7 @@ digraph Mir_0_3 { node [fontname="monospace"]; edge [fontname="monospace"]; label=>; - bb0__0_3 [shape="none", label=<
0
_0 = ()
goto
>]; + bb0__0_3 [shape="none", label=<
0
_0 = const ()
goto
>]; bb1__0_3 [shape="none", label=<
1
resume
>]; bb2__0_3 [shape="none", label=<
2
return
>]; bb0__0_3 -> bb2__0_3 [label=""]; diff --git a/src/test/mir-opt/inline/inline-into-box-place/64bit/rustc.main.Inline.diff b/src/test/mir-opt/inline/inline-into-box-place/64bit/rustc.main.Inline.diff index a0db20cbb74..38ab9ce9926 100644 --- a/src/test/mir-opt/inline/inline-into-box-place/64bit/rustc.main.Inline.diff +++ b/src/test/mir-opt/inline/inline-into-box-place/64bit/rustc.main.Inline.diff @@ -29,11 +29,21 @@ - // + span: $DIR/inline-into-box-place.rs:8:33: 8:41 - // + user_ty: UserType(1) - // + literal: Const { ty: fn() -> std::vec::Vec {std::vec::Vec::::new}, val: Value(Scalar()) } +- } +- +- bb1 (cleanup): { +- resume; // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 +- } +- +- bb2: { +- _1 = move _2; // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 +- StorageDead(_2); // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 +- _0 = const (); // bb2[2]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 + // + span: $SRC_DIR/liballoc/vec.rs:LL:COL + // + user_ty: UserType(0) + // + literal: Const { ty: alloc::raw_vec::RawVec, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) } + ((*_4).1: usize) = const 0usize; // bb0[5]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL -+ // ty::Const + // ty::Const + // + ty: usize + // + val: Value(Scalar(0x0000000000000000)) + // mir::Constant @@ -41,26 +51,24 @@ + // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) } + _1 = move _2; // bb0[6]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 + StorageDead(_2); // bb0[7]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 -+ _0 = (); // bb0[8]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 ++ _0 = const (); // bb0[8]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 ++ // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/inline-into-box-place.rs:7:11: 9:2 + // + literal: Const { ty: (), val: Value(Scalar()) } +- drop(_1) -> [return: bb3, unwind: bb1]; // bb2[3]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 + drop(_1) -> [return: bb2, unwind: bb1]; // bb0[9]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 } - bb1 (cleanup): { - resume; // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 - } - - bb2: { -- _1 = move _2; // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 -- StorageDead(_2); // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 -- _0 = (); // bb2[2]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 -- drop(_1) -> [return: bb3, unwind: bb1]; // bb2[3]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 -- } -- - bb3: { - StorageDead(_1); // bb3[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 - return; // bb3[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2 -- } -- ++ bb1 (cleanup): { ++ resume; // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 + } + - bb4 (cleanup): { - _3 = const alloc::alloc::box_free::>(move (_2.0: std::ptr::Unique>)) -> bb1; // bb4[0]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 - // ty::Const @@ -69,6 +77,7 @@ - // mir::Constant - // + span: $DIR/inline-into-box-place.rs:8:42: 8:43 - // + literal: Const { ty: unsafe fn(std::ptr::Unique>) {alloc::alloc::box_free::>}, val: Value(Scalar()) } ++ bb2: { + StorageDead(_1); // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 + return; // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2 } diff --git a/src/test/mir-opt/inline/inline-specialization/rustc.main.Inline.diff b/src/test/mir-opt/inline/inline-specialization/rustc.main.Inline.diff index 98d03b19977..35c400035a6 100644 --- a/src/test/mir-opt/inline/inline-specialization/rustc.main.Inline.diff +++ b/src/test/mir-opt/inline/inline-specialization/rustc.main.Inline.diff @@ -25,12 +25,18 @@ - } - - bb1: { -- _0 = (); // bb1[0]: scope 0 at $DIR/inline-specialization.rs:4:11: 6:2 -- StorageDead(_1); // bb1[1]: scope 0 at $DIR/inline-specialization.rs:6:1: 6:2 -- return; // bb1[2]: scope 0 at $DIR/inline-specialization.rs:6:2: 6:2 +- _0 = const (); // bb1[0]: scope 0 at $DIR/inline-specialization.rs:4:11: 6:2 + // + span: $DIR/inline-specialization.rs:14:31: 14:34 + // + literal: Const { ty: u32, val: Value(Scalar(0x0000007b)) } -+ _0 = (); // bb0[2]: scope 0 at $DIR/inline-specialization.rs:4:11: 6:2 ++ _0 = const (); // bb0[2]: scope 0 at $DIR/inline-specialization.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/inline-specialization.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } +- StorageDead(_1); // bb1[1]: scope 0 at $DIR/inline-specialization.rs:6:1: 6:2 +- return; // bb1[2]: scope 0 at $DIR/inline-specialization.rs:6:2: 6:2 + StorageDead(_1); // bb0[3]: scope 0 at $DIR/inline-specialization.rs:6:1: 6:2 + return; // bb0[4]: scope 0 at $DIR/inline-specialization.rs:6:2: 6:2 } diff --git a/src/test/mir-opt/issue-38669/rustc.main.SimplifyCfg-initial.after.mir b/src/test/mir-opt/issue-38669/rustc.main.SimplifyCfg-initial.after.mir index 5144cdd3dab..62d2f8db7a4 100644 --- a/src/test/mir-opt/issue-38669/rustc.main.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/issue-38669/rustc.main.SimplifyCfg-initial.after.mir @@ -45,7 +45,13 @@ fn main() -> () { } bb5: { - _3 = (); // bb5[0]: scope 1 at $DIR/issue-38669.rs:7:9: 9:10 + _3 = const (); // bb5[0]: scope 1 at $DIR/issue-38669.rs:7:9: 9:10 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/issue-38669.rs:7:9: 9:10 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_4); // bb5[1]: scope 1 at $DIR/issue-38669.rs:9:9: 9:10 StorageDead(_3); // bb5[2]: scope 1 at $DIR/issue-38669.rs:9:9: 9:10 _1 = const true; // bb5[3]: scope 1 at $DIR/issue-38669.rs:10:9: 10:28 @@ -55,12 +61,24 @@ fn main() -> () { // mir::Constant // + span: $DIR/issue-38669.rs:10:24: 10:28 // + literal: Const { ty: bool, val: Value(Scalar(0x01)) } - _2 = (); // bb5[4]: scope 1 at $DIR/issue-38669.rs:6:10: 11:6 + _2 = const (); // bb5[4]: scope 1 at $DIR/issue-38669.rs:6:10: 11:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/issue-38669.rs:6:10: 11:6 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb2; // bb5[5]: scope 1 at $DIR/issue-38669.rs:6:5: 11:6 } bb6: { - _0 = (); // bb6[0]: scope 1 at $DIR/issue-38669.rs:8:13: 8:18 + _0 = const (); // bb6[0]: scope 1 at $DIR/issue-38669.rs:8:13: 8:18 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/issue-38669.rs:8:13: 8:18 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_4); // bb6[1]: scope 1 at $DIR/issue-38669.rs:9:9: 9:10 StorageDead(_3); // bb6[2]: scope 1 at $DIR/issue-38669.rs:9:9: 9:10 StorageDead(_1); // bb6[3]: scope 0 at $DIR/issue-38669.rs:12:1: 12:2 diff --git a/src/test/mir-opt/issue-41110/rustc.main.ElaborateDrops.after.mir b/src/test/mir-opt/issue-41110/rustc.main.ElaborateDrops.after.mir index 0499054c329..55849b27732 100644 --- a/src/test/mir-opt/issue-41110/rustc.main.ElaborateDrops.after.mir +++ b/src/test/mir-opt/issue-41110/rustc.main.ElaborateDrops.after.mir @@ -85,7 +85,13 @@ fn main() -> () { // + span: $DIR/issue-41110.rs:8:27: 8:28 // + literal: Const { ty: bool, val: Value(Scalar(0x00)) } StorageDead(_2); // bb6[2]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28 - _0 = (); // bb6[3]: scope 0 at $DIR/issue-41110.rs:7:11: 9:2 + _0 = const (); // bb6[3]: scope 0 at $DIR/issue-41110.rs:7:11: 9:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/issue-41110.rs:7:11: 9:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb6[4]: scope 0 at $DIR/issue-41110.rs:9:1: 9:2 return; // bb6[5]: scope 0 at $DIR/issue-41110.rs:9:2: 9:2 } diff --git a/src/test/mir-opt/issue-41110/rustc.test.ElaborateDrops.after.mir b/src/test/mir-opt/issue-41110/rustc.test.ElaborateDrops.after.mir index b6623fcd4d9..cc1a49dd245 100644 --- a/src/test/mir-opt/issue-41110/rustc.test.ElaborateDrops.after.mir +++ b/src/test/mir-opt/issue-41110/rustc.test.ElaborateDrops.after.mir @@ -87,7 +87,13 @@ fn test() -> () { bb8: { StorageDead(_5); // bb8[0]: scope 2 at $DIR/issue-41110.rs:18:9: 18:10 - _0 = (); // bb8[1]: scope 0 at $DIR/issue-41110.rs:14:15: 19:2 + _0 = const (); // bb8[1]: scope 0 at $DIR/issue-41110.rs:14:15: 19:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/issue-41110.rs:14:15: 19:2 + // + literal: Const { ty: (), val: Value(Scalar()) } drop(_2) -> [return: bb9, unwind: bb3]; // bb8[2]: scope 1 at $DIR/issue-41110.rs:19:1: 19:2 } diff --git a/src/test/mir-opt/issue-41888/rustc.main.ElaborateDrops.after.mir b/src/test/mir-opt/issue-41888/rustc.main.ElaborateDrops.after.mir index 6cd3e2dec83..ee05bf48d62 100644 --- a/src/test/mir-opt/issue-41888/rustc.main.ElaborateDrops.after.mir +++ b/src/test/mir-opt/issue-41888/rustc.main.ElaborateDrops.after.mir @@ -66,7 +66,13 @@ fn main() -> () { } bb4: { - _0 = (); // bb4[0]: scope 1 at $DIR/issue-41888.rs:8:5: 14:6 + _0 = const (); // bb4[0]: scope 1 at $DIR/issue-41888.rs:8:5: 14:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/issue-41888.rs:8:5: 14:6 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb11; // bb4[1]: scope 1 at $DIR/issue-41888.rs:8:5: 14:6 } @@ -94,7 +100,13 @@ fn main() -> () { } bb9: { - _0 = (); // bb9[0]: scope 1 at $DIR/issue-41888.rs:10:9: 13:10 + _0 = const (); // bb9[0]: scope 1 at $DIR/issue-41888.rs:10:9: 13:10 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/issue-41888.rs:10:9: 13:10 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb11; // bb9[1]: scope 1 at $DIR/issue-41888.rs:10:9: 13:10 } @@ -108,7 +120,13 @@ fn main() -> () { // + span: $DIR/issue-41888.rs:10:21: 10:23 // + literal: Const { ty: bool, val: Value(Scalar(0x00)) } _6 = move ((_1 as F).0: K); // bb10[2]: scope 1 at $DIR/issue-41888.rs:10:21: 10:23 - _0 = (); // bb10[3]: scope 2 at $DIR/issue-41888.rs:10:29: 13:10 + _0 = const (); // bb10[3]: scope 2 at $DIR/issue-41888.rs:10:29: 13:10 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/issue-41888.rs:10:29: 13:10 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_6); // bb10[4]: scope 1 at $DIR/issue-41888.rs:13:9: 13:10 goto -> bb11; // bb10[5]: scope 1 at $DIR/issue-41888.rs:10:9: 13:10 } diff --git a/src/test/mir-opt/issue-49232/rustc.main.mir_map.0.mir b/src/test/mir-opt/issue-49232/rustc.main.mir_map.0.mir index 03815d58bbc..5440d4488bb 100644 --- a/src/test/mir-opt/issue-49232/rustc.main.mir_map.0.mir +++ b/src/test/mir-opt/issue-49232/rustc.main.mir_map.0.mir @@ -47,7 +47,13 @@ fn main() -> () { } bb6: { - _0 = (); // bb6[0]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30 + _0 = const (); // bb6[0]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/issue-49232.rs:10:25: 10:30 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb8; // bb6[1]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30 } @@ -73,7 +79,13 @@ fn main() -> () { } bb10: { - _4 = (); // bb10[0]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30 + _4 = const (); // bb10[0]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/issue-49232.rs:10:25: 10:30 + // + literal: Const { ty: (), val: Value(Scalar()) } unreachable; // bb10[1]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30 } @@ -99,7 +111,13 @@ fn main() -> () { bb13: { StorageDead(_6); // bb13[0]: scope 1 at $DIR/issue-49232.rs:13:21: 13:22 StorageDead(_5); // bb13[1]: scope 1 at $DIR/issue-49232.rs:13:22: 13:23 - _1 = (); // bb13[2]: scope 0 at $DIR/issue-49232.rs:6:10: 14:6 + _1 = const (); // bb13[2]: scope 0 at $DIR/issue-49232.rs:6:10: 14:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/issue-49232.rs:6:10: 14:6 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_2); // bb13[3]: scope 0 at $DIR/issue-49232.rs:14:5: 14:6 goto -> bb1; // bb13[4]: scope 0 at $DIR/issue-49232.rs:6:5: 14:6 } diff --git a/src/test/mir-opt/loop_test/rustc.main.SimplifyCfg-qualify-consts.after.mir b/src/test/mir-opt/loop_test/rustc.main.SimplifyCfg-qualify-consts.after.mir index c458592e920..df05dbabc77 100644 --- a/src/test/mir-opt/loop_test/rustc.main.SimplifyCfg-qualify-consts.after.mir +++ b/src/test/mir-opt/loop_test/rustc.main.SimplifyCfg-qualify-consts.after.mir @@ -35,7 +35,13 @@ fn main() -> () { } bb3: { - _1 = (); // bb3[0]: scope 0 at $DIR/loop_test.rs:10:5: 12:6 + _1 = const (); // bb3[0]: scope 0 at $DIR/loop_test.rs:10:5: 12:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/loop_test.rs:10:5: 12:6 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_2); // bb3[1]: scope 0 at $DIR/loop_test.rs:12:5: 12:6 StorageDead(_1); // bb3[2]: scope 0 at $DIR/loop_test.rs:12:5: 12:6 StorageLive(_4); // bb3[3]: scope 0 at $DIR/loop_test.rs:13:5: 16:6 @@ -43,7 +49,13 @@ fn main() -> () { } bb4: { - _0 = (); // bb4[0]: scope 0 at $DIR/loop_test.rs:11:9: 11:15 + _0 = const (); // bb4[0]: scope 0 at $DIR/loop_test.rs:11:9: 11:15 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/loop_test.rs:11:9: 11:15 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_2); // bb4[1]: scope 0 at $DIR/loop_test.rs:12:5: 12:6 StorageDead(_1); // bb4[2]: scope 0 at $DIR/loop_test.rs:12:5: 12:6 return; // bb4[3]: scope 0 at $DIR/loop_test.rs:17:2: 17:2 diff --git a/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir b/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir index acc03cce46e..a296bd05312 100644 --- a/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir +++ b/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir @@ -143,7 +143,13 @@ fn full_tested_match() -> () { bb11: { StorageDead(_2); // bb11[0]: scope 0 at $DIR/match_false_edges.rs:19:6: 19:7 StorageDead(_1); // bb11[1]: scope 0 at $DIR/match_false_edges.rs:19:6: 19:7 - _0 = (); // bb11[2]: scope 0 at $DIR/match_false_edges.rs:14:28: 20:2 + _0 = const (); // bb11[2]: scope 0 at $DIR/match_false_edges.rs:14:28: 20:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/match_false_edges.rs:14:28: 20:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb11[3]: scope 0 at $DIR/match_false_edges.rs:20:2: 20:2 } } diff --git a/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir index cc1fa562645..567e3ebdd93 100644 --- a/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir +++ b/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir @@ -135,7 +135,13 @@ fn full_tested_match2() -> () { bb11: { StorageDead(_2); // bb11[0]: scope 0 at $DIR/match_false_edges.rs:30:6: 30:7 StorageDead(_1); // bb11[1]: scope 0 at $DIR/match_false_edges.rs:30:6: 30:7 - _0 = (); // bb11[2]: scope 0 at $DIR/match_false_edges.rs:25:29: 31:2 + _0 = const (); // bb11[2]: scope 0 at $DIR/match_false_edges.rs:25:29: 31:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/match_false_edges.rs:25:29: 31:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb11[3]: scope 0 at $DIR/match_false_edges.rs:31:2: 31:2 } } diff --git a/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir index fce497df982..a24fa9dedb3 100644 --- a/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir +++ b/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir @@ -182,7 +182,13 @@ fn main() -> () { bb15: { StorageDead(_2); // bb15[0]: scope 0 at $DIR/match_false_edges.rs:40:6: 40:7 StorageDead(_1); // bb15[1]: scope 0 at $DIR/match_false_edges.rs:40:6: 40:7 - _0 = (); // bb15[2]: scope 0 at $DIR/match_false_edges.rs:34:11: 41:2 + _0 = const (); // bb15[2]: scope 0 at $DIR/match_false_edges.rs:34:11: 41:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/match_false_edges.rs:34:11: 41:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb15[3]: scope 0 at $DIR/match_false_edges.rs:41:2: 41:2 } } diff --git a/src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir b/src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir index ef5feb79bec..3236b3bcc73 100644 --- a/src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir @@ -158,7 +158,13 @@ fn main() -> () { bb14: { StorageDead(_3); // bb14[0]: scope 2 at $DIR/match_test.rs:17:6: 17:7 - _0 = (); // bb14[1]: scope 0 at $DIR/match_test.rs:6:11: 18:2 + _0 = const (); // bb14[1]: scope 0 at $DIR/match_test.rs:6:11: 18:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/match_test.rs:6:11: 18:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_2); // bb14[2]: scope 1 at $DIR/match_test.rs:18:1: 18:2 StorageDead(_1); // bb14[3]: scope 0 at $DIR/match_test.rs:18:1: 18:2 return; // bb14[4]: scope 0 at $DIR/match_test.rs:18:2: 18:2 diff --git a/src/test/mir-opt/nll/region-subtyping-basic/64bit/rustc.main.nll.0.mir b/src/test/mir-opt/nll/region-subtyping-basic/64bit/rustc.main.nll.0.mir index 8305c3fe7c4..4a285d035be 100644 --- a/src/test/mir-opt/nll/region-subtyping-basic/64bit/rustc.main.nll.0.mir +++ b/src/test/mir-opt/nll/region-subtyping-basic/64bit/rustc.main.nll.0.mir @@ -137,13 +137,25 @@ fn main() -> () { bb6: { StorageDead(_9); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:19:17: 19:18 StorageDead(_8); // bb6[1]: scope 3 at $DIR/region-subtyping-basic.rs:19:18: 19:19 - _0 = (); // bb6[2]: scope 3 at $DIR/region-subtyping-basic.rs:18:13: 20:6 + _0 = const Const(Value(Scalar()): ()); // bb6[2]: scope 3 at $DIR/region-subtyping-basic.rs:18:13: 20:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/region-subtyping-basic.rs:18:13: 20:6 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb8; // bb6[3]: scope 3 at $DIR/region-subtyping-basic.rs:18:5: 22:6 } bb7: { StorageDead(_10); // bb7[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 - _0 = (); // bb7[1]: scope 3 at $DIR/region-subtyping-basic.rs:20:12: 22:6 + _0 = const Const(Value(Scalar()): ()); // bb7[1]: scope 3 at $DIR/region-subtyping-basic.rs:20:12: 22:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/region-subtyping-basic.rs:20:12: 22:6 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb8; // bb7[2]: scope 3 at $DIR/region-subtyping-basic.rs:18:5: 22:6 } diff --git a/src/test/mir-opt/no-spurious-drop-after-call/rustc.main.ElaborateDrops.before.mir b/src/test/mir-opt/no-spurious-drop-after-call/rustc.main.ElaborateDrops.before.mir index b65bc760330..e43e37feba7 100644 --- a/src/test/mir-opt/no-spurious-drop-after-call/rustc.main.ElaborateDrops.before.mir +++ b/src/test/mir-opt/no-spurious-drop-after-call/rustc.main.ElaborateDrops.before.mir @@ -48,7 +48,13 @@ fn main() -> () { StorageDead(_2); // bb3[0]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:34: 9:35 StorageDead(_4); // bb3[1]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:35: 9:36 StorageDead(_1); // bb3[2]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:35: 9:36 - _0 = (); // bb3[3]: scope 0 at $DIR/no-spurious-drop-after-call.rs:8:11: 10:2 + _0 = const (); // bb3[3]: scope 0 at $DIR/no-spurious-drop-after-call.rs:8:11: 10:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/no-spurious-drop-after-call.rs:8:11: 10:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb3[4]: scope 0 at $DIR/no-spurious-drop-after-call.rs:10:2: 10:2 } diff --git a/src/test/mir-opt/packed-struct-drop-aligned/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/packed-struct-drop-aligned/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir index a1424d0bf59..432f91d91e5 100644 --- a/src/test/mir-opt/packed-struct-drop-aligned/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/packed-struct-drop-aligned/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir @@ -61,7 +61,13 @@ fn main() -> () { StorageDead(_6); // bb4[0]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8 (_1.0: Aligned) = move _4; // bb4[1]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8 StorageDead(_4); // bb4[2]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29 - _0 = (); // bb4[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2 + _0 = const (); // bb4[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/packed-struct-drop-aligned.rs:5:11: 8:2 + // + literal: Const { ty: (), val: Value(Scalar()) } drop(_1) -> [return: bb2, unwind: bb1]; // bb4[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2 } } diff --git a/src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir index 780cb9d4ad5..727c271a478 100644 --- a/src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir @@ -125,7 +125,13 @@ fn main() -> () { Retag([raw] _12); // bb4[14]: scope 4 at $DIR/retag.rs:36:18: 36:19 _11 = _12; // bb4[15]: scope 4 at $DIR/retag.rs:36:18: 36:29 StorageDead(_12); // bb4[16]: scope 4 at $DIR/retag.rs:36:29: 36:30 - _2 = (); // bb4[17]: scope 1 at $DIR/retag.rs:31:5: 37:6 + _2 = const (); // bb4[17]: scope 1 at $DIR/retag.rs:31:5: 37:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/retag.rs:31:5: 37:6 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_11); // bb4[18]: scope 4 at $DIR/retag.rs:37:5: 37:6 StorageDead(_10); // bb4[19]: scope 3 at $DIR/retag.rs:37:5: 37:6 StorageDead(_8); // bb4[20]: scope 2 at $DIR/retag.rs:37:5: 37:6 @@ -217,7 +223,13 @@ fn main() -> () { Retag([raw] _26); // bb8[5]: scope 7 at $DIR/retag.rs:50:14: 50:16 _25 = _26; // bb8[6]: scope 7 at $DIR/retag.rs:50:14: 50:28 StorageDead(_26); // bb8[7]: scope 7 at $DIR/retag.rs:50:28: 50:29 - _0 = (); // bb8[8]: scope 0 at $DIR/retag.rs:29:11: 51:2 + _0 = const (); // bb8[8]: scope 0 at $DIR/retag.rs:29:11: 51:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/retag.rs:29:11: 51:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_25); // bb8[9]: scope 7 at $DIR/retag.rs:51:1: 51:2 StorageDead(_15); // bb8[10]: scope 6 at $DIR/retag.rs:51:1: 51:2 StorageDead(_13); // bb8[11]: scope 1 at $DIR/retag.rs:51:1: 51:2 diff --git a/src/test/mir-opt/simplify-arm-identity/rustc.main.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify-arm-identity/rustc.main.SimplifyArmIdentity.diff index 32338127923..2caa6235d54 100644 --- a/src/test/mir-opt/simplify-arm-identity/rustc.main.SimplifyArmIdentity.diff +++ b/src/test/mir-opt/simplify-arm-identity/rustc.main.SimplifyArmIdentity.diff @@ -57,8 +57,15 @@ bb4: { StorageDead(_2); // bb4[0]: scope 1 at $DIR/simplify-arm-identity.rs:21:6: 21:7 - StorageDead(_1); // bb4[1]: scope 0 at $DIR/simplify-arm-identity.rs:22:1: 22:2 - return; // bb4[2]: scope 0 at $DIR/simplify-arm-identity.rs:22:2: 22:2 + _0 = const (); // bb4[1]: scope 0 at $DIR/simplify-arm-identity.rs:16:11: 22:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/simplify-arm-identity.rs:16:11: 22:2 + // + literal: Const { ty: (), val: Value(Scalar()) } + StorageDead(_1); // bb4[2]: scope 0 at $DIR/simplify-arm-identity.rs:22:1: 22:2 + return; // bb4[3]: scope 0 at $DIR/simplify-arm-identity.rs:22:2: 22:2 } } diff --git a/src/test/mir-opt/simplify-locals-removes-unused-consts/rustc.main.SimplifyLocals.diff b/src/test/mir-opt/simplify-locals-removes-unused-consts/rustc.main.SimplifyLocals.diff index 15deb3e31bd..8613a812a83 100644 --- a/src/test/mir-opt/simplify-locals-removes-unused-consts/rustc.main.SimplifyLocals.diff +++ b/src/test/mir-opt/simplify-locals-removes-unused-consts/rustc.main.SimplifyLocals.diff @@ -124,9 +124,17 @@ bb2: { - StorageDead(_11); // bb2[0]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36 - StorageDead(_8); // bb2[1]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36 -- return; // bb2[2]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:17:2: 17:2 +- _0 = const (); // bb2[2]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:12:11: 17:2 + StorageDead(_2); // bb2[0]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36 -+ return; // bb2[1]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:17:2: 17:2 ++ _0 = const (); // bb2[1]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:12:11: 17:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/simplify-locals-removes-unused-consts.rs:12:11: 17:2 + // + literal: Const { ty: (), val: Value(Scalar()) } +- return; // bb2[3]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:17:2: 17:2 ++ return; // bb2[2]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:17:2: 17:2 } } diff --git a/src/test/mir-opt/simplify_cfg/rustc.main.SimplifyCfg-early-opt.diff b/src/test/mir-opt/simplify_cfg/rustc.main.SimplifyCfg-early-opt.diff index 9225bcd0b65..ecac835fb87 100644 --- a/src/test/mir-opt/simplify_cfg/rustc.main.SimplifyCfg-early-opt.diff +++ b/src/test/mir-opt/simplify_cfg/rustc.main.SimplifyCfg-early-opt.diff @@ -33,28 +33,40 @@ - bb3: { - nop; // bb3[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 - switchInt(_2) -> [false: bb5, otherwise: bb4]; // bb3[1]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 -+ bb2: { -+ _1 = (); // bb2[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 -+ StorageDead(_2); // bb2[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 -+ goto -> bb0; // bb2[2]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 - } - +- } +- - bb4: { - goto -> bb6; // bb4[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 - } - - bb5: { -- _1 = (); // bb5[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 +- _1 = const (); // bb5[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 ++ bb2: { ++ _1 = const (); // bb2[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/simplify_cfg.rs:7:9: 9:10 + // + literal: Const { ty: (), val: Value(Scalar()) } - StorageDead(_2); // bb5[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 - goto -> bb0; // bb5[2]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 -- } -- ++ StorageDead(_2); // bb2[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 ++ goto -> bb0; // bb2[2]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 + } + - bb6: { -- _0 = (); // bb6[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 +- _0 = const (); // bb6[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 ++ bb3: { ++ _0 = const (); // bb3[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/simplify_cfg.rs:8:13: 8:18 + // + literal: Const { ty: (), val: Value(Scalar()) } - StorageDead(_2); // bb6[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 - return; // bb6[2]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 -+ bb3: { -+ _0 = (); // bb3[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 + StorageDead(_2); // bb3[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 + return; // bb3[2]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 } diff --git a/src/test/mir-opt/simplify_cfg/rustc.main.SimplifyCfg-initial.diff b/src/test/mir-opt/simplify_cfg/rustc.main.SimplifyCfg-initial.diff index 856ee3508cb..7c8bdde5418 100644 --- a/src/test/mir-opt/simplify_cfg/rustc.main.SimplifyCfg-initial.diff +++ b/src/test/mir-opt/simplify_cfg/rustc.main.SimplifyCfg-initial.diff @@ -54,16 +54,30 @@ } - bb7: { -- _1 = (); // bb7[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 -- goto -> bb12; // bb7[1]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 +- _1 = const (); // bb7[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + bb5: { -+ _1 = (); // bb5[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 ++ _1 = const (); // bb5[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/simplify_cfg.rs:7:9: 9:10 + // + literal: Const { ty: (), val: Value(Scalar()) } +- goto -> bb12; // bb7[1]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + StorageDead(_2); // bb5[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 + goto -> bb0; // bb5[2]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 } - bb8: { -- _0 = (); // bb8[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 +- _0 = const (); // bb8[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 ++ bb6: { ++ _0 = const (); // bb6[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/simplify_cfg.rs:8:13: 8:18 + // + literal: Const { ty: (), val: Value(Scalar()) } - goto -> bb9; // bb8[1]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 - } - @@ -87,8 +101,6 @@ - - bb13: { - return; // bb13[0]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 -+ bb6: { -+ _0 = (); // bb6[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 + StorageDead(_2); // bb6[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 + return; // bb6[2]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 } diff --git a/src/test/mir-opt/simplify_if/rustc.main.SimplifyBranches-after-const-prop.diff b/src/test/mir-opt/simplify_if/rustc.main.SimplifyBranches-after-const-prop.diff index 9e53a0f18af..2946eb1cc44 100644 --- a/src/test/mir-opt/simplify_if/rustc.main.SimplifyBranches-after-const-prop.diff +++ b/src/test/mir-opt/simplify_if/rustc.main.SimplifyBranches-after-const-prop.diff @@ -26,7 +26,13 @@ } bb1: { - _0 = (); // bb1[0]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6 + _0 = const (); // bb1[0]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/simplify_if.rs:6:5: 8:6 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb4; // bb1[1]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6 } @@ -43,7 +49,13 @@ bb3: { StorageDead(_2); // bb3[0]: scope 0 at $DIR/simplify_if.rs:7:15: 7:16 - _0 = (); // bb3[1]: scope 0 at $DIR/simplify_if.rs:6:14: 8:6 + _0 = const (); // bb3[1]: scope 0 at $DIR/simplify_if.rs:6:14: 8:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/simplify_if.rs:6:14: 8:6 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb4; // bb3[2]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6 } diff --git a/src/test/mir-opt/simplify_match/rustc.main.SimplifyBranches-after-copy-prop.diff b/src/test/mir-opt/simplify_match/rustc.main.SimplifyBranches-after-copy-prop.diff index 5429032b099..1c83bb13425 100644 --- a/src/test/mir-opt/simplify_match/rustc.main.SimplifyBranches-after-copy-prop.diff +++ b/src/test/mir-opt/simplify_match/rustc.main.SimplifyBranches-after-copy-prop.diff @@ -26,7 +26,13 @@ } bb1: { - nop; // bb1[0]: scope 0 at $DIR/simplify_match.rs:8:18: 8:20 + _0 = const (); // bb1[0]: scope 0 at $DIR/simplify_match.rs:8:18: 8:20 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/simplify_match.rs:8:18: 8:20 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb3; // bb1[1]: scope 0 at $DIR/simplify_match.rs:6:5: 9:6 } diff --git a/src/test/mir-opt/storage_ranges/rustc.main.nll.0.mir b/src/test/mir-opt/storage_ranges/rustc.main.nll.0.mir index 57ec47346e8..e455a27642d 100644 --- a/src/test/mir-opt/storage_ranges/rustc.main.nll.0.mir +++ b/src/test/mir-opt/storage_ranges/rustc.main.nll.0.mir @@ -54,7 +54,13 @@ fn main() -> () { StorageDead(_5); // bb0[9]: scope 1 at $DIR/storage_ranges.rs:6:24: 6:25 _3 = &_4; // bb0[10]: scope 1 at $DIR/storage_ranges.rs:6:17: 6:25 FakeRead(ForLet, _3); // bb0[11]: scope 1 at $DIR/storage_ranges.rs:6:13: 6:14 - _2 = (); // bb0[12]: scope 1 at $DIR/storage_ranges.rs:5:5: 7:6 + _2 = const (); // bb0[12]: scope 1 at $DIR/storage_ranges.rs:5:5: 7:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/storage_ranges.rs:5:5: 7:6 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_4); // bb0[13]: scope 1 at $DIR/storage_ranges.rs:7:5: 7:6 StorageDead(_3); // bb0[14]: scope 1 at $DIR/storage_ranges.rs:7:5: 7:6 StorageDead(_2); // bb0[15]: scope 1 at $DIR/storage_ranges.rs:7:5: 7:6 @@ -67,7 +73,13 @@ fn main() -> () { // + span: $DIR/storage_ranges.rs:8:13: 8:14 // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) } FakeRead(ForLet, _6); // bb0[18]: scope 1 at $DIR/storage_ranges.rs:8:9: 8:10 - _0 = (); // bb0[19]: scope 0 at $DIR/storage_ranges.rs:3:11: 9:2 + _0 = const (); // bb0[19]: scope 0 at $DIR/storage_ranges.rs:3:11: 9:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/storage_ranges.rs:3:11: 9:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_6); // bb0[20]: scope 1 at $DIR/storage_ranges.rs:9:1: 9:2 StorageDead(_1); // bb0[21]: scope 0 at $DIR/storage_ranges.rs:9:1: 9:2 return; // bb0[22]: scope 0 at $DIR/storage_ranges.rs:9:2: 9:2 diff --git a/src/test/mir-opt/uniform_array_move_out/rustc.move_out_by_subslice.mir_map.0.mir b/src/test/mir-opt/uniform_array_move_out/rustc.move_out_by_subslice.mir_map.0.mir index 5dbee8f7b3d..b46adadf101 100644 --- a/src/test/mir-opt/uniform_array_move_out/rustc.move_out_by_subslice.mir_map.0.mir +++ b/src/test/mir-opt/uniform_array_move_out/rustc.move_out_by_subslice.mir_map.0.mir @@ -83,7 +83,13 @@ fn move_out_by_subslice() -> () { FakeRead(ForLet, _1); // bb9[1]: scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10 StorageLive(_6); // bb9[2]: scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17 _6 = move _1[0..2]; // bb9[3]: scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17 - _0 = (); // bb9[4]: scope 0 at $DIR/uniform_array_move_out.rs:10:27: 13:2 + _0 = const (); // bb9[4]: scope 0 at $DIR/uniform_array_move_out.rs:10:27: 13:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/uniform_array_move_out.rs:10:27: 13:2 + // + literal: Const { ty: (), val: Value(Scalar()) } drop(_6) -> [return: bb12, unwind: bb10]; // bb9[5]: scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2 } diff --git a/src/test/mir-opt/uniform_array_move_out/rustc.move_out_from_end.mir_map.0.mir b/src/test/mir-opt/uniform_array_move_out/rustc.move_out_from_end.mir_map.0.mir index 4a5cd625c9d..851107efe11 100644 --- a/src/test/mir-opt/uniform_array_move_out/rustc.move_out_from_end.mir_map.0.mir +++ b/src/test/mir-opt/uniform_array_move_out/rustc.move_out_from_end.mir_map.0.mir @@ -83,7 +83,13 @@ fn move_out_from_end() -> () { FakeRead(ForLet, _1); // bb9[1]: scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10 StorageLive(_6); // bb9[2]: scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16 _6 = move _1[1 of 2]; // bb9[3]: scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16 - _0 = (); // bb9[4]: scope 0 at $DIR/uniform_array_move_out.rs:4:24: 7:2 + _0 = const (); // bb9[4]: scope 0 at $DIR/uniform_array_move_out.rs:4:24: 7:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/uniform_array_move_out.rs:4:24: 7:2 + // + literal: Const { ty: (), val: Value(Scalar()) } drop(_6) -> [return: bb12, unwind: bb10]; // bb9[5]: scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2 } diff --git a/src/test/mir-opt/uninhabited-enum/rustc.process_void.SimplifyLocals.after.mir b/src/test/mir-opt/uninhabited-enum/rustc.process_void.SimplifyLocals.after.mir index 2eb820bbdc3..1ee2297daac 100644 --- a/src/test/mir-opt/uninhabited-enum/rustc.process_void.SimplifyLocals.after.mir +++ b/src/test/mir-opt/uninhabited-enum/rustc.process_void.SimplifyLocals.after.mir @@ -13,7 +13,14 @@ fn process_void(_1: *const Void) -> () { bb0: { StorageLive(_2); // bb0[0]: scope 0 at $DIR/uninhabited-enum.rs:14:8: 14:14 _2 = &(*_1); // bb0[1]: scope 2 at $DIR/uninhabited-enum.rs:14:26: 14:33 - StorageDead(_2); // bb0[2]: scope 0 at $DIR/uninhabited-enum.rs:17:1: 17:2 - return; // bb0[3]: scope 0 at $DIR/uninhabited-enum.rs:17:2: 17:2 + _0 = const (); // bb0[2]: scope 0 at $DIR/uninhabited-enum.rs:13:41: 17:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/uninhabited-enum.rs:13:41: 17:2 + // + literal: Const { ty: (), val: Value(Scalar()) } + StorageDead(_2); // bb0[3]: scope 0 at $DIR/uninhabited-enum.rs:17:1: 17:2 + return; // bb0[4]: scope 0 at $DIR/uninhabited-enum.rs:17:2: 17:2 } } diff --git a/src/test/mir-opt/uninhabited_enum_branching/rustc.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir b/src/test/mir-opt/uninhabited_enum_branching/rustc.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir index c8dde4d360c..fba77dfe239 100644 --- a/src/test/mir-opt/uninhabited_enum_branching/rustc.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir +++ b/src/test/mir-opt/uninhabited_enum_branching/rustc.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir @@ -64,7 +64,13 @@ fn main() -> () { bb3: { StorageDead(_7); // bb3[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7 StorageDead(_6); // bb3[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7 - _0 = (); // bb3[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 30:2 + _0 = const (); // bb3[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 30:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/uninhabited_enum_branching.rs:19:11: 30:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb3[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:30:2: 30:2 } } diff --git a/src/test/mir-opt/uninhabited_enum_branching/rustc.main.UninhabitedEnumBranching.diff b/src/test/mir-opt/uninhabited_enum_branching/rustc.main.UninhabitedEnumBranching.diff index cccd6aa3230..35842fdaa4e 100644 --- a/src/test/mir-opt/uninhabited_enum_branching/rustc.main.UninhabitedEnumBranching.diff +++ b/src/test/mir-opt/uninhabited_enum_branching/rustc.main.UninhabitedEnumBranching.diff @@ -99,7 +99,13 @@ bb7: { StorageDead(_7); // bb7[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7 StorageDead(_6); // bb7[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7 - _0 = (); // bb7[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 30:2 + _0 = const (); // bb7[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 30:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/uninhabited_enum_branching.rs:19:11: 30:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb7[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:30:2: 30:2 } } diff --git a/src/test/mir-opt/unreachable/rustc.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable/rustc.main.UnreachablePropagation.diff index 3a239c6e3b0..d530a999409 100644 --- a/src/test/mir-opt/unreachable/rustc.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable/rustc.main.UnreachablePropagation.diff @@ -35,7 +35,13 @@ } bb2: { - _0 = (); // bb2[0]: scope 0 at $DIR/unreachable.rs:9:5: 19:6 + _0 = const (); // bb2[0]: scope 0 at $DIR/unreachable.rs:9:5: 19:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/unreachable.rs:9:5: 19:6 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb2[1]: scope 0 at $DIR/unreachable.rs:20:1: 20:2 return; // bb2[2]: scope 0 at $DIR/unreachable.rs:20:2: 20:2 - } @@ -64,7 +70,13 @@ - // mir::Constant - // + span: $DIR/unreachable.rs:15:18: 15:20 - // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) } -- _5 = (); // bb4[1]: scope 2 at $DIR/unreachable.rs:14:16: 16:10 +- _5 = const (); // bb4[1]: scope 2 at $DIR/unreachable.rs:14:16: 16:10 +- // ty::Const +- // + ty: () +- // + val: Value(Scalar()) +- // mir::Constant +- // + span: $DIR/unreachable.rs:14:16: 16:10 +- // + literal: Const { ty: (), val: Value(Scalar()) } - goto -> bb6; // bb4[2]: scope 2 at $DIR/unreachable.rs:12:9: 16:10 - } - @@ -76,7 +88,13 @@ - // mir::Constant - // + span: $DIR/unreachable.rs:13:18: 13:20 - // + literal: Const { ty: i32, val: Value(Scalar(0x00000015)) } -- _5 = (); // bb5[1]: scope 2 at $DIR/unreachable.rs:12:17: 14:10 +- _5 = const (); // bb5[1]: scope 2 at $DIR/unreachable.rs:12:17: 14:10 +- // ty::Const +- // + ty: () +- // + val: Value(Scalar()) +- // mir::Constant +- // + span: $DIR/unreachable.rs:12:17: 14:10 +- // + literal: Const { ty: (), val: Value(Scalar()) } - goto -> bb6; // bb5[2]: scope 2 at $DIR/unreachable.rs:12:9: 16:10 - } - diff --git a/src/test/mir-opt/unreachable_asm/rustc.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_asm/rustc.main.UnreachablePropagation.diff index c32165a3893..2b3ab80fa0f 100644 --- a/src/test/mir-opt/unreachable_asm/rustc.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable_asm/rustc.main.UnreachablePropagation.diff @@ -37,7 +37,13 @@ } bb2: { - _0 = (); // bb2[0]: scope 0 at $DIR/unreachable_asm.rs:11:5: 23:6 + _0 = const (); // bb2[0]: scope 0 at $DIR/unreachable_asm.rs:11:5: 23:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/unreachable_asm.rs:11:5: 23:6 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb2[1]: scope 0 at $DIR/unreachable_asm.rs:24:1: 24:2 return; // bb2[2]: scope 0 at $DIR/unreachable_asm.rs:24:2: 24:2 } @@ -66,7 +72,13 @@ // mir::Constant // + span: $DIR/unreachable_asm.rs:17:18: 17:20 // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) } - _5 = (); // bb4[1]: scope 2 at $DIR/unreachable_asm.rs:16:16: 18:10 + _5 = const (); // bb4[1]: scope 2 at $DIR/unreachable_asm.rs:16:16: 18:10 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/unreachable_asm.rs:16:16: 18:10 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb6; // bb4[2]: scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10 } @@ -78,7 +90,13 @@ // mir::Constant // + span: $DIR/unreachable_asm.rs:15:18: 15:20 // + literal: Const { ty: i32, val: Value(Scalar(0x00000015)) } - _5 = (); // bb5[1]: scope 2 at $DIR/unreachable_asm.rs:14:17: 16:10 + _5 = const (); // bb5[1]: scope 2 at $DIR/unreachable_asm.rs:14:17: 16:10 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/unreachable_asm.rs:14:17: 16:10 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb6; // bb5[2]: scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10 } @@ -87,7 +105,13 @@ StorageDead(_5); // bb6[1]: scope 2 at $DIR/unreachable_asm.rs:18:9: 18:10 StorageLive(_7); // bb6[2]: scope 2 at $DIR/unreachable_asm.rs:21:9: 21:37 llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // bb6[3]: scope 3 at $DIR/unreachable_asm.rs:21:18: 21:35 - _7 = (); // bb6[4]: scope 3 at $DIR/unreachable_asm.rs:21:9: 21:37 + _7 = const (); // bb6[4]: scope 3 at $DIR/unreachable_asm.rs:21:9: 21:37 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/unreachable_asm.rs:21:9: 21:37 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_7); // bb6[5]: scope 2 at $DIR/unreachable_asm.rs:21:36: 21:37 StorageLive(_8); // bb6[6]: scope 2 at $DIR/unreachable_asm.rs:22:9: 22:21 unreachable; // bb6[7]: scope 2 at $DIR/unreachable_asm.rs:22:15: 22:17 diff --git a/src/test/mir-opt/unreachable_asm_2/rustc.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_asm_2/rustc.main.UnreachablePropagation.diff index a3741787566..c3760f6a7fc 100644 --- a/src/test/mir-opt/unreachable_asm_2/rustc.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable_asm_2/rustc.main.UnreachablePropagation.diff @@ -40,7 +40,13 @@ } bb2: { - _0 = (); // bb2[0]: scope 0 at $DIR/unreachable_asm_2.rs:11:5: 25:6 + _0 = const (); // bb2[0]: scope 0 at $DIR/unreachable_asm_2.rs:11:5: 25:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/unreachable_asm_2.rs:11:5: 25:6 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb2[1]: scope 0 at $DIR/unreachable_asm_2.rs:26:1: 26:2 return; // bb2[2]: scope 0 at $DIR/unreachable_asm_2.rs:26:2: 26:2 } @@ -64,7 +70,13 @@ bb4: { StorageLive(_8); // bb4[0]: scope 2 at $DIR/unreachable_asm_2.rs:20:13: 20:41 llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // bb4[1]: scope 4 at $DIR/unreachable_asm_2.rs:20:22: 20:39 - _8 = (); // bb4[2]: scope 4 at $DIR/unreachable_asm_2.rs:20:13: 20:41 + _8 = const (); // bb4[2]: scope 4 at $DIR/unreachable_asm_2.rs:20:13: 20:41 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/unreachable_asm_2.rs:20:13: 20:41 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_8); // bb4[3]: scope 2 at $DIR/unreachable_asm_2.rs:20:40: 20:41 _4 = const 42i32; // bb4[4]: scope 2 at $DIR/unreachable_asm_2.rs:21:13: 21:20 // ty::Const @@ -73,7 +85,13 @@ // mir::Constant // + span: $DIR/unreachable_asm_2.rs:21:18: 21:20 // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) } - _5 = (); // bb4[5]: scope 2 at $DIR/unreachable_asm_2.rs:18:16: 22:10 + _5 = const (); // bb4[5]: scope 2 at $DIR/unreachable_asm_2.rs:18:16: 22:10 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/unreachable_asm_2.rs:18:16: 22:10 + // + literal: Const { ty: (), val: Value(Scalar()) } - goto -> bb6; // bb4[6]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 + unreachable; // bb4[6]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 } @@ -81,7 +99,13 @@ bb5: { StorageLive(_7); // bb5[0]: scope 2 at $DIR/unreachable_asm_2.rs:16:13: 16:41 llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // bb5[1]: scope 3 at $DIR/unreachable_asm_2.rs:16:22: 16:39 - _7 = (); // bb5[2]: scope 3 at $DIR/unreachable_asm_2.rs:16:13: 16:41 + _7 = const (); // bb5[2]: scope 3 at $DIR/unreachable_asm_2.rs:16:13: 16:41 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/unreachable_asm_2.rs:16:13: 16:41 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_7); // bb5[3]: scope 2 at $DIR/unreachable_asm_2.rs:16:40: 16:41 _4 = const 21i32; // bb5[4]: scope 2 at $DIR/unreachable_asm_2.rs:17:13: 17:20 // ty::Const @@ -90,7 +114,13 @@ // mir::Constant // + span: $DIR/unreachable_asm_2.rs:17:18: 17:20 // + literal: Const { ty: i32, val: Value(Scalar(0x00000015)) } - _5 = (); // bb5[5]: scope 2 at $DIR/unreachable_asm_2.rs:14:17: 18:10 + _5 = const (); // bb5[5]: scope 2 at $DIR/unreachable_asm_2.rs:14:17: 18:10 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/unreachable_asm_2.rs:14:17: 18:10 + // + literal: Const { ty: (), val: Value(Scalar()) } - goto -> bb6; // bb5[6]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 - } - diff --git a/src/test/mir-opt/unreachable_diverging/rustc.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_diverging/rustc.main.UnreachablePropagation.diff index 8d1d137f192..2fe0c8dc1e7 100644 --- a/src/test/mir-opt/unreachable_diverging/rustc.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable_diverging/rustc.main.UnreachablePropagation.diff @@ -42,7 +42,13 @@ } bb2: { - _0 = (); // bb2[0]: scope 1 at $DIR/unreachable_diverging.rs:14:5: 19:6 + _0 = const (); // bb2[0]: scope 1 at $DIR/unreachable_diverging.rs:14:5: 19:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/unreachable_diverging.rs:14:5: 19:6 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb2[1]: scope 0 at $DIR/unreachable_diverging.rs:20:1: 20:2 StorageDead(_2); // bb2[2]: scope 0 at $DIR/unreachable_diverging.rs:20:1: 20:2 return; // bb2[3]: scope 0 at $DIR/unreachable_diverging.rs:20:2: 20:2 @@ -59,14 +65,20 @@ } bb4: { -- _5 = (); // bb4[0]: scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 +- _5 = const (); // bb4[0]: scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 ++ _5 = const loop_forever() -> bb5; // bb4[0]: scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27 + // ty::Const +- // + ty: () +- // + val: Value(Scalar()) +- // mir::Constant +- // + span: $DIR/unreachable_diverging.rs:15:9: 17:10 +- // + literal: Const { ty: (), val: Value(Scalar()) } - goto -> bb6; // bb4[1]: scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 - } - - bb5: { - _5 = const loop_forever() -> bb6; // bb5[0]: scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27 -+ _5 = const loop_forever() -> bb5; // bb4[0]: scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27 - // ty::Const +- // ty::Const // + ty: fn() {loop_forever} // + val: Value(Scalar()) // mir::Constant diff --git a/src/test/mir-opt/while-storage/rustc.while_loop.PreCodegen.after.mir b/src/test/mir-opt/while-storage/rustc.while_loop.PreCodegen.after.mir index 8fadcb8c12f..0ac7989166e 100644 --- a/src/test/mir-opt/while-storage/rustc.while_loop.PreCodegen.after.mir +++ b/src/test/mir-opt/while-storage/rustc.while_loop.PreCodegen.after.mir @@ -23,14 +23,25 @@ fn while_loop(_1: bool) -> () { bb1: { StorageDead(_3); // bb1[0]: scope 0 at $DIR/while-storage.rs:10:21: 10:22 - switchInt(_2) -> [false: bb6, otherwise: bb2]; // bb1[1]: scope 0 at $DIR/while-storage.rs:10:5: 14:6 + switchInt(_2) -> [false: bb2, otherwise: bb3]; // bb1[1]: scope 0 at $DIR/while-storage.rs:10:5: 14:6 } bb2: { - StorageLive(_4); // bb2[0]: scope 0 at $DIR/while-storage.rs:11:12: 11:23 - StorageLive(_5); // bb2[1]: scope 0 at $DIR/while-storage.rs:11:21: 11:22 - _5 = _1; // bb2[2]: scope 0 at $DIR/while-storage.rs:11:21: 11:22 - _4 = const get_bool(move _5) -> bb3; // bb2[3]: scope 0 at $DIR/while-storage.rs:11:12: 11:23 + _0 = const (); // bb2[0]: scope 0 at $DIR/while-storage.rs:10:5: 14:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/while-storage.rs:10:5: 14:6 + // + literal: Const { ty: (), val: Value(Scalar()) } + goto -> bb7; // bb2[1]: scope 0 at $DIR/while-storage.rs:10:5: 14:6 + } + + bb3: { + StorageLive(_4); // bb3[0]: scope 0 at $DIR/while-storage.rs:11:12: 11:23 + StorageLive(_5); // bb3[1]: scope 0 at $DIR/while-storage.rs:11:21: 11:22 + _5 = _1; // bb3[2]: scope 0 at $DIR/while-storage.rs:11:21: 11:22 + _4 = const get_bool(move _5) -> bb4; // bb3[3]: scope 0 at $DIR/while-storage.rs:11:12: 11:23 // ty::Const // + ty: fn(bool) -> bool {get_bool} // + val: Value(Scalar()) @@ -39,24 +50,31 @@ fn while_loop(_1: bool) -> () { // + literal: Const { ty: fn(bool) -> bool {get_bool}, val: Value(Scalar()) } } - bb3: { - StorageDead(_5); // bb3[0]: scope 0 at $DIR/while-storage.rs:11:22: 11:23 - switchInt(_4) -> [false: bb4, otherwise: bb5]; // bb3[1]: scope 0 at $DIR/while-storage.rs:11:9: 13:10 - } - bb4: { - StorageDead(_4); // bb4[0]: scope 0 at $DIR/while-storage.rs:14:5: 14:6 - StorageDead(_2); // bb4[1]: scope 0 at $DIR/while-storage.rs:10:21: 10:22 - goto -> bb0; // bb4[2]: scope 0 at $DIR/while-storage.rs:10:5: 14:6 + StorageDead(_5); // bb4[0]: scope 0 at $DIR/while-storage.rs:11:22: 11:23 + switchInt(_4) -> [false: bb5, otherwise: bb6]; // bb4[1]: scope 0 at $DIR/while-storage.rs:11:9: 13:10 } bb5: { StorageDead(_4); // bb5[0]: scope 0 at $DIR/while-storage.rs:14:5: 14:6 - goto -> bb6; // bb5[1]: scope 0 at $DIR/while-storage.rs:12:13: 12:18 + StorageDead(_2); // bb5[1]: scope 0 at $DIR/while-storage.rs:10:21: 10:22 + goto -> bb0; // bb5[2]: scope 0 at $DIR/while-storage.rs:10:5: 14:6 } bb6: { - StorageDead(_2); // bb6[0]: scope 0 at $DIR/while-storage.rs:10:21: 10:22 - return; // bb6[1]: scope 0 at $DIR/while-storage.rs:15:2: 15:2 + _0 = const (); // bb6[0]: scope 0 at $DIR/while-storage.rs:12:13: 12:18 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/while-storage.rs:12:13: 12:18 + // + literal: Const { ty: (), val: Value(Scalar()) } + StorageDead(_4); // bb6[1]: scope 0 at $DIR/while-storage.rs:14:5: 14:6 + goto -> bb7; // bb6[2]: scope 0 at $DIR/while-storage.rs:12:13: 12:18 + } + + bb7: { + StorageDead(_2); // bb7[0]: scope 0 at $DIR/while-storage.rs:10:21: 10:22 + return; // bb7[1]: scope 0 at $DIR/while-storage.rs:15:2: 15:2 } } From 647f810d7b7450845e0f99f63e8797be0c6c3302 Mon Sep 17 00:00:00 2001 From: Bastian Kauschke Date: Tue, 14 Apr 2020 09:14:58 +0200 Subject: [PATCH 3/3] update 32 bit mir-opt tests --- ...main.SimplifyCfg-elaborate-drops.after.mir | 8 +++- .../32bit/rustc.main.ConstProp.after.mir | 8 +++- .../32bit/rustc.main.ConstProp.after.mir | 8 +++- .../32bit/rustc.main.ConstProp.after.mir | 8 +++- .../32bit/rustc.main.ConstProp.diff | 8 +++- .../32bit/rustc.main.ConstProp.diff | 8 +++- .../32bit/rustc.main.ConstProp.diff | 8 +++- .../32bit/rustc.main.SimplifyLocals.after.mir | 15 +++++-- .../repeat/32bit/rustc.main.ConstProp.diff | 8 +++- .../slice_len/32bit/rustc.main.ConstProp.diff | 8 +++- .../32bit/rustc.main.Inline.diff | 39 ++++++++++++------- .../32bit/rustc.main.nll.0.mir | 16 +++++++- ...main.SimplifyCfg-elaborate-drops.after.mir | 8 +++- 13 files changed, 119 insertions(+), 31 deletions(-) diff --git a/src/test/mir-opt/array-index-is-temporary/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/array-index-is-temporary/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir index 0016cebbb4c..217d080be4f 100644 --- a/src/test/mir-opt/array-index-is-temporary/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/array-index-is-temporary/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir @@ -82,7 +82,13 @@ fn main() -> () { _1[_7] = move _5; // bb2[0]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:29 StorageDead(_5); // bb2[1]: scope 3 at $DIR/array-index-is-temporary.rs:16:28: 16:29 StorageDead(_7); // bb2[2]: scope 3 at $DIR/array-index-is-temporary.rs:16:29: 16:30 - _0 = (); // bb2[3]: scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2 + _0 = const (); // bb2[3]: scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/array-index-is-temporary.rs:12:11: 17:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_3); // bb2[4]: scope 2 at $DIR/array-index-is-temporary.rs:17:1: 17:2 StorageDead(_2); // bb2[5]: scope 1 at $DIR/array-index-is-temporary.rs:17:1: 17:2 StorageDead(_1); // bb2[6]: scope 0 at $DIR/array-index-is-temporary.rs:17:1: 17:2 diff --git a/src/test/mir-opt/const_allocation/32bit/rustc.main.ConstProp.after.mir b/src/test/mir-opt/const_allocation/32bit/rustc.main.ConstProp.after.mir index 58806724508..2247b8e155a 100644 --- a/src/test/mir-opt/const_allocation/32bit/rustc.main.ConstProp.after.mir +++ b/src/test/mir-opt/const_allocation/32bit/rustc.main.ConstProp.after.mir @@ -18,7 +18,13 @@ fn main() -> () { _1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8 StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9 StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9 - _0 = (); // bb0[6]: scope 0 at $DIR/const_allocation.rs:7:11: 9:2 + _0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation.rs:7:11: 9:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/const_allocation.rs:7:11: 9:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb0[7]: scope 0 at $DIR/const_allocation.rs:9:2: 9:2 } } diff --git a/src/test/mir-opt/const_allocation2/32bit/rustc.main.ConstProp.after.mir b/src/test/mir-opt/const_allocation2/32bit/rustc.main.ConstProp.after.mir index 6caecf1ecea..4105d673218 100644 --- a/src/test/mir-opt/const_allocation2/32bit/rustc.main.ConstProp.after.mir +++ b/src/test/mir-opt/const_allocation2/32bit/rustc.main.ConstProp.after.mir @@ -18,7 +18,13 @@ fn main() -> () { _1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8 StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9 StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9 - _0 = (); // bb0[6]: scope 0 at $DIR/const_allocation2.rs:4:11: 6:2 + _0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation2.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/const_allocation2.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb0[7]: scope 0 at $DIR/const_allocation2.rs:6:2: 6:2 } } diff --git a/src/test/mir-opt/const_allocation3/32bit/rustc.main.ConstProp.after.mir b/src/test/mir-opt/const_allocation3/32bit/rustc.main.ConstProp.after.mir index 4fc2c4c3fb3..323134553c1 100644 --- a/src/test/mir-opt/const_allocation3/32bit/rustc.main.ConstProp.after.mir +++ b/src/test/mir-opt/const_allocation3/32bit/rustc.main.ConstProp.after.mir @@ -18,7 +18,13 @@ fn main() -> () { _1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8 StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9 StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9 - _0 = (); // bb0[6]: scope 0 at $DIR/const_allocation3.rs:4:11: 6:2 + _0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation3.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/const_allocation3.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb0[7]: scope 0 at $DIR/const_allocation3.rs:6:2: 6:2 } } diff --git a/src/test/mir-opt/const_prop/array_index/32bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/array_index/32bit/rustc.main.ConstProp.diff index 99d79b23e9e..474d50100b0 100644 --- a/src/test/mir-opt/const_prop/array_index/32bit/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/array_index/32bit/rustc.main.ConstProp.diff @@ -84,7 +84,13 @@ + // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) } StorageDead(_3); // bb1[1]: scope 0 at $DIR/array_index.rs:5:33: 5:34 StorageDead(_2); // bb1[2]: scope 0 at $DIR/array_index.rs:5:33: 5:34 - _0 = (); // bb1[3]: scope 0 at $DIR/array_index.rs:4:11: 6:2 + _0 = const (); // bb1[3]: scope 0 at $DIR/array_index.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/array_index.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb1[4]: scope 0 at $DIR/array_index.rs:6:1: 6:2 return; // bb1[5]: scope 0 at $DIR/array_index.rs:6:2: 6:2 } diff --git a/src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff index 7423a3cd38d..f89d869cab5 100644 --- a/src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff @@ -87,7 +87,13 @@ // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) } StorageDead(_2); // bb4[1]: scope 0 at $DIR/discriminant.rs:6:67: 6:68 StorageDead(_3); // bb4[2]: scope 0 at $DIR/discriminant.rs:6:68: 6:69 - _0 = (); // bb4[3]: scope 0 at $DIR/discriminant.rs:5:11: 7:2 + _0 = const (); // bb4[3]: scope 0 at $DIR/discriminant.rs:5:11: 7:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/discriminant.rs:5:11: 7:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb4[4]: scope 0 at $DIR/discriminant.rs:7:1: 7:2 return; // bb4[5]: scope 0 at $DIR/discriminant.rs:7:2: 7:2 } diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable/32bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/optimizes_into_variable/32bit/rustc.main.ConstProp.diff index 41ffedf06bc..2868365e9ac 100644 --- a/src/test/mir-opt/const_prop/optimizes_into_variable/32bit/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/optimizes_into_variable/32bit/rustc.main.ConstProp.diff @@ -171,7 +171,13 @@ + // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38 + // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) } StorageDead(_9); // bb2[7]: scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39 - _0 = (); // bb2[8]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2 + _0 = const (); // bb2[8]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/optimizes_into_variable.rs:11:11: 15:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_8); // bb2[9]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2 StorageDead(_3); // bb2[10]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2 StorageDead(_1); // bb2[11]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2 diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable/32bit/rustc.main.SimplifyLocals.after.mir b/src/test/mir-opt/const_prop/optimizes_into_variable/32bit/rustc.main.SimplifyLocals.after.mir index db4d2d13792..5e2a8af060b 100644 --- a/src/test/mir-opt/const_prop/optimizes_into_variable/32bit/rustc.main.SimplifyLocals.after.mir +++ b/src/test/mir-opt/const_prop/optimizes_into_variable/32bit/rustc.main.SimplifyLocals.after.mir @@ -80,9 +80,16 @@ fn main() -> () { // mir::Constant // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38 // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) } - StorageDead(_4); // bb0[9]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2 - StorageDead(_2); // bb0[10]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2 - StorageDead(_1); // bb0[11]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2 - return; // bb0[12]: scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2 + _0 = const (); // bb0[9]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/optimizes_into_variable.rs:11:11: 15:2 + // + literal: Const { ty: (), val: Value(Scalar()) } + StorageDead(_4); // bb0[10]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2 + StorageDead(_2); // bb0[11]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2 + StorageDead(_1); // bb0[12]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2 + return; // bb0[13]: scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2 } } diff --git a/src/test/mir-opt/const_prop/repeat/32bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/repeat/32bit/rustc.main.ConstProp.diff index 9d62fa31a45..921de794722 100644 --- a/src/test/mir-opt/const_prop/repeat/32bit/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/repeat/32bit/rustc.main.ConstProp.diff @@ -80,7 +80,13 @@ StorageDead(_2); // bb1[2]: scope 0 at $DIR/repeat.rs:6:31: 6:32 StorageDead(_4); // bb1[3]: scope 0 at $DIR/repeat.rs:6:32: 6:33 StorageDead(_3); // bb1[4]: scope 0 at $DIR/repeat.rs:6:32: 6:33 - _0 = (); // bb1[5]: scope 0 at $DIR/repeat.rs:5:11: 7:2 + _0 = const (); // bb1[5]: scope 0 at $DIR/repeat.rs:5:11: 7:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/repeat.rs:5:11: 7:2 + // + literal: Const { ty: (), val: Value(Scalar()) } StorageDead(_1); // bb1[6]: scope 0 at $DIR/repeat.rs:7:1: 7:2 return; // bb1[7]: scope 0 at $DIR/repeat.rs:7:2: 7:2 } diff --git a/src/test/mir-opt/const_prop/slice_len/32bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/slice_len/32bit/rustc.main.ConstProp.diff index dbb4171e7f0..01818095455 100644 --- a/src/test/mir-opt/const_prop/slice_len/32bit/rustc.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/slice_len/32bit/rustc.main.ConstProp.diff @@ -76,7 +76,13 @@ StorageDead(_4); // bb1[2]: scope 0 at $DIR/slice_len.rs:5:33: 5:34 StorageDead(_2); // bb1[3]: scope 0 at $DIR/slice_len.rs:5:33: 5:34 StorageDead(_1); // bb1[4]: scope 0 at $DIR/slice_len.rs:5:33: 5:34 - _0 = (); // bb1[5]: scope 0 at $DIR/slice_len.rs:4:11: 6:2 + _0 = const (); // bb1[5]: scope 0 at $DIR/slice_len.rs:4:11: 6:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/slice_len.rs:4:11: 6:2 + // + literal: Const { ty: (), val: Value(Scalar()) } return; // bb1[6]: scope 0 at $DIR/slice_len.rs:6:2: 6:2 } } diff --git a/src/test/mir-opt/inline/inline-into-box-place/32bit/rustc.main.Inline.diff b/src/test/mir-opt/inline/inline-into-box-place/32bit/rustc.main.Inline.diff index 721b37778ac..6983e94ff8d 100644 --- a/src/test/mir-opt/inline/inline-into-box-place/32bit/rustc.main.Inline.diff +++ b/src/test/mir-opt/inline/inline-into-box-place/32bit/rustc.main.Inline.diff @@ -29,11 +29,21 @@ - // + span: $DIR/inline-into-box-place.rs:8:33: 8:41 - // + user_ty: UserType(1) - // + literal: Const { ty: fn() -> std::vec::Vec {std::vec::Vec::::new}, val: Value(Scalar()) } +- } +- +- bb1 (cleanup): { +- resume; // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 +- } +- +- bb2: { +- _1 = move _2; // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 +- StorageDead(_2); // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 +- _0 = const (); // bb2[2]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 + // + span: $SRC_DIR/liballoc/vec.rs:LL:COL + // + user_ty: UserType(0) + // + literal: Const { ty: alloc::raw_vec::RawVec, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) } + ((*_4).1: usize) = const 0usize; // bb0[5]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL -+ // ty::Const + // ty::Const + // + ty: usize + // + val: Value(Scalar(0x00000000)) + // mir::Constant @@ -41,26 +51,24 @@ + // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) } + _1 = move _2; // bb0[6]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 + StorageDead(_2); // bb0[7]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 -+ _0 = (); // bb0[8]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 ++ _0 = const (); // bb0[8]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 ++ // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/inline-into-box-place.rs:7:11: 9:2 + // + literal: Const { ty: (), val: Value(Scalar()) } +- drop(_1) -> [return: bb3, unwind: bb1]; // bb2[3]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 + drop(_1) -> [return: bb2, unwind: bb1]; // bb0[9]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 } - bb1 (cleanup): { - resume; // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 - } - - bb2: { -- _1 = move _2; // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 -- StorageDead(_2); // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 -- _0 = (); // bb2[2]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 -- drop(_1) -> [return: bb3, unwind: bb1]; // bb2[3]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 -- } -- - bb3: { - StorageDead(_1); // bb3[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 - return; // bb3[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2 -- } -- ++ bb1 (cleanup): { ++ resume; // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 + } + - bb4 (cleanup): { - _3 = const alloc::alloc::box_free::>(move (_2.0: std::ptr::Unique>)) -> bb1; // bb4[0]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 - // ty::Const @@ -69,6 +77,7 @@ - // mir::Constant - // + span: $DIR/inline-into-box-place.rs:8:42: 8:43 - // + literal: Const { ty: unsafe fn(std::ptr::Unique>) {alloc::alloc::box_free::>}, val: Value(Scalar()) } ++ bb2: { + StorageDead(_1); // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 + return; // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2 } diff --git a/src/test/mir-opt/nll/region-subtyping-basic/32bit/rustc.main.nll.0.mir b/src/test/mir-opt/nll/region-subtyping-basic/32bit/rustc.main.nll.0.mir index 1f75658aa26..7d396c3f1fb 100644 --- a/src/test/mir-opt/nll/region-subtyping-basic/32bit/rustc.main.nll.0.mir +++ b/src/test/mir-opt/nll/region-subtyping-basic/32bit/rustc.main.nll.0.mir @@ -137,13 +137,25 @@ fn main() -> () { bb6: { StorageDead(_9); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:19:17: 19:18 StorageDead(_8); // bb6[1]: scope 3 at $DIR/region-subtyping-basic.rs:19:18: 19:19 - _0 = (); // bb6[2]: scope 3 at $DIR/region-subtyping-basic.rs:18:13: 20:6 + _0 = const Const(Value(Scalar()): ()); // bb6[2]: scope 3 at $DIR/region-subtyping-basic.rs:18:13: 20:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/region-subtyping-basic.rs:18:13: 20:6 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb8; // bb6[3]: scope 3 at $DIR/region-subtyping-basic.rs:18:5: 22:6 } bb7: { StorageDead(_10); // bb7[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 - _0 = (); // bb7[1]: scope 3 at $DIR/region-subtyping-basic.rs:20:12: 22:6 + _0 = const Const(Value(Scalar()): ()); // bb7[1]: scope 3 at $DIR/region-subtyping-basic.rs:20:12: 22:6 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/region-subtyping-basic.rs:20:12: 22:6 + // + literal: Const { ty: (), val: Value(Scalar()) } goto -> bb8; // bb7[2]: scope 3 at $DIR/region-subtyping-basic.rs:18:5: 22:6 } diff --git a/src/test/mir-opt/packed-struct-drop-aligned/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/packed-struct-drop-aligned/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir index 03265c613bc..cea10872942 100644 --- a/src/test/mir-opt/packed-struct-drop-aligned/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/packed-struct-drop-aligned/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir @@ -61,7 +61,13 @@ fn main() -> () { StorageDead(_6); // bb4[0]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8 (_1.0: Aligned) = move _4; // bb4[1]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8 StorageDead(_4); // bb4[2]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29 - _0 = (); // bb4[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2 + _0 = const (); // bb4[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/packed-struct-drop-aligned.rs:5:11: 8:2 + // + literal: Const { ty: (), val: Value(Scalar()) } drop(_1) -> [return: bb2, unwind: bb1]; // bb4[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2 } }