Skip to content

Commit

Permalink
Match scalar-pair-bool more flexibly for LLVM 11
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cuviper committed Aug 22, 2020
1 parent 5c87749 commit fb05be0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/test/codegen/scalar-pair-bool.rs
Expand Up @@ -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)
}

Expand Down

0 comments on commit fb05be0

Please sign in to comment.