summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/combine_array_len.norm2.InstSimplify.diff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /tests/mir-opt/combine_array_len.norm2.InstSimplify.diff
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/mir-opt/combine_array_len.norm2.InstSimplify.diff')
-rw-r--r--tests/mir-opt/combine_array_len.norm2.InstSimplify.diff77
1 files changed, 77 insertions, 0 deletions
diff --git a/tests/mir-opt/combine_array_len.norm2.InstSimplify.diff b/tests/mir-opt/combine_array_len.norm2.InstSimplify.diff
new file mode 100644
index 000000000..0777007ce
--- /dev/null
+++ b/tests/mir-opt/combine_array_len.norm2.InstSimplify.diff
@@ -0,0 +1,77 @@
+- // MIR for `norm2` before InstSimplify
++ // MIR for `norm2` after InstSimplify
+
+ fn norm2(_1: [f32; 2]) -> f32 {
+ debug x => _1; // in scope 0 at $DIR/combine_array_len.rs:+0:10: +0:11
+ let mut _0: f32; // return place in scope 0 at $DIR/combine_array_len.rs:+0:26: +0:29
+ let _2: f32; // in scope 0 at $DIR/combine_array_len.rs:+1:9: +1:10
+ let _3: usize; // in scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
+ let mut _4: usize; // in scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
+ let mut _5: bool; // in scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
+ let _7: usize; // in scope 0 at $DIR/combine_array_len.rs:+2:15: +2:16
+ let mut _8: usize; // in scope 0 at $DIR/combine_array_len.rs:+2:13: +2:17
+ let mut _9: bool; // in scope 0 at $DIR/combine_array_len.rs:+2:13: +2:17
+ let mut _10: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:5: +3:8
+ let mut _11: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:5: +3:6
+ let mut _12: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:7: +3:8
+ let mut _13: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:11: +3:14
+ let mut _14: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:11: +3:12
+ let mut _15: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:13: +3:14
+ scope 1 {
+ debug a => _2; // in scope 1 at $DIR/combine_array_len.rs:+1:9: +1:10
+ let _6: f32; // in scope 1 at $DIR/combine_array_len.rs:+2:9: +2:10
+ scope 2 {
+ debug b => _6; // in scope 2 at $DIR/combine_array_len.rs:+2:9: +2:10
+ }
+ }
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $DIR/combine_array_len.rs:+1:9: +1:10
+ StorageLive(_3); // scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
+ _3 = const 0_usize; // scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
+- _4 = Len(_1); // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
++ _4 = const 2_usize; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
+ _5 = Lt(_3, _4); // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
+ assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
+ }
+
+ bb1: {
+ _2 = _1[_3]; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
+ StorageDead(_3); // scope 0 at $DIR/combine_array_len.rs:+1:17: +1:18
+ StorageLive(_6); // scope 1 at $DIR/combine_array_len.rs:+2:9: +2:10
+ StorageLive(_7); // scope 1 at $DIR/combine_array_len.rs:+2:15: +2:16
+ _7 = const 1_usize; // scope 1 at $DIR/combine_array_len.rs:+2:15: +2:16
+- _8 = Len(_1); // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
++ _8 = const 2_usize; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
+ _9 = Lt(_7, _8); // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
+ assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
+ }
+
+ bb2: {
+ _6 = _1[_7]; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
+ StorageDead(_7); // scope 1 at $DIR/combine_array_len.rs:+2:17: +2:18
+ StorageLive(_10); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:8
+ StorageLive(_11); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:6
+ _11 = _2; // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:6
+ StorageLive(_12); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
+ _12 = _2; // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
+ _10 = Mul(move _11, move _12); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:8
+ StorageDead(_12); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
+ StorageDead(_11); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
+ StorageLive(_13); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:14
+ StorageLive(_14); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:12
+ _14 = _6; // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:12
+ StorageLive(_15); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
+ _15 = _6; // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
+ _13 = Mul(move _14, move _15); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:14
+ StorageDead(_15); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
+ StorageDead(_14); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
+ _0 = Add(move _10, move _13); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:14
+ StorageDead(_13); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
+ StorageDead(_10); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
+ StorageDead(_6); // scope 1 at $DIR/combine_array_len.rs:+4:1: +4:2
+ StorageDead(_2); // scope 0 at $DIR/combine_array_len.rs:+4:1: +4:2
+ return; // scope 0 at $DIR/combine_array_len.rs:+4:2: +4:2
+ }
+ }
+