[llvm] r274876 - add vector tests to show missing transform

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 8 09:39:53 PDT 2016


Author: spatel
Date: Fri Jul  8 11:39:53 2016
New Revision: 274876

URL: http://llvm.org/viewvc/llvm-project?rev=274876&view=rev
Log:
add vector tests to show missing transform

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

Modified: llvm/trunk/test/Transforms/InstCombine/or.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/or.ll?rev=274876&r1=274875&r2=274876&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/or.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/or.ll Fri Jul  8 11:39:53 2016
@@ -445,6 +445,28 @@ define i32 @orsext_to_sel_swap(i32 %x, i
   ret i32 %or
 }
 
+define <2 x i32> @orsext_to_sel_vec(<2 x i32> %x, <2 x i1> %y) {
+; CHECK-LABEL: @orsext_to_sel_vec(
+; CHECK-NEXT:    [[SEXT:%.*]] = sext <2 x i1> %y to <2 x i32>
+; CHECK-NEXT:    [[OR:%.*]] = or <2 x i32> [[SEXT]], %x
+; CHECK-NEXT:    ret <2 x i32> [[OR]]
+;
+  %sext = sext <2 x i1> %y to <2 x i32>
+  %or = or <2 x i32> %sext, %x
+  ret <2 x i32> %or
+}
+
+define <2 x i132> @orsext_to_sel_vec_swap(<2 x i132> %x, <2 x i1> %y) {
+; CHECK-LABEL: @orsext_to_sel_vec_swap(
+; CHECK-NEXT:    [[SEXT:%.*]] = sext <2 x i1> %y to <2 x i132>
+; CHECK-NEXT:    [[OR:%.*]] = or <2 x i132> [[SEXT]], %x
+; CHECK-NEXT:    ret <2 x i132> [[OR]]
+;
+  %sext = sext <2 x i1> %y to <2 x i132>
+  %or = or <2 x i132> %x, %sext
+  ret <2 x i132> %or
+}
+
 define i32 @test39(i32 %a, i32 %b) {
 ; CHECK-LABEL: @test39(
 ; CHECK-NEXT:    [[OR:%.*]] = or i32 %a, %b




More information about the llvm-commits mailing list