[InstSimplify] add tests with vector undef elts; NFC
authorSanjay Patel <spatel@rotateright.com>
Sun, 18 Feb 2018 17:39:09 +0000 (17:39 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 18 Feb 2018 17:39:09 +0000 (17:39 +0000)
llvm-svn: 325465

llvm/test/Transforms/InstSimplify/or.ll
llvm/test/Transforms/InstSimplify/shr-nop.ll

index 14b08af..e9b61b5 100644 (file)
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt < %s -instsimplify -S | FileCheck %s
 
 define i32 @test1(i32 %A) {
@@ -8,20 +9,21 @@ define i32 @test1(i32 %A) {
   ret i32 %B
 }
 
-define i32 @test2(i32 %A) {
-; CHECK-LABEL: @test2(
+define i32 @all_ones(i32 %A) {
+; CHECK-LABEL: @all_ones(
 ; CHECK-NEXT:    ret i32 -1
 ;
   %B = or i32 %A, -1
   ret i32 %B
 }
 
-define i8 @test2a(i8 %A) {
-; CHECK-LABEL: @test2a(
-; CHECK-NEXT:    ret i8 -1
+define <3 x i8> @all_ones_vec_with_undef_elt(<3 x i8> %A) {
+; CHECK-LABEL: @all_ones_vec_with_undef_elt(
+; CHECK-NEXT:    [[B:%.*]] = or <3 x i8> [[A:%.*]], <i8 -1, i8 undef, i8 -1>
+; CHECK-NEXT:    ret <3 x i8> [[B]]
 ;
-  %B = or i8 %A, -1
-  ret i8 %B
+  %B = or <3 x i8> %A, <i8 -1, i8 undef, i8 -1>
+  ret <3 x i8> %B
 }
 
 define i1 @test3(i1 %A) {
index 9b0f4e9..c0bdcaa 100644 (file)
@@ -193,6 +193,15 @@ define i1 @ashr_ne_first_zero(i8 %a) {
   ret i1 %cmp
 }
 
+define <3 x i8> @ashr_all_ones_vec_with_undef_elts(<3 x i8> %x, <3 x i8> %y) {
+; CHECK-LABEL: @ashr_all_ones_vec_with_undef_elts(
+; CHECK-NEXT:    [[SH:%.*]] = ashr <3 x i8> <i8 undef, i8 -1, i8 undef>, [[Y:%.*]]
+; CHECK-NEXT:    ret <3 x i8> [[SH]]
+;
+  %sh = ashr <3 x i8> <i8 undef, i8 -1, i8 undef>, %y
+  ret <3 x i8> %sh
+}
+
 define i1 @ashr_eq_both_minus1(i8 %a) {
 ; CHECK-LABEL: @ashr_eq_both_minus1(
 ; CHECK-NEXT:    ret i1 true