[InstCombine] add test for missing vector optimization

llvm-svn: 271808
This commit is contained in:
Sanjay Patel 2016-06-04 21:41:25 +00:00
parent c774f8c265
commit 8e63999bee
1 changed files with 15 additions and 2 deletions

View File

@ -209,11 +209,24 @@ define i1 @test19(i32 %X) {
; CHECK-NEXT: [[Z:%.*]] = icmp slt i32 %X, 12345
; CHECK-NEXT: ret i1 [[Z]]
;
%c = sext i32 %X to i64 ; <i64> [#uses=1]
%Z = icmp slt i64 %c, 12345 ; <i1> [#uses=1]
%c = sext i32 %X to i64
%Z = icmp slt i64 %c, 12345
ret i1 %Z
}
; FIXME: Vector should be the same as scalar.
define <2 x i1> @test19vec(<2 x i32> %X) {
; CHECK-LABEL: @test19vec(
; CHECK-NEXT: [[C:%.*]] = sext <2 x i32> %X to <2 x i64>
; CHECK-NEXT: [[Z:%.*]] = icmp slt <2 x i64> [[C]], <i64 12345, i64 2147483647>
; CHECK-NEXT: ret <2 x i1> [[Z]]
;
%c = sext <2 x i32> %X to <2 x i64>
%Z = icmp slt <2 x i64> %c, <i64 12345, i64 2147483647>
ret <2 x i1> %Z
}
define i1 @test20(i1 %B) {
; CHECK-LABEL: @test20(
; CHECK-NEXT: ret i1 false