55 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -passes=instcombine -S | FileCheck %s3 4define i1 @cmp_x_and_negp2_with_eq(i8 %x) {5; CHECK-LABEL: @cmp_x_and_negp2_with_eq(6; CHECK-NEXT: [[R:%.*]] = icmp slt i8 [[X:%.*]], -1267; CHECK-NEXT: ret i1 [[R]]8;9 %andx = and i8 %x, -210 %r = icmp eq i8 %andx, 12811 ret i1 %r12}13 14define i1 @cmp_x_and_negp2_with_eq_fail_not_signmask(i8 %x) {15; CHECK-LABEL: @cmp_x_and_negp2_with_eq_fail_not_signmask(16; CHECK-NEXT: [[ANDX:%.*]] = and i8 [[X:%.*]], -217; CHECK-NEXT: [[R:%.*]] = icmp eq i8 [[ANDX]], -12418; CHECK-NEXT: ret i1 [[R]]19;20 %andx = and i8 %x, -221 %r = icmp eq i8 %andx, 13222 ret i1 %r23}24 25define <2 x i1> @cmp_x_and_negp2_with_ne(<2 x i8> %x) {26; CHECK-LABEL: @cmp_x_and_negp2_with_ne(27; CHECK-NEXT: [[R:%.*]] = icmp sgt <2 x i8> [[X:%.*]], <i8 -121, i8 -113>28; CHECK-NEXT: ret <2 x i1> [[R]]29;30 %andx = and <2 x i8> %x, <i8 -8, i8 -16>31 %r = icmp ne <2 x i8> %andx, <i8 128, i8 128>32 ret <2 x i1> %r33}34 35define <2 x i1> @cmp_x_and_negp2_with_ne_or_z(<2 x i8> %x) {36; CHECK-LABEL: @cmp_x_and_negp2_with_ne_or_z(37; CHECK-NEXT: [[R:%.*]] = icmp sge <2 x i8> [[X:%.*]], <i8 -128, i8 -112>38; CHECK-NEXT: ret <2 x i1> [[R]]39;40 %andx = and <2 x i8> %x, <i8 0, i8 -16>41 %r = icmp ne <2 x i8> %andx, <i8 128, i8 128>42 ret <2 x i1> %r43}44 45define <2 x i1> @cmp_x_and_negp2_with_ne_fail_not_p2(<2 x i8> %x) {46; CHECK-LABEL: @cmp_x_and_negp2_with_ne_fail_not_p2(47; CHECK-NEXT: [[ANDX:%.*]] = and <2 x i8> [[X:%.*]], <i8 -8, i8 -15>48; CHECK-NEXT: [[R:%.*]] = icmp ne <2 x i8> [[ANDX]], splat (i8 -128)49; CHECK-NEXT: ret <2 x i1> [[R]]50;51 %andx = and <2 x i8> %x, <i8 -8, i8 -15>52 %r = icmp ne <2 x i8> %andx, <i8 128, i8 128>53 ret <2 x i1> %r54}55