1 ; RUN: opt -vector-combine -S %s | FileCheck %s
3 ; Negative test for extract + cmp + binop - don't try this with scalable vectors.
4 ; Moved from X86/extract-cmp-binop.ll
6 define i1 @scalable(<vscale x 4 x i32> %a) {
7 ; CHECK-LABEL: @scalable(
8 ; CHECK-NEXT: [[E1:%.*]] = extractelement <vscale x 4 x i32> [[A:%.*]], i32 3
9 ; CHECK-NEXT: [[E2:%.*]] = extractelement <vscale x 4 x i32> [[A]], i32 1
10 ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i32 [[E1]], 42
11 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[E2]], -8
12 ; CHECK-NEXT: [[R:%.*]] = xor i1 [[CMP1]], [[CMP2]]
13 ; CHECK-NEXT: ret i1 [[R]]
15 %e1 = extractelement <vscale x 4 x i32> %a, i32 3
16 %e2 = extractelement <vscale x 4 x i32> %a, i32 1
17 %cmp1 = icmp sgt i32 %e1, 42
18 %cmp2 = icmp sgt i32 %e2, -8
19 %r = xor i1 %cmp1, %cmp2