[llvm] r325465 - [InstSimplify] add tests with vector undef elts; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 18 09:39:09 PST 2018
Author: spatel
Date: Sun Feb 18 09:39:09 2018
New Revision: 325465
URL: http://llvm.org/viewvc/llvm-project?rev=325465&view=rev
Log:
[InstSimplify] add tests with vector undef elts; NFC
Modified:
llvm/trunk/test/Transforms/InstSimplify/or.ll
llvm/trunk/test/Transforms/InstSimplify/shr-nop.ll
Modified: llvm/trunk/test/Transforms/InstSimplify/or.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstSimplify/or.ll?rev=325465&r1=325464&r2=325465&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstSimplify/or.ll (original)
+++ llvm/trunk/test/Transforms/InstSimplify/or.ll Sun Feb 18 09:39:09 2018
@@ -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) {
Modified: llvm/trunk/test/Transforms/InstSimplify/shr-nop.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstSimplify/shr-nop.ll?rev=325465&r1=325464&r2=325465&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstSimplify/shr-nop.ll (original)
+++ llvm/trunk/test/Transforms/InstSimplify/shr-nop.ll Sun Feb 18 09:39:09 2018
@@ -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
More information about the llvm-commits
mailing list