Match scalar-pair-bool more flexibly for LLVM 11

LLVM 11 started using `phi` and `select` for `fn pair_i32_bool`, which
is still valid, but harder to match than the simple instructions we were
getting before. We'll just check that the unpacked args are directly
referenced in any way, and call it good.
This commit is contained in:
Josh Stone 2020-08-18 15:11:02 -07:00
parent 5c87749a27
commit fb05be00df

View file

@ -24,8 +24,9 @@ pub fn pair_i32_bool(pair: (i32, bool)) -> (i32, bool) {
#[no_mangle]
pub fn pair_and_or((a, b): (bool, bool)) -> (bool, bool) {
// Make sure it can operate directly on the unpacked args
// CHECK: and i1 %_1.0, %_1.1
// CHECK: or i1 %_1.0, %_1.1
// (but it might not be using simple and/or instructions)
// CHECK-DAG: %_1.0
// CHECK-DAG: %_1.1
(a && b, a || b)
}