dianqk 5881b7c68b
mir-opt: execute MatchBranchSimplification after GVN
This can provide more opportunities for MatchBranchSimplification.
2025-04-21 21:46:44 +08:00

11 lines
267 B
Rust

#![crate_type = "lib"]
// EMIT_MIR matchbr.match1.PreCodegen.after.mir
pub fn match1(c: bool, v1: i32, v2: i32) -> i32 {
// CHECK-LABEL: fn match1(
// CHECK: bb0:
// CHECK-NEXT: _0 = Sub
// CHECK-NEXT: return;
if c { v1 - v2 } else { v1 - v2 }
}