[llvm] r335261 - [InstCombine] add vector icmp tests with undefs; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 21 10:37:14 PDT 2018


Author: spatel
Date: Thu Jun 21 10:37:14 2018
New Revision: 335261

URL: http://llvm.org/viewvc/llvm-project?rev=335261&view=rev
Log:
[InstCombine] add vector icmp tests with undefs; NFC

Modified:
    llvm/trunk/test/Transforms/InstCombine/vec_sext.ll

Modified: llvm/trunk/test/Transforms/InstCombine/vec_sext.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/vec_sext.ll?rev=335261&r1=335260&r2=335261&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/vec_sext.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/vec_sext.ll Thu Jun 21 10:37:14 2018
@@ -45,3 +45,26 @@ define <4 x i32> @test1(<4 x i32> %a, <4
   ret <4 x i32> %cond
 }
 
+define <2 x i32> @is_negative_undef_elt(<2 x i32> %a) {
+; CHECK-LABEL: @is_negative_undef_elt(
+; CHECK-NEXT:    [[CMP:%.*]] = icmp slt <2 x i32> [[A:%.*]], <i32 0, i32 undef>
+; CHECK-NEXT:    [[SEXT:%.*]] = sext <2 x i1> [[CMP]] to <2 x i32>
+; CHECK-NEXT:    ret <2 x i32> [[SEXT]]
+;
+  %cmp = icmp slt <2 x i32> %a, <i32 0, i32 undef>
+  %sext = sext <2 x i1> %cmp to <2 x i32>
+  ret <2 x i32> %sext
+
+}
+
+define <2 x i32> @is_positive_undef_elt(<2 x i32> %a) {
+; CHECK-LABEL: @is_positive_undef_elt(
+; CHECK-NEXT:    [[CMP:%.*]] = icmp sgt <2 x i32> [[A:%.*]], <i32 undef, i32 -1>
+; CHECK-NEXT:    [[SEXT:%.*]] = sext <2 x i1> [[CMP]] to <2 x i32>
+; CHECK-NEXT:    ret <2 x i32> [[SEXT]]
+;
+  %cmp = icmp sgt <2 x i32> %a, <i32 undef, i32 -1>
+  %sext = sext <2 x i1> %cmp to <2 x i32>
+  ret <2 x i32> %sext
+}
+




More information about the llvm-commits mailing list