From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- ...simplify_arm.id_result.SimplifyArmIdentity.diff | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/test/mir-opt/simplify_arm.id_result.SimplifyArmIdentity.diff (limited to 'src/test/mir-opt/simplify_arm.id_result.SimplifyArmIdentity.diff') diff --git a/src/test/mir-opt/simplify_arm.id_result.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify_arm.id_result.SimplifyArmIdentity.diff new file mode 100644 index 000000000..31d8453ce --- /dev/null +++ b/src/test/mir-opt/simplify_arm.id_result.SimplifyArmIdentity.diff @@ -0,0 +1,58 @@ +- // MIR for `id_result` before SimplifyArmIdentity ++ // MIR for `id_result` after SimplifyArmIdentity + + fn id_result(_1: Result) -> Result { + debug r => _1; // in scope 0 at $DIR/simplify-arm.rs:+0:14: +0:15 + let mut _0: std::result::Result; // return place in scope 0 at $DIR/simplify-arm.rs:+0:37: +0:52 + let mut _2: isize; // in scope 0 at $DIR/simplify-arm.rs:+2:9: +2:14 + let _3: u8; // in scope 0 at $DIR/simplify-arm.rs:+2:12: +2:13 + let mut _4: u8; // in scope 0 at $DIR/simplify-arm.rs:+2:21: +2:22 + let _5: i32; // in scope 0 at $DIR/simplify-arm.rs:+3:13: +3:14 + let mut _6: i32; // in scope 0 at $DIR/simplify-arm.rs:+3:23: +3:24 + scope 1 { + debug x => _3; // in scope 1 at $DIR/simplify-arm.rs:+2:12: +2:13 + } + scope 2 { + debug y => _5; // in scope 2 at $DIR/simplify-arm.rs:+3:13: +3:14 + } + + bb0: { + _2 = discriminant(_1); // scope 0 at $DIR/simplify-arm.rs:+1:11: +1:12 + switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:+1:5: +1:12 + } + + bb1: { + StorageLive(_5); // scope 0 at $DIR/simplify-arm.rs:+3:13: +3:14 + _5 = ((_1 as Err).0: i32); // scope 0 at $DIR/simplify-arm.rs:+3:13: +3:14 + StorageLive(_6); // scope 2 at $DIR/simplify-arm.rs:+3:23: +3:24 + _6 = _5; // scope 2 at $DIR/simplify-arm.rs:+3:23: +3:24 + Deinit(_0); // scope 2 at $DIR/simplify-arm.rs:+3:19: +3:25 + ((_0 as Err).0: i32) = move _6; // scope 2 at $DIR/simplify-arm.rs:+3:19: +3:25 + discriminant(_0) = 1; // scope 2 at $DIR/simplify-arm.rs:+3:19: +3:25 + StorageDead(_6); // scope 2 at $DIR/simplify-arm.rs:+3:24: +3:25 + StorageDead(_5); // scope 0 at $DIR/simplify-arm.rs:+3:24: +3:25 + goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:+3:24: +3:25 + } + + bb2: { + unreachable; // scope 0 at $DIR/simplify-arm.rs:+1:11: +1:12 + } + + bb3: { + StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:+2:12: +2:13 + _3 = ((_1 as Ok).0: u8); // scope 0 at $DIR/simplify-arm.rs:+2:12: +2:13 + StorageLive(_4); // scope 1 at $DIR/simplify-arm.rs:+2:21: +2:22 + _4 = _3; // scope 1 at $DIR/simplify-arm.rs:+2:21: +2:22 + Deinit(_0); // scope 1 at $DIR/simplify-arm.rs:+2:18: +2:23 + ((_0 as Ok).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:+2:18: +2:23 + discriminant(_0) = 0; // scope 1 at $DIR/simplify-arm.rs:+2:18: +2:23 + StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:+2:22: +2:23 + StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:+2:22: +2:23 + goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:+2:22: +2:23 + } + + bb4: { + return; // scope 0 at $DIR/simplify-arm.rs:+5:2: +5:2 + } + } + -- cgit v1.2.3