- // MIR for `foo` before GVN + // MIR for `foo` after GVN fn foo(_1: &mut Option) -> Option { debug v => _1; let mut _0: std::option::Option; let mut _2: &std::option::Option; let mut _3: &std::option::Option; let mut _4: isize; let mut _6: !; let mut _7: std::option::Option; let mut _8: i32; let mut _9: !; scope 1 { debug col => _5; let _5: i32; } bb0: { StorageLive(_2); StorageLive(_3); _3 = &(*_1); _2 = get::>(move _3) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_3); _4 = discriminant((*_2)); switchInt(move _4) -> [1: bb2, otherwise: bb3]; } bb2: { - StorageLive(_5); + nop; _5 = copy (((*_2) as Some).0: i32); StorageLive(_7); - _7 = Option::::None; - (*_1) = move _7; + _7 = const Option::::None; + (*_1) = const Option::::None; StorageDead(_7); StorageLive(_8); _8 = copy _5; - _0 = Option::::Some(move _8); + _0 = Option::::Some(copy _5); StorageDead(_8); - StorageDead(_5); + nop; StorageDead(_2); return; } bb3: { StorageLive(_9); unreachable; } + } + + ALLOC0 (size: 8, align: 4) { + 00 00 00 00 __ __ __ __ │ ....░░░░ }