[llvm] r276476 - add tests for icmp vector folds
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 22 14:28:21 PDT 2016
Author: spatel
Date: Fri Jul 22 16:28:20 2016
New Revision: 276476
URL: http://llvm.org/viewvc/llvm-project?rev=276476&view=rev
Log:
add tests for icmp vector folds
Modified:
llvm/trunk/test/Transforms/InstCombine/icmp.ll
Modified: llvm/trunk/test/Transforms/InstCombine/icmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/icmp.ll?rev=276476&r1=276475&r2=276476&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/icmp.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/icmp.ll Fri Jul 22 16:28:20 2016
@@ -1186,6 +1186,18 @@ define i1 @icmp_mul_neq0(i32 %x) {
ret i1 %cmp
}
+; FIXME: Vectors should fold the same way.
+define <2 x i1> @icmp_mul_neq0_vec(<2 x i32> %x) {
+; CHECK-LABEL: @icmp_mul_neq0_vec(
+; CHECK-NEXT: [[MUL:%.*]] = mul nsw <2 x i32> %x, <i32 -12, i32 -12>
+; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[MUL]], zeroinitializer
+; CHECK-NEXT: ret <2 x i1> [[CMP]]
+;
+ %mul = mul nsw <2 x i32> %x, <i32 -12, i32 -12>
+ %cmp = icmp ne <2 x i32> %mul, zeroinitializer
+ ret <2 x i1> %cmp
+}
+
define i1 @icmp_mul_eq0(i32 %x) {
; CHECK-LABEL: @icmp_mul_eq0(
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 %x, 0
@@ -2005,6 +2017,18 @@ define i1 @cmp_inverse_mask_bits_set_eq(
ret i1 %cmp
}
+; FIXME: Vectors should fold the same way.
+define <2 x i1> @cmp_inverse_mask_bits_set_eq_vec(<2 x i32> %x) {
+; CHECK-LABEL: @cmp_inverse_mask_bits_set_eq_vec(
+; CHECK-NEXT: [[OR:%.*]] = or <2 x i32> %x, <i32 42, i32 42>
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i32> [[OR]], <i32 -1, i32 -1>
+; CHECK-NEXT: ret <2 x i1> [[CMP]]
+;
+ %or = or <2 x i32> %x, <i32 42, i32 42>
+ %cmp = icmp eq <2 x i32> %or, <i32 -1, i32 -1>
+ ret <2 x i1> %cmp
+}
+
define i1 @cmp_inverse_mask_bits_set_ne(i32 %x) {
; CHECK-LABEL: @cmp_inverse_mask_bits_set_ne(
; CHECK-NEXT: [[TMP1:%.*]] = and i32 %x, -43
More information about the llvm-commits
mailing list