llvm/llvm/test/CodeGen/AArch64/GlobalISel/combine-logic-of-compare.mir

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -debugify-and-strip-all-safe -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs -mtriple aarch64-unknown-unknown %s -o - | FileCheck %s
---
# icmp (x, 1) && icmp (x, 2) -> x
name:            test_icmp_and_icmp
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_icmp_and_icmp
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: %one:_(s64) = G_CONSTANT i64 1
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s64), %one
    ; CHECK-NEXT: %zext:_(s64) = G_ZEXT [[ICMP]](s1)
    ; CHECK-NEXT: $x0 = COPY %zext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %2:_(s64) = COPY $x2
    %one:_(s64) = G_CONSTANT i64 1
    %two:_(s64) = G_CONSTANT i64 2
    %cmp1:_(s1) = G_ICMP intpred(eq), %0(s64), %one
    %cmp2:_(s1) = G_ICMP intpred(ne), %0(s64), %two
    %and:_(s1) = G_AND %cmp1, %cmp2
    %zext:_(s64) = G_ZEXT %and(s1)
    $x0 = COPY %zext
...
---
# multi use icmp (x, 1) && icmp (x, 2) -> x
name:            multi_use_test_icmp_and_icmp
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: multi_use_test_icmp_and_icmp
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: %one:_(s64) = G_CONSTANT i64 1
    ; CHECK-NEXT: %two:_(s64) = G_CONSTANT i64 2
    ; CHECK-NEXT: %cmp1:_(s1) = G_ICMP intpred(eq), [[COPY]](s64), %one
    ; CHECK-NEXT: %cmp2:_(s1) = G_ICMP intpred(ne), [[COPY]](s64), %two
    ; CHECK-NEXT: %and:_(s1) = G_AND %cmp1, %cmp2
    ; CHECK-NEXT: %zext:_(s64) = G_ZEXT %and(s1)
    ; CHECK-NEXT: %cmp1zext:_(s64) = G_ZEXT %cmp1(s1)
    ; CHECK-NEXT: $x0 = COPY %zext(s64)
    ; CHECK-NEXT: $x0 = COPY %cmp1zext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %2:_(s64) = COPY $x2
    %one:_(s64) = G_CONSTANT i64 1
    %two:_(s64) = G_CONSTANT i64 2
    %cmp1:_(s1) = G_ICMP intpred(eq), %0(s64), %one
    %cmp2:_(s1) = G_ICMP intpred(ne), %0(s64), %two
    %and:_(s1) = G_AND %cmp1, %cmp2
    %zext:_(s64) = G_ZEXT %and(s1)
    %cmp1zext:_(s64) = G_ZEXT %cmp1(s1)
    $x0 = COPY %zext
    $x0 = COPY %cmp1zext
...
---
# icmp (x, 1) && icmp (x, add(x, 2)) -> x
name:            test_icmp_and_icmp_with_add
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_icmp_and_icmp_with_add
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: %one:_(s64) = G_CONSTANT i64 1
    ; CHECK-NEXT: %cmp1:_(s1) = G_ICMP intpred(eq), [[COPY]](s64), %one
    ; CHECK-NEXT: %zext:_(s64) = G_ZEXT %cmp1(s1)
    ; CHECK-NEXT: $x0 = COPY %zext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %2:_(s64) = COPY $x2
    %one:_(s64) = G_CONSTANT i64 1
    %two:_(s64) = G_CONSTANT i64 2
    %add:_(s64) = G_ADD %0(s64), %two
    %cmp1:_(s1) = G_ICMP intpred(eq), %0(s64), %one
    %cmp2:_(s1) = G_ICMP intpred(ne), %0(s64), %add
    %and:_(s1) = G_AND %cmp1, %cmp2
    %zext:_(s64) = G_ZEXT %and(s1)
    $x0 = COPY %zext
...
---
# icmp (x, 1) && icmp (x, add(x, 2000)) -> x
name:            test_icmp_or_icmp_with_add_2000
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_icmp_or_icmp_with_add_2000
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: %one:_(s64) = G_CONSTANT i64 -100
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s64), %one
    ; CHECK-NEXT: %zext:_(s64) = G_ZEXT [[ICMP]](s1)
    ; CHECK-NEXT: $x0 = COPY %zext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %2:_(s64) = COPY $x2
    %one:_(s64) = G_CONSTANT i64 -100
    %two:_(s64) = G_CONSTANT i64 2000
    %cmp1:_(s1) = G_ICMP intpred(eq), %0(s64), %one
    %cmp2:_(s1) = G_ICMP intpred(ne), %0(s64), %two
    %or:_(s1) = G_AND %cmp1, %cmp2
    %zext:_(s64) = G_ZEXT %or(s1)
    $x0 = COPY %zext
...
---
# icmp (x, -100) || icmp (x, 2000) -> x
name:            test_icmp_or_icmp
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_icmp_or_icmp
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: %two:_(s64) = G_CONSTANT i64 2000
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](s64), %two
    ; CHECK-NEXT: %zext:_(s64) = G_ZEXT [[ICMP]](s1)
    ; CHECK-NEXT: $x0 = COPY %zext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %2:_(s64) = COPY $x2
    %one:_(s64) = G_CONSTANT i64 -100
    %two:_(s64) = G_CONSTANT i64 2000
    %cmp1:_(s1) = G_ICMP intpred(eq), %0(s64), %one
    %cmp2:_(s1) = G_ICMP intpred(ne), %0(s64), %two
    %or:_(s1) = G_OR %cmp1, %cmp2
    %zext:_(s64) = G_ZEXT %or(s1)
    $x0 = COPY %zext
...
---
# offset icmp (x, -100) || icmp (x, 2000) -> x
name:            test_icmp_or_icmp_offset
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_icmp_or_icmp_offset
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -2001
    ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY]], [[C]]
    ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 -2101
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ult), [[ADD]](s64), [[C1]]
    ; CHECK-NEXT: %zext:_(s64) = G_ZEXT [[ICMP]](s1)
    ; CHECK-NEXT: $x0 = COPY %zext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %2:_(s64) = COPY $x2
    %one:_(s64) = G_CONSTANT i64 -100
    %two:_(s64) = G_CONSTANT i64 2000
    %cmp1:_(s1) = G_ICMP intpred(slt), %0(s64), %one
    %cmp2:_(s1) = G_ICMP intpred(sgt), %0(s64), %two
    %or:_(s1) = G_OR %cmp1, %cmp2
    %zext:_(s64) = G_ZEXT %or(s1)
    $x0 = COPY %zext
...
---
# icmp (x, add(x, 9) || icmp (x, add(x, 2)) -> x
name:            test_icmp_or_icmp_with_add_and_add
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_icmp_or_icmp_with_add_and_add
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
    ; CHECK-NEXT: %two:_(s64) = G_CONSTANT i64 2
    ; CHECK-NEXT: %add2:_(s64) = G_ADD [[COPY]], %two
    ; CHECK-NEXT: %cmp2:_(s1) = G_ICMP intpred(ne), [[COPY1]](s64), %add2
    ; CHECK-NEXT: %zext:_(s64) = G_ZEXT %cmp2(s1)
    ; CHECK-NEXT: $x0 = COPY %zext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %2:_(s64) = COPY $x2
    %nine:_(s64) = G_CONSTANT i64 9
    %two:_(s64) = G_CONSTANT i64 2
    %add1:_(s64) = G_ADD %0(s64), %nine
    %add2:_(s64) = G_ADD %0(s64), %two
    %cmp1:_(s1) = G_ICMP intpred(eq), %0(s64), %add1
    %cmp2:_(s1) = G_ICMP intpred(ne), %1(s64), %add2
    %and:_(s1) = G_OR %cmp1, %cmp2
    %zext:_(s64) = G_ZEXT %and(s1)
    $x0 = COPY %zext
...
---
# icmp (x, 9) && icmp (x, 2)) -> x
# buildConstant 0
# buildICmp ult, R1, NewC
# buildZExtOrTrunc -> COPY
# erase G_AND
# x > 9 && x < 2 => false
name:            test_icmp_and_icmp_9_2
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_icmp_and_icmp_9_2
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %zext:_(s64) = G_CONSTANT i64 0
    ; CHECK-NEXT: $x0 = COPY %zext(s64)
    %0:_(s64) = COPY $x0
    %nine:_(s64) = G_CONSTANT i64 9
    %two:_(s64) = G_CONSTANT i64 2
    %cmp1:_(s1) = G_ICMP intpred(sgt), %0(s64), %nine
    %cmp2:_(s1) = G_ICMP intpred(slt), %0(s64), %two
    %and:_(s1) = G_AND %cmp1, %cmp2
    %zext:_(s64) = G_ZEXT %and(s1)
    $x0 = COPY %zext
...
---
# icmp (x, v1) && icmp (x, v2)) -> x
name:            test_icmp_and_icmp_with_vectors
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_icmp_and_icmp_with_vectors
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
    ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
    ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
    ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s64) = COPY $x5
    ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s64) = COPY $x6
    ; CHECK-NEXT: [[COPY7:%[0-9]+]]:_(s64) = COPY $x7
    ; CHECK-NEXT: %v1:_(<2 x s64>) = G_BUILD_VECTOR [[COPY]](s64), [[COPY1]](s64)
    ; CHECK-NEXT: %v2:_(<2 x s64>) = G_BUILD_VECTOR [[COPY2]](s64), [[COPY3]](s64)
    ; CHECK-NEXT: %v3:_(<2 x s64>) = G_BUILD_VECTOR [[COPY4]](s64), [[COPY5]](s64)
    ; CHECK-NEXT: %v4:_(<2 x s64>) = G_BUILD_VECTOR [[COPY6]](s64), [[COPY7]](s64)
    ; CHECK-NEXT: %cmp1:_(<2 x s1>) = G_ICMP intpred(ne), %v1(<2 x s64>), %v2
    ; CHECK-NEXT: %cmp2:_(<2 x s1>) = G_ICMP intpred(eq), %v3(<2 x s64>), %v4
    ; CHECK-NEXT: %and:_(<2 x s1>) = G_AND %cmp1, %cmp2
    ; CHECK-NEXT: %zext:_(<2 x s64>) = G_ZEXT %and(<2 x s1>)
    ; CHECK-NEXT: $q0 = COPY %zext(<2 x s64>)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %2:_(s64) = COPY $x2
    %3:_(s64) = COPY $x3
    %4:_(s64) = COPY $x4
    %5:_(s64) = COPY $x5
    %6:_(s64) = COPY $x6
    %7:_(s64) = COPY $x7
    %nine:_(s64) = G_CONSTANT i64 9
    %two:_(s64) = G_CONSTANT i64 2
    %v1:_(<2 x s64>) = G_BUILD_VECTOR %0(s64), %1(s64)
    %v2:_(<2 x s64>) = G_BUILD_VECTOR %2(s64), %3(s64)
    %v3:_(<2 x s64>) = G_BUILD_VECTOR %4(s64), %5(s64)
    %v4:_(<2 x s64>) = G_BUILD_VECTOR %6(s64), %7(s64)
    %cmp1:_(<2 x s1>) = G_ICMP intpred(ne), %v1(<2 x s64>), %v2
    %cmp2:_(<2 x s1>) = G_ICMP intpred(eq), %v3(<2 x s64>), %v4
    %and:_(<2 x s1>) = G_AND %cmp1, %cmp2
    %zext:_(<2 x s64>) = G_ZEXT %and(<2 x s1>)
    $q0 = COPY %zext
...
---
# fcmp (x, y) || fcmp (x, y) -> fcmp(x, y)
name:            test_fcmp_or_fcmp_with_x_y
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_fcmp_or_fcmp_with_x_y
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
    ; CHECK-NEXT: [[FCMP:%[0-9]+]]:_(s1) = G_FCMP floatpred(ueq), [[COPY]](s64), [[COPY1]]
    ; CHECK-NEXT: %zext:_(s64) = G_ZEXT [[FCMP]](s1)
    ; CHECK-NEXT: $x0 = COPY %zext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %cmp1:_(s1) = G_FCMP floatpred(oeq), %0(s64), %1
    %cmp2:_(s1) = G_FCMP floatpred(uno), %0(s64), %1
    %or:_(s1) = G_OR %cmp1, %cmp2
    %zext:_(s64) = G_ZEXT %or(s1)
    $x0 = COPY %zext
...
---
# fcmp (5, y) || fcmp (y, 5) -> fcmp(x, y)
name:            test_fcmp_or_fcmp_with_5_y
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_fcmp_or_fcmp_with_5_y
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 5.000000e+00
    ; CHECK-NEXT: [[FCMP:%[0-9]+]]:_(s1) = G_FCMP floatpred(une), [[COPY]](s64), [[C]]
    ; CHECK-NEXT: %zext:_(s64) = G_ZEXT [[FCMP]](s1)
    ; CHECK-NEXT: $x0 = COPY %zext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %2:_(s64) = G_FCONSTANT double 5.0
    %cmp1:_(s1) = G_FCMP floatpred(one), %0(s64), %2
    %cmp2:_(s1) = G_FCMP floatpred(uno), %0(s64), %2
    %or:_(s1) = G_OR %cmp1, %cmp2
    %zext:_(s64) = G_ZEXT %or(s1)
    $x0 = COPY %zext
...
---
# fcmp (x, y) || fcmp (y, x) -> fcmp(x, y)
name:            test_fcmp_or_fcmp_with_anti
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_fcmp_or_fcmp_with_anti
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
    ; CHECK-NEXT: [[FCMP:%[0-9]+]]:_(s1) = G_FCMP floatpred(une), [[COPY1]](s64), [[COPY]]
    ; CHECK-NEXT: %zext:_(s64) = G_ZEXT [[FCMP]](s1)
    ; CHECK-NEXT: $x0 = COPY %zext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %cmp1:_(s1) = G_FCMP floatpred(one), %1(s64), %0
    %cmp2:_(s1) = G_FCMP floatpred(uno), %0(s64), %1
    %or:_(s1) = G_OR %cmp1, %cmp2
    %zext:_(s64) = G_ZEXT %or(s1)
    $x0 = COPY %zext
...
---
# fcmp (x, y) && fcmp (x, y) -> fcmp(x, y)
name:            test_fcmp_and_fcmp_with_x_y
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_fcmp_and_fcmp_with_x_y
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
    ; CHECK-NEXT: [[FCMP:%[0-9]+]]:_(s1) = G_FCMP floatpred(uno), [[COPY1]](s64), [[COPY]]
    ; CHECK-NEXT: %zext:_(s64) = G_ZEXT [[FCMP]](s1)
    ; CHECK-NEXT: $x0 = COPY %zext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %cmp1:_(s1) = G_FCMP floatpred(une), %1(s64), %0
    %cmp2:_(s1) = G_FCMP floatpred(uno), %0(s64), %1
    %and:_(s1) = G_AND %cmp1, %cmp2
    %zext:_(s64) = G_ZEXT %and(s1)
    $x0 = COPY %zext
...
---
# fcmp (x, y) && fcmp (x, y) -> fcmp(x, y)
name:            test_fcmp_and_fcmp_with_x_y_multi_use
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_fcmp_and_fcmp_with_x_y_multi_use
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
    ; CHECK-NEXT: %cmp1:_(s1) = G_FCMP floatpred(ogt), [[COPY1]](s64), [[COPY]]
    ; CHECK-NEXT: %cmp2:_(s1) = G_FCMP floatpred(ugt), [[COPY]](s64), [[COPY1]]
    ; CHECK-NEXT: %and:_(s1) = G_AND %cmp1, %cmp2
    ; CHECK-NEXT: %zext:_(s64) = G_ZEXT %and(s1)
    ; CHECK-NEXT: %zext2:_(s64) = G_ZEXT %and(s1)
    ; CHECK-NEXT: $x0 = COPY %zext(s64)
    ; CHECK-NEXT: $x2 = COPY %zext2(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %cmp1:_(s1) = G_FCMP floatpred(ogt), %1(s64), %0
    %cmp2:_(s1) = G_FCMP floatpred(ugt), %0(s64), %1
    %and:_(s1) = G_AND %cmp1, %cmp2
    %zext:_(s64) = G_ZEXT %and(s1)
    %zext2:_(s64) = G_ZEXT %and(s1)
    $x0 = COPY %zext
    $x2 = COPY %zext2
...
---
# fcmp (x, y) && fcmp (x, y) -> fcmp(x, y)
name:            test_fcmp_and_fcmp_with_vectors
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: test_fcmp_and_fcmp_with_vectors
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s1) = G_CONSTANT i1 false
    ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s1>) = G_BUILD_VECTOR [[C]](s1), [[C]](s1)
    ; CHECK-NEXT: %zext:_(<2 x s64>) = G_ZEXT [[BUILD_VECTOR]](<2 x s1>)
    ; CHECK-NEXT: $q0 = COPY %zext(<2 x s64>)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %2:_(s64) = COPY $x2
    %3:_(s64) = COPY $x3
    %4:_(s64) = COPY $x4
    %5:_(s64) = COPY $x5
    %6:_(s64) = COPY $x6
    %7:_(s64) = COPY $x7
    %v8:_(<2 x s64>) = G_BUILD_VECTOR %0(s64), %1(s64)
    %v9:_(<2 x s64>) = G_BUILD_VECTOR %2(s64), %3(s64)
    %cmp1:_(<2 x s1>) = G_FCMP floatpred(oeq), %v8(<2 x s64>), %v9
    %cmp2:_(<2 x s1>) = G_FCMP floatpred(olt), %v8(<2 x s64>), %v9
    %and:_(<2 x s1>) = G_AND %cmp1, %cmp2
    %zext:_(<2 x s64>) = G_ZEXT %and(<2 x s1>)
    $q0 = COPY %zext
...
---
name:            test_dont_combine_pointers
body:             |
  ; CHECK-LABEL: name: test_dont_combine_pointers
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   [[C:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
  ; CHECK-NEXT:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 -8
  ; CHECK-NEXT:   [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[C1]](s64)
  ; CHECK-NEXT:   [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 -16
  ; CHECK-NEXT:   [[INTTOPTR1:%[0-9]+]]:_(p0) = G_INTTOPTR [[C2]](s64)
  ; CHECK-NEXT:   [[C3:%[0-9]+]]:_(s1) = G_CONSTANT i1 false
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   successors: %bb.2(0x60000000), %bb.3(0x20000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[C]](p0) :: (load (p0))
  ; CHECK-NEXT:   [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[LOAD]](p0), [[INTTOPTR]]
  ; CHECK-NEXT:   [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[LOAD]](p0), [[INTTOPTR1]]
  ; CHECK-NEXT:   [[AND:%[0-9]+]]:_(s1) = G_AND [[ICMP]], [[ICMP1]]
  ; CHECK-NEXT:   G_BRCOND [[AND]](s1), %bb.3
  ; CHECK-NEXT:   G_BR %bb.2
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2:
  ; CHECK-NEXT:   successors: %bb.1(0x55555555), %bb.3(0x2aaaaaab)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   G_BRCOND [[C3]](s1), %bb.1
  ; CHECK-NEXT:   G_BR %bb.3
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.3:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   G_BR %bb.1
  bb.1:
    %1:_(p0) = G_CONSTANT i64 0
    %3:_(s64) = G_CONSTANT i64 -8
    %2:_(p0) = G_INTTOPTR %3(s64)
    %6:_(s64) = G_CONSTANT i64 -16
    %5:_(p0) = G_INTTOPTR %6(s64)
    %10:_(s1) = G_CONSTANT i1 false

  bb.2:
    successors: %bb.4(0x60000000), %bb.3(0x20000000)

    %0:_(p0) = G_LOAD %1(p0) :: (load (p0))
    %4:_(s1) = G_ICMP intpred(eq), %0(p0), %2
    %7:_(s1) = G_ICMP intpred(eq), %0(p0), %5
    %8:_(s1) = G_OR %4, %7
    %9:_(s1) = G_SELECT %8(s1), %10, %10
    G_BRCOND %8(s1), %bb.4
    G_BR %bb.3

  bb.4:
    successors: %bb.2(0x55555555), %bb.3(0x2aaaaaab)

    G_BRCOND %10(s1), %bb.2
    G_BR %bb.3

  bb.3:
    G_BR %bb.2

...