1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

regenerate checks

llvm-svn: 271904
This commit is contained in:
Sanjay Patel 2016-06-06 16:03:06 +00:00
parent 95a34fb288
commit 810d7e88a4

View File

@ -1,6 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; This test case tests the InstructionCombining optimization that ; This test case tests the InstructionCombining optimization that
; reduces things like: ; reduces things like:
; %Y = sext i8 %X to i32 ; %Y = sext i8 %X to i32
; %C = icmp ult i32 %Y, 1024 ; %C = icmp ult i32 %Y, 1024
; to ; to
; %C = i1 true ; %C = i1 true
@ -10,183 +11,231 @@
; constant value and the range of the casted value. ; constant value and the range of the casted value.
; ;
; RUN: opt < %s -instcombine -S | FileCheck %s ; RUN: opt < %s -instcombine -S | FileCheck %s
; END.
define i1 @lt_signed_to_large_unsigned(i8 %SB) { define i1 @lt_signed_to_large_unsigned(i8 %SB) {
%Y = sext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @lt_signed_to_large_unsigned(
%C = icmp ult i32 %Y, 1024 ; <i1> [#uses=1] ; CHECK-NEXT: [[C1:%.*]] = icmp sgt i8 %SB, -1
ret i1 %C ; CHECK-NEXT: ret i1 [[C1]]
; CHECK: %C1 = icmp sgt i8 %SB, -1 ;
; CHECK: ret i1 %C1 %Y = sext i8 %SB to i32
%C = icmp ult i32 %Y, 1024
ret i1 %C
} }
define i1 @lt_signed_to_large_signed(i8 %SB) { define i1 @lt_signed_to_large_signed(i8 %SB) {
%Y = sext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @lt_signed_to_large_signed(
%C = icmp slt i32 %Y, 1024 ; <i1> [#uses=1] ; CHECK-NEXT: ret i1 true
ret i1 %C ;
; CHECK: ret i1 true %Y = sext i8 %SB to i32
%C = icmp slt i32 %Y, 1024
ret i1 %C
} }
define i1 @lt_signed_to_large_negative(i8 %SB) { define i1 @lt_signed_to_large_negative(i8 %SB) {
%Y = sext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @lt_signed_to_large_negative(
%C = icmp slt i32 %Y, -1024 ; <i1> [#uses=1] ; CHECK-NEXT: ret i1 false
ret i1 %C ;
; CHECK: ret i1 false %Y = sext i8 %SB to i32
%C = icmp slt i32 %Y, -1024
ret i1 %C
} }
define i1 @lt_signed_to_small_unsigned(i8 %SB) { define i1 @lt_signed_to_small_unsigned(i8 %SB) {
%Y = sext i8 %SB to i32 ; CHECK-LABEL: @lt_signed_to_small_unsigned(
%C = icmp ult i32 %Y, 17 ; CHECK-NEXT: [[C:%.*]] = icmp ult i8 %SB, 17
ret i1 %C ; CHECK-NEXT: ret i1 [[C]]
; CHECK: %C = icmp ult i8 %SB, 17 ;
; CHECK: ret i1 %C %Y = sext i8 %SB to i32
%C = icmp ult i32 %Y, 17
ret i1 %C
} }
define i1 @lt_signed_to_small_signed(i8 %SB) { define i1 @lt_signed_to_small_signed(i8 %SB) {
%Y = sext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @lt_signed_to_small_signed(
%C = icmp slt i32 %Y, 17 ; <i1> [#uses=1] ; CHECK-NEXT: [[C:%.*]] = icmp slt i8 %SB, 17
ret i1 %C ; CHECK-NEXT: ret i1 [[C]]
; CHECK: %C = icmp slt i8 %SB, 17 ;
; CHECK: ret i1 %C %Y = sext i8 %SB to i32
%C = icmp slt i32 %Y, 17
ret i1 %C
} }
define i1 @lt_signed_to_small_negative(i8 %SB) { define i1 @lt_signed_to_small_negative(i8 %SB) {
%Y = sext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @lt_signed_to_small_negative(
%C = icmp slt i32 %Y, -17 ; <i1> [#uses=1] ; CHECK-NEXT: [[C:%.*]] = icmp slt i8 %SB, -17
ret i1 %C ; CHECK-NEXT: ret i1 [[C]]
; CHECK: %C = icmp slt i8 %SB, -17 ;
; CHECK: ret i1 %C %Y = sext i8 %SB to i32
%C = icmp slt i32 %Y, -17
ret i1 %C
} }
define i1 @lt_unsigned_to_large_unsigned(i8 %SB) { define i1 @lt_unsigned_to_large_unsigned(i8 %SB) {
%Y = zext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @lt_unsigned_to_large_unsigned(
%C = icmp ult i32 %Y, 1024 ; <i1> [#uses=1] ; CHECK-NEXT: ret i1 true
ret i1 %C ;
; CHECK: ret i1 true %Y = zext i8 %SB to i32
%C = icmp ult i32 %Y, 1024
ret i1 %C
} }
define i1 @lt_unsigned_to_large_signed(i8 %SB) { define i1 @lt_unsigned_to_large_signed(i8 %SB) {
%Y = zext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @lt_unsigned_to_large_signed(
%C = icmp slt i32 %Y, 1024 ; <i1> [#uses=1] ; CHECK-NEXT: ret i1 true
ret i1 %C ;
; CHECK: ret i1 true %Y = zext i8 %SB to i32
%C = icmp slt i32 %Y, 1024
ret i1 %C
} }
define i1 @lt_unsigned_to_large_negative(i8 %SB) { define i1 @lt_unsigned_to_large_negative(i8 %SB) {
%Y = zext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @lt_unsigned_to_large_negative(
%C = icmp slt i32 %Y, -1024 ; <i1> [#uses=1] ; CHECK-NEXT: ret i1 false
ret i1 %C ;
; CHECK: ret i1 false %Y = zext i8 %SB to i32
%C = icmp slt i32 %Y, -1024
ret i1 %C
} }
define i1 @lt_unsigned_to_small_unsigned(i8 %SB) { define i1 @lt_unsigned_to_small_unsigned(i8 %SB) {
%Y = zext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @lt_unsigned_to_small_unsigned(
%C = icmp ult i32 %Y, 17 ; <i1> [#uses=1] ; CHECK-NEXT: [[C:%.*]] = icmp ult i8 %SB, 17
ret i1 %C ; CHECK-NEXT: ret i1 [[C]]
; CHECK: %C = icmp ult i8 %SB, 17 ;
; CHECK: ret i1 %C %Y = zext i8 %SB to i32
%C = icmp ult i32 %Y, 17
ret i1 %C
} }
define i1 @lt_unsigned_to_small_signed(i8 %SB) { define i1 @lt_unsigned_to_small_signed(i8 %SB) {
%Y = zext i8 %SB to i32 ; CHECK-LABEL: @lt_unsigned_to_small_signed(
%C = icmp slt i32 %Y, 17 ; CHECK-NEXT: [[C:%.*]] = icmp ult i8 %SB, 17
ret i1 %C ; CHECK-NEXT: ret i1 [[C]]
; CHECK: %C = icmp ult i8 %SB, 17 ;
; CHECK: ret i1 %C %Y = zext i8 %SB to i32
%C = icmp slt i32 %Y, 17
ret i1 %C
} }
define i1 @lt_unsigned_to_small_negative(i8 %SB) { define i1 @lt_unsigned_to_small_negative(i8 %SB) {
%Y = zext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @lt_unsigned_to_small_negative(
%C = icmp slt i32 %Y, -17 ; <i1> [#uses=1] ; CHECK-NEXT: ret i1 false
ret i1 %C ;
; CHECK: ret i1 false %Y = zext i8 %SB to i32
%C = icmp slt i32 %Y, -17
ret i1 %C
} }
define i1 @gt_signed_to_large_unsigned(i8 %SB) { define i1 @gt_signed_to_large_unsigned(i8 %SB) {
%Y = sext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @gt_signed_to_large_unsigned(
%C = icmp ugt i32 %Y, 1024 ; <i1> [#uses=1] ; CHECK-NEXT: [[C:%.*]] = icmp slt i8 %SB, 0
ret i1 %C ; CHECK-NEXT: ret i1 [[C]]
; CHECK: %C = icmp slt i8 %SB, 0 ;
; CHECK: ret i1 %C %Y = sext i8 %SB to i32
%C = icmp ugt i32 %Y, 1024
ret i1 %C
} }
define i1 @gt_signed_to_large_signed(i8 %SB) { define i1 @gt_signed_to_large_signed(i8 %SB) {
%Y = sext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @gt_signed_to_large_signed(
%C = icmp sgt i32 %Y, 1024 ; <i1> [#uses=1] ; CHECK-NEXT: ret i1 false
ret i1 %C ;
; CHECK: ret i1 false %Y = sext i8 %SB to i32
%C = icmp sgt i32 %Y, 1024
ret i1 %C
} }
define i1 @gt_signed_to_large_negative(i8 %SB) { define i1 @gt_signed_to_large_negative(i8 %SB) {
%Y = sext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @gt_signed_to_large_negative(
%C = icmp sgt i32 %Y, -1024 ; <i1> [#uses=1] ; CHECK-NEXT: ret i1 true
ret i1 %C ;
; CHECK: ret i1 true %Y = sext i8 %SB to i32
%C = icmp sgt i32 %Y, -1024
ret i1 %C
} }
define i1 @gt_signed_to_small_unsigned(i8 %SB) { define i1 @gt_signed_to_small_unsigned(i8 %SB) {
%Y = sext i8 %SB to i32 ; CHECK-LABEL: @gt_signed_to_small_unsigned(
%C = icmp ugt i32 %Y, 17 ; CHECK-NEXT: [[C:%.*]] = icmp ugt i8 %SB, 17
ret i1 %C ; CHECK-NEXT: ret i1 [[C]]
; CHECK: %C = icmp ugt i8 %SB, 17 ;
; CHECK: ret i1 %C %Y = sext i8 %SB to i32
%C = icmp ugt i32 %Y, 17
ret i1 %C
} }
define i1 @gt_signed_to_small_signed(i8 %SB) { define i1 @gt_signed_to_small_signed(i8 %SB) {
%Y = sext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @gt_signed_to_small_signed(
%C = icmp sgt i32 %Y, 17 ; <i1> [#uses=1] ; CHECK-NEXT: [[C:%.*]] = icmp sgt i8 %SB, 17
ret i1 %C ; CHECK-NEXT: ret i1 [[C]]
; CHECK: %C = icmp sgt i8 %SB, 17 ;
; CHECK: ret i1 %C %Y = sext i8 %SB to i32
%C = icmp sgt i32 %Y, 17
ret i1 %C
} }
define i1 @gt_signed_to_small_negative(i8 %SB) { define i1 @gt_signed_to_small_negative(i8 %SB) {
%Y = sext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @gt_signed_to_small_negative(
%C = icmp sgt i32 %Y, -17 ; <i1> [#uses=1] ; CHECK-NEXT: [[C:%.*]] = icmp sgt i8 %SB, -17
ret i1 %C ; CHECK-NEXT: ret i1 [[C]]
; CHECK: %C = icmp sgt i8 %SB, -17 ;
; CHECK: ret i1 %C %Y = sext i8 %SB to i32
%C = icmp sgt i32 %Y, -17
ret i1 %C
} }
define i1 @gt_unsigned_to_large_unsigned(i8 %SB) { define i1 @gt_unsigned_to_large_unsigned(i8 %SB) {
%Y = zext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @gt_unsigned_to_large_unsigned(
%C = icmp ugt i32 %Y, 1024 ; <i1> [#uses=1] ; CHECK-NEXT: ret i1 false
ret i1 %C ;
; CHECK: ret i1 false %Y = zext i8 %SB to i32
%C = icmp ugt i32 %Y, 1024
ret i1 %C
} }
define i1 @gt_unsigned_to_large_signed(i8 %SB) { define i1 @gt_unsigned_to_large_signed(i8 %SB) {
%Y = zext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @gt_unsigned_to_large_signed(
%C = icmp sgt i32 %Y, 1024 ; <i1> [#uses=1] ; CHECK-NEXT: ret i1 false
ret i1 %C ;
; CHECK: ret i1 false %Y = zext i8 %SB to i32
%C = icmp sgt i32 %Y, 1024
ret i1 %C
} }
define i1 @gt_unsigned_to_large_negative(i8 %SB) { define i1 @gt_unsigned_to_large_negative(i8 %SB) {
%Y = zext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @gt_unsigned_to_large_negative(
%C = icmp sgt i32 %Y, -1024 ; <i1> [#uses=1] ; CHECK-NEXT: ret i1 true
ret i1 %C ;
; CHECK: ret i1 true %Y = zext i8 %SB to i32
%C = icmp sgt i32 %Y, -1024
ret i1 %C
} }
define i1 @gt_unsigned_to_small_unsigned(i8 %SB) { define i1 @gt_unsigned_to_small_unsigned(i8 %SB) {
%Y = zext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @gt_unsigned_to_small_unsigned(
%C = icmp ugt i32 %Y, 17 ; <i1> [#uses=1] ; CHECK-NEXT: [[C:%.*]] = icmp ugt i8 %SB, 17
ret i1 %C ; CHECK-NEXT: ret i1 [[C]]
; CHECK: %C = icmp ugt i8 %SB, 17 ;
; CHECK: ret i1 %C %Y = zext i8 %SB to i32
%C = icmp ugt i32 %Y, 17
ret i1 %C
} }
define i1 @gt_unsigned_to_small_signed(i8 %SB) { define i1 @gt_unsigned_to_small_signed(i8 %SB) {
%Y = zext i8 %SB to i32 ; CHECK-LABEL: @gt_unsigned_to_small_signed(
%C = icmp sgt i32 %Y, 17 ; CHECK-NEXT: [[C:%.*]] = icmp ugt i8 %SB, 17
ret i1 %C ; CHECK-NEXT: ret i1 [[C]]
; CHECK: %C = icmp ugt i8 %SB, 17 ;
; CHECK: ret i1 %C %Y = zext i8 %SB to i32
%C = icmp sgt i32 %Y, 17
ret i1 %C
} }
define i1 @gt_unsigned_to_small_negative(i8 %SB) { define i1 @gt_unsigned_to_small_negative(i8 %SB) {
%Y = zext i8 %SB to i32 ; <i32> [#uses=1] ; CHECK-LABEL: @gt_unsigned_to_small_negative(
%C = icmp sgt i32 %Y, -17 ; <i1> [#uses=1] ; CHECK-NEXT: ret i1 true
ret i1 %C ;
; CHECK: ret i1 true %Y = zext i8 %SB to i32
%C = icmp sgt i32 %Y, -17
ret i1 %C
} }