1
Fork 0

Rollup merge of #126502 - cuviper:dump-mir-exclude-alloc-bytes, r=estebank

Ignore allocation bytes in some mir-opt tests

This adds `rustc -Zdump-mir-exclude-alloc-bytes` to skip writing allocation bytes in MIR dumps, and applies it to tests that were failing on s390x due to its big-endian byte order.

Fixes #126261
This commit is contained in:
Jubilee 2024-07-12 13:47:05 -07:00 committed by GitHub
commit 5d56572f06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
72 changed files with 225 additions and 410 deletions

View file

@ -691,6 +691,7 @@ fn test_unstable_options_tracking_hash() {
untracked!(dump_mir, Some(String::from("abc"))); untracked!(dump_mir, Some(String::from("abc")));
untracked!(dump_mir_dataflow, true); untracked!(dump_mir_dataflow, true);
untracked!(dump_mir_dir, String::from("abc")); untracked!(dump_mir_dir, String::from("abc"));
untracked!(dump_mir_exclude_alloc_bytes, true);
untracked!(dump_mir_exclude_pass_number, true); untracked!(dump_mir_exclude_pass_number, true);
untracked!(dump_mir_graphviz, true); untracked!(dump_mir_graphviz, true);
untracked!(dump_mono_stats, SwitchWithOptPath::Enabled(Some("mono-items-dir/".into()))); untracked!(dump_mono_stats, SwitchWithOptPath::Enabled(Some("mono-items-dir/".into())));

View file

@ -1545,6 +1545,9 @@ impl<'a, 'tcx, Prov: Provenance, Extra, Bytes: AllocBytes> std::fmt::Display
// We are done. // We are done.
return write!(w, " {{}}"); return write!(w, " {{}}");
} }
if tcx.sess.opts.unstable_opts.dump_mir_exclude_alloc_bytes {
return write!(w, " {{ .. }}");
}
// Write allocation bytes. // Write allocation bytes.
writeln!(w, " {{")?; writeln!(w, " {{")?;
write_allocation_bytes(tcx, alloc, w, " ")?; write_allocation_bytes(tcx, alloc, w, " ")?;

View file

@ -1687,6 +1687,8 @@ options! {
(default: no)"), (default: no)"),
dump_mir_dir: String = ("mir_dump".to_string(), parse_string, [UNTRACKED], dump_mir_dir: String = ("mir_dump".to_string(), parse_string, [UNTRACKED],
"the directory the MIR is dumped into (default: `mir_dump`)"), "the directory the MIR is dumped into (default: `mir_dump`)"),
dump_mir_exclude_alloc_bytes: bool = (false, parse_bool, [UNTRACKED],
"exclude the raw bytes of allocations when dumping MIR (used in tests) (default: no)"),
dump_mir_exclude_pass_number: bool = (false, parse_bool, [UNTRACKED], dump_mir_exclude_pass_number: bool = (false, parse_bool, [UNTRACKED],
"exclude the pass number when dumping MIR (used in tests) (default: no)"), "exclude the pass number when dumping MIR (used in tests) (default: no)"),
dump_mir_graphviz: bool = (false, parse_bool, [UNTRACKED], dump_mir_graphviz: bool = (false, parse_bool, [UNTRACKED],

View file

@ -119,11 +119,7 @@
} }
} }
ALLOC0 (size: 8, align: 4) { ALLOC0 (size: 8, align: 4) { .. }
20 00 00 00 20 00 00 00 │ ... ...
}
ALLOC1 (size: 4, align: 2) { ALLOC1 (size: 4, align: 2) { .. }
01 00 63 00 │ ..c.
}

View file

@ -1,5 +1,5 @@
//@ test-mir-pass: SingleUseConsts //@ test-mir-pass: SingleUseConsts
//@ compile-flags: -C overflow-checks=no -Zmir-enable-passes=+GVN //@ compile-flags: -C overflow-checks=no -Zmir-enable-passes=+GVN -Zdump-mir-exclude-alloc-bytes
#![allow(unused)] #![allow(unused)]

View file

@ -44,9 +44,7 @@
StorageDead(_2); StorageDead(_2);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 01 00 00 00 00 __ __ __ │ .....░░░
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -1,4 +1,5 @@
//@ test-mir-pass: GVN //@ test-mir-pass: GVN
//@ compile-flags: -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR address_of_pair.fn0.GVN.diff // EMIT_MIR address_of_pair.fn0.GVN.diff
pub fn fn0() -> bool { pub fn fn0() -> bool {

View file

@ -24,9 +24,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 02 00 00 00 00 __ __ __ │ .....░░░
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -24,9 +24,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 02 00 00 00 00 __ __ __ │ .....░░░
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -1,6 +1,6 @@
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ test-mir-pass: GVN //@ test-mir-pass: GVN
//@ compile-flags: -C overflow-checks=on //@ compile-flags: -C overflow-checks=on -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR checked_add.main.GVN.diff // EMIT_MIR checked_add.main.GVN.diff
fn main() { fn main() {

View file

@ -24,9 +24,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 2a 00 00 00 2b 00 00 00 │ *...+...
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -1,4 +1,5 @@
//@ test-mir-pass: GVN //@ test-mir-pass: GVN
//@ compile-flags: -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR mutable_variable_aggregate.main.GVN.diff // EMIT_MIR mutable_variable_aggregate.main.GVN.diff
fn main() { fn main() {

View file

@ -31,9 +31,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 2a 00 00 00 2b 00 00 00 │ *...+...
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -1,4 +1,5 @@
//@ test-mir-pass: GVN //@ test-mir-pass: GVN
//@ compile-flags: -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR mutable_variable_aggregate_mut_ref.main.GVN.diff // EMIT_MIR mutable_variable_aggregate_mut_ref.main.GVN.diff
fn main() { fn main() {

View file

@ -48,9 +48,7 @@
+ nop; + nop;
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -48,9 +48,7 @@
+ nop; + nop;
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -1,5 +1,6 @@
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ test-mir-pass: GVN //@ test-mir-pass: GVN
//@ compile-flags: -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR mutable_variable_unprop_assign.main.GVN.diff // EMIT_MIR mutable_variable_unprop_assign.main.GVN.diff
fn main() { fn main() {

View file

@ -17,9 +17,7 @@
+ _0 = const 4_u32; + _0 = const 4_u32;
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 04 00 00 00 00 __ __ __ │ .....░░░
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -17,9 +17,7 @@
+ _0 = const 4_u32; + _0 = const 4_u32;
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 04 00 00 00 00 __ __ __ │ .....░░░
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -15,6 +15,4 @@ fn add() -> u32 {
} }
} }
ALLOC0 (size: 8, align: 4) { ALLOC0 (size: 8, align: 4) { .. }
04 00 00 00 00 __ __ __ .....
}

View file

@ -15,6 +15,4 @@ fn add() -> u32 {
} }
} }
ALLOC0 (size: 8, align: 4) { ALLOC0 (size: 8, align: 4) { .. }
04 00 00 00 00 __ __ __ .....
}

View file

@ -1,6 +1,6 @@
//@ test-mir-pass: GVN //@ test-mir-pass: GVN
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ compile-flags: -C overflow-checks=on //@ compile-flags: -C overflow-checks=on -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR return_place.add.GVN.diff // EMIT_MIR return_place.add.GVN.diff
// EMIT_MIR return_place.add.PreCodegen.before.mir // EMIT_MIR return_place.add.PreCodegen.before.mir

View file

@ -49,9 +49,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 12, align: 4) {
+ 01 00 00 00 02 00 00 00 03 00 00 00 │ ............
} }
+
+ ALLOC0 (size: 12, align: 4) { .. }

View file

@ -49,9 +49,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 12, align: 4) {
+ 01 00 00 00 02 00 00 00 03 00 00 00 │ ............
} }
+
+ ALLOC0 (size: 12, align: 4) { .. }

View file

@ -49,9 +49,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 12, align: 4) {
+ 01 00 00 00 02 00 00 00 03 00 00 00 │ ............
} }
+
+ ALLOC0 (size: 12, align: 4) { .. }

View file

@ -49,9 +49,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 12, align: 4) {
+ 01 00 00 00 02 00 00 00 03 00 00 00 │ ............
} }
+
+ ALLOC0 (size: 12, align: 4) { .. }

View file

@ -1,5 +1,5 @@
//@ test-mir-pass: GVN //@ test-mir-pass: GVN
//@ compile-flags: -Zmir-enable-passes=+InstSimplify //@ compile-flags: -Zmir-enable-passes=+InstSimplify -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR_FOR_EACH_BIT_WIDTH

View file

@ -31,9 +31,7 @@
+ nop; + nop;
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -31,9 +31,7 @@
+ nop; + nop;
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -1,4 +1,5 @@
//@ test-mir-pass: GVN //@ test-mir-pass: GVN
//@ compile-flags: -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR tuple_literal_propagation.main.GVN.diff // EMIT_MIR tuple_literal_propagation.main.GVN.diff

View file

@ -76,13 +76,9 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 00 00 00 80 01 __ __ __ │ .....░░░
+ }
+
+ ALLOC1 (size: 8, align: 4) {
+ 03 00 00 00 00 __ __ __ │ .....░░░
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }
+
+ ALLOC1 (size: 8, align: 4) { .. }

View file

@ -76,13 +76,9 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 00 00 00 80 01 __ __ __ │ .....░░░
+ }
+
+ ALLOC1 (size: 8, align: 4) {
+ 03 00 00 00 00 __ __ __ │ .....░░░
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }
+
+ ALLOC1 (size: 8, align: 4) { .. }

View file

@ -1,5 +1,5 @@
//@ test-mir-pass: DataflowConstProp //@ test-mir-pass: DataflowConstProp
//@ compile-flags: -Coverflow-checks=on //@ compile-flags: -Coverflow-checks=on -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR checked.main.DataflowConstProp.diff // EMIT_MIR checked.main.DataflowConstProp.diff

View file

@ -94,15 +94,9 @@
} }
} }
ALLOC2 (size: 8, align: 4) { ALLOC2 (size: 8, align: 4) { .. }
01 00 00 00 00 00 00 00 │ ........
}
ALLOC1 (size: 8, align: 4) { ALLOC1 (size: 8, align: 4) { .. }
01 00 00 00 00 00 00 00 │ ........
}
ALLOC0 (size: 8, align: 4) { ALLOC0 (size: 8, align: 4) { .. }
01 00 00 00 00 00 00 00 │ ........
}

View file

@ -98,15 +98,9 @@
} }
} }
ALLOC2 (size: 8, align: 4) { ALLOC2 (size: 8, align: 4) { .. }
01 00 00 00 00 00 00 00 │ ........
}
ALLOC1 (size: 8, align: 4) { ALLOC1 (size: 8, align: 4) { .. }
01 00 00 00 00 00 00 00 │ ........
}
ALLOC0 (size: 8, align: 4) { ALLOC0 (size: 8, align: 4) { .. }
01 00 00 00 00 00 00 00 │ ........
}

View file

@ -94,15 +94,9 @@
} }
} }
ALLOC2 (size: 16, align: 8) { ALLOC2 (size: 16, align: 8) { .. }
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}
ALLOC1 (size: 16, align: 8) { ALLOC1 (size: 16, align: 8) { .. }
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}
ALLOC0 (size: 16, align: 8) { ALLOC0 (size: 16, align: 8) { .. }
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}

View file

@ -98,15 +98,9 @@
} }
} }
ALLOC2 (size: 16, align: 8) { ALLOC2 (size: 16, align: 8) { .. }
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}
ALLOC1 (size: 16, align: 8) { ALLOC1 (size: 16, align: 8) { .. }
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}
ALLOC0 (size: 16, align: 8) { ALLOC0 (size: 16, align: 8) { .. }
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}

View file

@ -102,17 +102,11 @@
_0 = const (); _0 = const ();
drop(_1) -> [return: bb1, unwind unreachable]; drop(_1) -> [return: bb1, unwind unreachable];
} }
+ }
+
+ ALLOC2 (size: 8, align: 4) {
+ 01 00 00 00 00 00 00 00 │ ........
+ }
+
+ ALLOC1 (size: 8, align: 4) {
+ 01 00 00 00 00 00 00 00 │ ........
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 01 00 00 00 00 00 00 00 │ ........
} }
+
+ ALLOC2 (size: 8, align: 4) { .. }
+
+ ALLOC1 (size: 8, align: 4) { .. }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -106,17 +106,11 @@
_0 = const (); _0 = const ();
drop(_1) -> [return: bb1, unwind: bb2]; drop(_1) -> [return: bb1, unwind: bb2];
} }
+ }
+
+ ALLOC2 (size: 8, align: 4) {
+ 01 00 00 00 00 00 00 00 │ ........
+ }
+
+ ALLOC1 (size: 8, align: 4) {
+ 01 00 00 00 00 00 00 00 │ ........
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 01 00 00 00 00 00 00 00 │ ........
} }
+
+ ALLOC2 (size: 8, align: 4) { .. }
+
+ ALLOC1 (size: 8, align: 4) { .. }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -102,17 +102,11 @@
_0 = const (); _0 = const ();
drop(_1) -> [return: bb1, unwind unreachable]; drop(_1) -> [return: bb1, unwind unreachable];
} }
+ }
+
+ ALLOC2 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+ }
+
+ ALLOC1 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+ }
+
+ ALLOC0 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
} }
+
+ ALLOC2 (size: 16, align: 8) { .. }
+
+ ALLOC1 (size: 16, align: 8) { .. }
+
+ ALLOC0 (size: 16, align: 8) { .. }

View file

@ -106,17 +106,11 @@
_0 = const (); _0 = const ();
drop(_1) -> [return: bb1, unwind: bb2]; drop(_1) -> [return: bb1, unwind: bb2];
} }
+ }
+
+ ALLOC2 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+ }
+
+ ALLOC1 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+ }
+
+ ALLOC0 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
} }
+
+ ALLOC2 (size: 16, align: 8) { .. }
+
+ ALLOC1 (size: 16, align: 8) { .. }
+
+ ALLOC0 (size: 16, align: 8) { .. }

View file

@ -1,5 +1,5 @@
//@ test-mir-pass: DataflowConstProp //@ test-mir-pass: DataflowConstProp
//@ compile-flags: -Zmir-enable-passes=+GVN,+Inline //@ compile-flags: -Zmir-enable-passes=+GVN,+Inline -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_PANIC_STRATEGY

View file

@ -1,4 +1,5 @@
//@ test-mir-pass: DataflowConstProp //@ test-mir-pass: DataflowConstProp
//@ compile-flags: -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR_FOR_EACH_BIT_WIDTH
#![feature(custom_mir, core_intrinsics, rustc_attrs)] #![feature(custom_mir, core_intrinsics, rustc_attrs)]

View file

@ -60,9 +60,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 00 00 00 00 00 00 00 00 │ ........
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -60,9 +60,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 00 00 00 00 00 00 00 00 │ ........
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -43,7 +43,7 @@
bb0: { bb0: {
StorageLive(_1); StorageLive(_1);
StorageLive(_2); StorageLive(_2);
_2 = const {ALLOC1: &E}; _2 = const {ALLOC0: &E};
- _1 = (*_2); - _1 = (*_2);
+ _1 = const E::V1(0_i32); + _1 = const E::V1(0_i32);
StorageDead(_2); StorageDead(_2);
@ -79,7 +79,7 @@
bb4: { bb4: {
StorageLive(_7); StorageLive(_7);
StorageLive(_8); StorageLive(_8);
_8 = const {ALLOC2: &&E}; _8 = const {ALLOC1: &&E};
_7 = (*_8); _7 = (*_8);
StorageDead(_8); StorageDead(_8);
StorageLive(_9); StorageLive(_9);
@ -111,21 +111,14 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ } }
+ ALLOC2 (size: 8, align: 4) { .. }
+ +
+ ALLOC3 (size: 8, align: 4) { ALLOC1 (static: RC, size: 4, align: 4) { .. }
+ 00 00 00 00 00 00 00 00 │ ........
}
ALLOC2 (static: RC, size: 4, align: 4) { - ALLOC2 (size: 8, align: 4) { .. }
╾ALLOC0<imm>╼ │ ╾──╼ + ALLOC3 (size: 8, align: 4) { .. }
}
ALLOC0 (size: 8, align: 4) { ALLOC0 (static: statics::C, size: 8, align: 4) { .. }
01 00 00 00 04 00 00 00 │ ........
}
ALLOC1 (static: statics::C, size: 8, align: 4) {
00 00 00 00 00 00 00 00 │ ........
}

View file

@ -43,7 +43,7 @@
bb0: { bb0: {
StorageLive(_1); StorageLive(_1);
StorageLive(_2); StorageLive(_2);
_2 = const {ALLOC1: &E}; _2 = const {ALLOC0: &E};
- _1 = (*_2); - _1 = (*_2);
+ _1 = const E::V1(0_i32); + _1 = const E::V1(0_i32);
StorageDead(_2); StorageDead(_2);
@ -79,7 +79,7 @@
bb4: { bb4: {
StorageLive(_7); StorageLive(_7);
StorageLive(_8); StorageLive(_8);
_8 = const {ALLOC2: &&E}; _8 = const {ALLOC1: &&E};
_7 = (*_8); _7 = (*_8);
StorageDead(_8); StorageDead(_8);
StorageLive(_9); StorageLive(_9);
@ -111,21 +111,14 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ } }
+ ALLOC2 (size: 8, align: 4) { .. }
+ +
+ ALLOC3 (size: 8, align: 4) { ALLOC1 (static: RC, size: 8, align: 8) { .. }
+ 00 00 00 00 00 00 00 00 │ ........
}
ALLOC2 (static: RC, size: 8, align: 8) { - ALLOC2 (size: 8, align: 4) { .. }
╾ALLOC0<imm>╼ │ ╾──────╼ + ALLOC3 (size: 8, align: 4) { .. }
}
ALLOC0 (size: 8, align: 4) { ALLOC0 (static: statics::C, size: 8, align: 4) { .. }
01 00 00 00 04 00 00 00 │ ........
}
ALLOC1 (static: statics::C, size: 8, align: 4) {
00 00 00 00 00 00 00 00 │ ........
}

View file

@ -112,7 +112,7 @@
_9 = (_10.2: &[f32]); _9 = (_10.2: &[f32]);
StorageDead(_10); StorageDead(_10);
StorageLive(_14); StorageLive(_14);
_14 = const {ALLOC4: &&SmallStruct}; _14 = const {ALLOC0: &&SmallStruct};
_31 = deref_copy (*_14); _31 = deref_copy (*_14);
StorageLive(_11); StorageLive(_11);
_32 = deref_copy (*_14); _32 = deref_copy (*_14);
@ -149,7 +149,7 @@
_21 = (_22.2: &[f32]); _21 = (_22.2: &[f32]);
StorageDead(_22); StorageDead(_22);
StorageLive(_26); StorageLive(_26);
_26 = const {ALLOC5: &&BigStruct}; _26 = const {ALLOC1: &&BigStruct};
_35 = deref_copy (*_26); _35 = deref_copy (*_26);
StorageLive(_23); StorageLive(_23);
_36 = deref_copy (*_26); _36 = deref_copy (*_26);
@ -197,51 +197,31 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ } }
+ ALLOC2 (size: 8, align: 4) { .. }
+ +
+ ALLOC6 (size: 8, align: 4) { + ALLOC3 (size: 8, align: 4) { .. }
+ 01 00 00 00 23 00 00 00 │ ....#...
+ }
+ +
+ ALLOC7 (size: 8, align: 4) { + ALLOC4 (size: 8, align: 4) { .. }
+ 01 00 00 00 23 00 00 00 │ ....#...
+ }
+ +
+ ALLOC8 (size: 8, align: 4) { + ALLOC5 (size: 8, align: 4) { .. }
+ 01 00 00 00 23 00 00 00 │ ....#...
+ }
+ +
+ ALLOC9 (size: 8, align: 4) { + ALLOC6 (size: 4, align: 4) { .. }
+ 01 00 00 00 01 00 00 00 │ ........
+ }
+ +
+ ALLOC10 (size: 4, align: 4) { ALLOC1 (static: BIG_STAT, size: 4, align: 4) { .. }
+ 01 00 00 00 │ ....
}
ALLOC5 (static: BIG_STAT, size: 4, align: 4) { - ALLOC2 (size: 20, align: 4) { .. }
╾ALLOC0<imm>╼ │ ╾──╼ + ALLOC7 (size: 20, align: 4) { .. }
}
ALLOC0 (size: 20, align: 4) { - ALLOC3 (size: 8, align: 4) { .. }
0x00 │ 01 00 00 00 23 00 00 00 ╾ALLOC1<imm>╼ 02 00 00 00 │ ....#...╾──╼.... + ALLOC8 (size: 8, align: 4) { .. }
0x10 │ 00 00 a4 42 │ ...B
}
ALLOC1 (size: 8, align: 4) { ALLOC0 (static: SMALL_STAT, size: 4, align: 4) { .. }
00 00 34 42 00 00 90 42 │ ..4B...B
}
ALLOC4 (static: SMALL_STAT, size: 4, align: 4) { - ALLOC4 (size: 20, align: 4) { .. }
╾ALLOC2<imm>╼ │ ╾──╼ + ALLOC9 (size: 20, align: 4) { .. }
}
ALLOC2 (size: 20, align: 4) { - ALLOC5 (size: 4, align: 4) { .. }
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC3<imm>╼ 01 00 00 00 │ ....░░░░╾──╼.... + ALLOC10 (size: 4, align: 4) { .. }
0x10 │ 00 00 10 41 │ ...A
}
ALLOC3 (size: 4, align: 4) {
00 00 50 41 │ ..PA
}

View file

@ -112,7 +112,7 @@
_9 = (_10.2: &[f32]); _9 = (_10.2: &[f32]);
StorageDead(_10); StorageDead(_10);
StorageLive(_14); StorageLive(_14);
_14 = const {ALLOC4: &&SmallStruct}; _14 = const {ALLOC0: &&SmallStruct};
_31 = deref_copy (*_14); _31 = deref_copy (*_14);
StorageLive(_11); StorageLive(_11);
_32 = deref_copy (*_14); _32 = deref_copy (*_14);
@ -149,7 +149,7 @@
_21 = (_22.2: &[f32]); _21 = (_22.2: &[f32]);
StorageDead(_22); StorageDead(_22);
StorageLive(_26); StorageLive(_26);
_26 = const {ALLOC5: &&BigStruct}; _26 = const {ALLOC1: &&BigStruct};
_35 = deref_copy (*_26); _35 = deref_copy (*_26);
StorageLive(_23); StorageLive(_23);
_36 = deref_copy (*_26); _36 = deref_copy (*_26);
@ -197,51 +197,31 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ } }
+ ALLOC2 (size: 8, align: 4) { .. }
+ +
+ ALLOC6 (size: 8, align: 4) { + ALLOC3 (size: 8, align: 4) { .. }
+ 01 00 00 00 23 00 00 00 │ ....#...
+ }
+ +
+ ALLOC7 (size: 8, align: 4) { + ALLOC4 (size: 8, align: 4) { .. }
+ 01 00 00 00 23 00 00 00 │ ....#...
+ }
+ +
+ ALLOC8 (size: 8, align: 4) { + ALLOC5 (size: 8, align: 4) { .. }
+ 01 00 00 00 23 00 00 00 │ ....#...
+ }
+ +
+ ALLOC9 (size: 8, align: 4) { + ALLOC6 (size: 4, align: 4) { .. }
+ 01 00 00 00 01 00 00 00 │ ........
+ }
+ +
+ ALLOC10 (size: 4, align: 4) { ALLOC1 (static: BIG_STAT, size: 8, align: 8) { .. }
+ 01 00 00 00 │ ....
}
ALLOC5 (static: BIG_STAT, size: 8, align: 8) { - ALLOC2 (size: 32, align: 8) { .. }
╾ALLOC0<imm>╼ │ ╾──────╼ + ALLOC7 (size: 32, align: 8) { .. }
}
ALLOC0 (size: 32, align: 8) { - ALLOC3 (size: 8, align: 4) { .. }
0x00 │ 01 00 00 00 23 00 00 00 ╾ALLOC1<imm>╼ │ ....#...╾──────╼ + ALLOC8 (size: 8, align: 4) { .. }
0x10 │ 02 00 00 00 00 00 00 00 00 00 a4 42 __ __ __ __ │ ...........B░░░░
}
ALLOC1 (size: 8, align: 4) { ALLOC0 (static: SMALL_STAT, size: 8, align: 8) { .. }
00 00 34 42 00 00 90 42 │ ..4B...B
}
ALLOC4 (static: SMALL_STAT, size: 8, align: 8) { - ALLOC4 (size: 32, align: 8) { .. }
╾ALLOC2<imm>╼ │ ╾──────╼ + ALLOC9 (size: 32, align: 8) { .. }
}
ALLOC2 (size: 32, align: 8) { - ALLOC5 (size: 4, align: 4) { .. }
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC3<imm>╼ │ ....░░░░╾──────╼ + ALLOC10 (size: 4, align: 4) { .. }
0x10 │ 01 00 00 00 00 00 00 00 00 00 10 41 __ __ __ __ │ ...........A░░░░
}
ALLOC3 (size: 4, align: 4) {
00 00 50 41 │ ..PA
}

View file

@ -1,4 +1,5 @@
//@ test-mir-pass: DataflowConstProp //@ test-mir-pass: DataflowConstProp
//@ compile-flags: -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR_FOR_EACH_BIT_WIDTH
#[derive(Copy, Clone)] #[derive(Copy, Clone)]

View file

@ -92,21 +92,13 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 02 00 00 00 03 00 00 00 │ ........
+ }
+
+ ALLOC1 (size: 8, align: 4) {
+ 02 00 00 00 03 00 00 00 │ ........
+ }
+
+ ALLOC2 (size: 8, align: 4) {
+ 02 00 00 00 03 00 00 00 │ ........
+ }
+
+ ALLOC3 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }
+
+ ALLOC1 (size: 8, align: 4) { .. }
+
+ ALLOC2 (size: 8, align: 4) { .. }
+
+ ALLOC3 (size: 8, align: 4) { .. }

View file

@ -92,21 +92,13 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 02 00 00 00 03 00 00 00 │ ........
+ }
+
+ ALLOC1 (size: 8, align: 4) {
+ 02 00 00 00 03 00 00 00 │ ........
+ }
+
+ ALLOC2 (size: 8, align: 4) {
+ 02 00 00 00 03 00 00 00 │ ........
+ }
+
+ ALLOC3 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }
+
+ ALLOC1 (size: 8, align: 4) { .. }
+
+ ALLOC2 (size: 8, align: 4) { .. }
+
+ ALLOC3 (size: 8, align: 4) { .. }

View file

@ -1,4 +1,5 @@
//@ test-mir-pass: DataflowConstProp //@ test-mir-pass: DataflowConstProp
//@ compile-flags: -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR tuple.main.DataflowConstProp.diff // EMIT_MIR tuple.main.DataflowConstProp.diff

View file

@ -64,9 +64,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 02 00 00 00 05 20 00 00 │ ..... ..
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -64,9 +64,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 16, align: 8) {
+ 02 00 00 00 00 00 00 00 05 20 00 00 00 00 00 00 │ ......... ......
} }
+
+ ALLOC0 (size: 16, align: 8) { .. }

View file

@ -1,7 +1,7 @@
// skip-filecheck // skip-filecheck
//@ test-mir-pass: EnumSizeOpt //@ test-mir-pass: EnumSizeOpt
// EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR_FOR_EACH_BIT_WIDTH
//@ compile-flags: -Zunsound-mir-opts //@ compile-flags: -Zunsound-mir-opts -Zdump-mir-exclude-alloc-bytes
#![feature(arbitrary_enum_discriminant, repr128)] #![feature(arbitrary_enum_discriminant, repr128)]

View file

@ -64,9 +64,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 05 20 00 00 01 00 00 00 │ . ......
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -64,9 +64,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 16, align: 8) {
+ 05 20 00 00 00 00 00 00 01 00 00 00 00 00 00 00 │ . ..............
} }
+
+ ALLOC0 (size: 16, align: 8) { .. }

View file

@ -140,9 +140,7 @@
_0 = const (); _0 = const ();
return; return;
} }
+ }
+
+ ALLOC0 (size: 16, align: 8) {
+ 00 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ │ .........░░░░░░░
} }
+
+ ALLOC0 (size: 16, align: 8) { .. }

View file

@ -140,9 +140,7 @@
_0 = const (); _0 = const ();
return; return;
} }
+ }
+
+ ALLOC0 (size: 16, align: 8) {
+ 00 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ │ .........░░░░░░░
} }
+
+ ALLOC0 (size: 16, align: 8) { .. }

View file

@ -8,10 +8,10 @@
let mut _3: fn(u8) -> u8; let mut _3: fn(u8) -> u8;
let _5: (); let _5: ();
let mut _6: fn(u8) -> u8; let mut _6: fn(u8) -> u8;
let mut _9: {closure@$DIR/gvn.rs:614:19: 614:21}; let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21};
let _10: (); let _10: ();
let mut _11: fn(); let mut _11: fn();
let mut _13: {closure@$DIR/gvn.rs:614:19: 614:21}; let mut _13: {closure@$DIR/gvn.rs:615:19: 615:21};
let _14: (); let _14: ();
let mut _15: fn(); let mut _15: fn();
scope 1 { scope 1 {
@ -19,7 +19,7 @@
let _4: fn(u8) -> u8; let _4: fn(u8) -> u8;
scope 2 { scope 2 {
debug g => _4; debug g => _4;
let _7: {closure@$DIR/gvn.rs:614:19: 614:21}; let _7: {closure@$DIR/gvn.rs:615:19: 615:21};
scope 3 { scope 3 {
debug closure => _7; debug closure => _7;
let _8: fn(); let _8: fn();
@ -62,16 +62,16 @@
StorageDead(_6); StorageDead(_6);
StorageDead(_5); StorageDead(_5);
- StorageLive(_7); - StorageLive(_7);
- _7 = {closure@$DIR/gvn.rs:614:19: 614:21}; - _7 = {closure@$DIR/gvn.rs:615:19: 615:21};
- StorageLive(_8); - StorageLive(_8);
+ nop; + nop;
+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; + _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
+ nop; + nop;
StorageLive(_9); StorageLive(_9);
- _9 = _7; - _9 = _7;
- _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe))); - _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe)));
+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; + _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); + _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe)));
StorageDead(_9); StorageDead(_9);
StorageLive(_10); StorageLive(_10);
StorageLive(_11); StorageLive(_11);
@ -88,8 +88,8 @@
StorageLive(_13); StorageLive(_13);
- _13 = _7; - _13 = _7;
- _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe))); - _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe)));
+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; + _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); + _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe)));
StorageDead(_13); StorageDead(_13);
StorageLive(_14); StorageLive(_14);
StorageLive(_15); StorageLive(_15);

View file

@ -8,10 +8,10 @@
let mut _3: fn(u8) -> u8; let mut _3: fn(u8) -> u8;
let _5: (); let _5: ();
let mut _6: fn(u8) -> u8; let mut _6: fn(u8) -> u8;
let mut _9: {closure@$DIR/gvn.rs:614:19: 614:21}; let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21};
let _10: (); let _10: ();
let mut _11: fn(); let mut _11: fn();
let mut _13: {closure@$DIR/gvn.rs:614:19: 614:21}; let mut _13: {closure@$DIR/gvn.rs:615:19: 615:21};
let _14: (); let _14: ();
let mut _15: fn(); let mut _15: fn();
scope 1 { scope 1 {
@ -19,7 +19,7 @@
let _4: fn(u8) -> u8; let _4: fn(u8) -> u8;
scope 2 { scope 2 {
debug g => _4; debug g => _4;
let _7: {closure@$DIR/gvn.rs:614:19: 614:21}; let _7: {closure@$DIR/gvn.rs:615:19: 615:21};
scope 3 { scope 3 {
debug closure => _7; debug closure => _7;
let _8: fn(); let _8: fn();
@ -62,16 +62,16 @@
StorageDead(_6); StorageDead(_6);
StorageDead(_5); StorageDead(_5);
- StorageLive(_7); - StorageLive(_7);
- _7 = {closure@$DIR/gvn.rs:614:19: 614:21}; - _7 = {closure@$DIR/gvn.rs:615:19: 615:21};
- StorageLive(_8); - StorageLive(_8);
+ nop; + nop;
+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; + _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
+ nop; + nop;
StorageLive(_9); StorageLive(_9);
- _9 = _7; - _9 = _7;
- _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe))); - _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe)));
+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; + _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); + _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe)));
StorageDead(_9); StorageDead(_9);
StorageLive(_10); StorageLive(_10);
StorageLive(_11); StorageLive(_11);
@ -88,8 +88,8 @@
StorageLive(_13); StorageLive(_13);
- _13 = _7; - _13 = _7;
- _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe))); - _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe)));
+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; + _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); + _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe)));
StorageDead(_13); StorageDead(_13);
StorageLive(_14); StorageLive(_14);
StorageLive(_15); StorageLive(_15);

View file

@ -13,7 +13,5 @@
} }
} }
ALLOC0 (static: A, size: 2, align: 1) { ALLOC0 (static: A, size: 2, align: 1) { .. }
00 __ │ .░
}

View file

@ -13,7 +13,5 @@
} }
} }
ALLOC0 (static: A, size: 2, align: 1) { ALLOC0 (static: A, size: 2, align: 1) { .. }
00 __ │ .░
}

View file

@ -1,4 +1,5 @@
//@ test-mir-pass: GVN //@ test-mir-pass: GVN
//@ compile-flags: -Zdump-mir-exclude-alloc-bytes
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ only-64bit //@ only-64bit

View file

@ -176,13 +176,9 @@
+ nop; + nop;
return; return;
} }
+ }
+
+ ALLOC1 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 │ ................
+ }
+
+ ALLOC0 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 │ ................
} }
+
+ ALLOC1 (size: 16, align: 8) { .. }
+
+ ALLOC0 (size: 16, align: 8) { .. }

View file

@ -176,13 +176,9 @@
+ nop; + nop;
return; return;
} }
+ }
+
+ ALLOC1 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 │ ................
+ }
+
+ ALLOC0 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 │ ................
} }
+
+ ALLOC1 (size: 16, align: 8) { .. }
+
+ ALLOC0 (size: 16, align: 8) { .. }

View file

@ -61,9 +61,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 04 00 00 00 00 __ __ __ │ .....░░░
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -61,9 +61,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 04 00 00 00 00 __ __ __ │ .....░░░
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -61,9 +61,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 04 00 00 00 00 __ __ __ │ .....░░░
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -61,9 +61,7 @@
StorageDead(_1); StorageDead(_1);
return; return;
} }
+ }
+
+ ALLOC0 (size: 8, align: 4) {
+ 04 00 00 00 00 __ __ __ │ .....░░░
} }
+
+ ALLOC0 (size: 8, align: 4) { .. }

View file

@ -1,6 +1,6 @@
// skip-filecheck // skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ compile-flags: -C overflow-checks=on //@ compile-flags: -C overflow-checks=on -Zdump-mir-exclude-alloc-bytes
struct Point { struct Point {
x: u32, x: u32,