xref: /llvm-project/llvm/test/Transforms/InstCombine/vscale_cmp.ll (revision 56c091ea7106507b36015297ee9005c9d5fab0bf)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -passes=instcombine -S | FileCheck %s
3
4define <vscale x 2 x i1> @sge(<vscale x 2 x i8> %x) {
5; CHECK-LABEL: @sge(
6; CHECK-NEXT:    [[CMP:%.*]] = icmp sgt <vscale x 2 x i8> [[X:%.*]], splat (i8 -1)
7; CHECK-NEXT:    ret <vscale x 2 x i1> [[CMP]]
8;
9  %cmp = icmp sge <vscale x 2 x i8> %x, zeroinitializer
10  ret <vscale x 2 x i1> %cmp
11}
12
13define <vscale x 2 x i1> @gep_scalevector1(ptr %X) nounwind {
14; CHECK-LABEL: @gep_scalevector1(
15; CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 2 x ptr> poison, ptr [[X:%.*]], i64 0
16; CHECK-NEXT:    [[TMP1:%.*]] = icmp eq <vscale x 2 x ptr> [[DOTSPLATINSERT]], zeroinitializer
17; CHECK-NEXT:    [[C:%.*]] = shufflevector <vscale x 2 x i1> [[TMP1]], <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
18; CHECK-NEXT:    ret <vscale x 2 x i1> [[C]]
19;
20  %A = getelementptr inbounds i32, ptr %X, <vscale x 2 x i64> zeroinitializer
21  %C = icmp eq <vscale x 2 x ptr> %A, zeroinitializer
22  ret <vscale x 2 x i1> %C
23}
24
25define <vscale x 2 x i1> @signbit_bitcast_fpext_scalevec(<vscale x 2 x half> %x) {
26; CHECK-LABEL: @signbit_bitcast_fpext_scalevec(
27; CHECK-NEXT:    [[TMP1:%.*]] = bitcast <vscale x 2 x half> [[X:%.*]] to <vscale x 2 x i16>
28; CHECK-NEXT:    [[R:%.*]] = icmp slt <vscale x 2 x i16> [[TMP1]], zeroinitializer
29; CHECK-NEXT:    ret <vscale x 2 x i1> [[R]]
30;
31  %f = fpext <vscale x 2 x half> %x to <vscale x 2 x float>
32  %b = bitcast <vscale x 2 x float> %f to <vscale x 2 x i32>
33  %r = icmp slt <vscale x 2 x i32> %b, zeroinitializer
34  ret <vscale x 2 x i1> %r
35}
36