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

minimize tests and auto-generate checks

llvm-svn: 276147
This commit is contained in:
Sanjay Patel 2016-07-20 17:58:20 +00:00
parent d160a578e0
commit 7db103a213

View File

@ -1,94 +1,68 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -instcombine < %s | FileCheck %s ; RUN: opt -S -instcombine < %s | FileCheck %s
declare void @foo() declare void @foo()
define void @test1(i32 %a, i32 %b) nounwind { define i1 @test1(i32 %a, i32 %b) {
%1 = icmp slt i32 %a, 0
%2 = icmp slt i32 %b, 0
%or.cond = or i1 %1, %2
br i1 %or.cond, label %if.then, label %if.end
; CHECK-LABEL: @test1( ; CHECK-LABEL: @test1(
; CHECK-NEXT: %1 = or i32 %a, %b ; CHECK-NEXT: [[TMP1:%.*]] = or i32 %a, %b
; CHECK-NEXT: %2 = icmp slt i32 %1, 0 ; CHECK-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP1]], 0
; CHECK-NEXT: br ; CHECK-NEXT: ret i1 [[TMP2]]
;
if.then: %1 = icmp slt i32 %a, 0
tail call void @foo() nounwind %2 = icmp slt i32 %b, 0
ret void %or.cond = or i1 %1, %2
ret i1 %or.cond
if.end:
ret void
} }
define void @test2(i32 %a, i32 %b) nounwind { define i1 @test2(i32 %a, i32 %b) {
; CHECK-LABEL: @test2(
; CHECK-NEXT: [[TMP1:%.*]] = and i32 %a, %b
; CHECK-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[TMP1]], -1
; CHECK-NEXT: ret i1 [[TMP2]]
;
%1 = icmp sgt i32 %a, -1 %1 = icmp sgt i32 %a, -1
%2 = icmp sgt i32 %b, -1 %2 = icmp sgt i32 %b, -1
%or.cond = or i1 %1, %2 %or.cond = or i1 %1, %2
br i1 %or.cond, label %if.then, label %if.end ret i1 %or.cond
; CHECK-LABEL: @test2(
; CHECK-NEXT: %1 = and i32 %a, %b
; CHECK-NEXT: %2 = icmp sgt i32 %1, -1
; CHECK-NEXT: br
if.then:
tail call void @foo() nounwind
ret void
if.end:
ret void
} }
define void @test3(i32 %a, i32 %b) nounwind { define i1 @test3(i32 %a, i32 %b) {
; CHECK-LABEL: @test3(
; CHECK-NEXT: [[TMP1:%.*]] = and i32 %a, %b
; CHECK-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP1]], 0
; CHECK-NEXT: ret i1 [[TMP2]]
;
%1 = icmp slt i32 %a, 0 %1 = icmp slt i32 %a, 0
%2 = icmp slt i32 %b, 0 %2 = icmp slt i32 %b, 0
%or.cond = and i1 %1, %2 %or.cond = and i1 %1, %2
br i1 %or.cond, label %if.then, label %if.end ret i1 %or.cond
; CHECK-LABEL: @test3(
; CHECK-NEXT: %1 = and i32 %a, %b
; CHECK-NEXT: %2 = icmp slt i32 %1, 0
; CHECK-NEXT: br
if.then:
tail call void @foo() nounwind
ret void
if.end:
ret void
} }
define void @test4(i32 %a, i32 %b) nounwind { define i1 @test4(i32 %a, i32 %b) {
; CHECK-LABEL: @test4(
; CHECK-NEXT: [[TMP1:%.*]] = or i32 %a, %b
; CHECK-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[TMP1]], -1
; CHECK-NEXT: ret i1 [[TMP2]]
;
%1 = icmp sgt i32 %a, -1 %1 = icmp sgt i32 %a, -1
%2 = icmp sgt i32 %b, -1 %2 = icmp sgt i32 %b, -1
%or.cond = and i1 %1, %2 %or.cond = and i1 %1, %2
br i1 %or.cond, label %if.then, label %if.end ret i1 %or.cond
; CHECK-LABEL: @test4(
; CHECK-NEXT: %1 = or i32 %a, %b
; CHECK-NEXT: %2 = icmp sgt i32 %1, -1
; CHECK-NEXT: br
if.then:
tail call void @foo() nounwind
ret void
if.end:
ret void
} }
define void @test5(i32 %a) nounwind { define void @test5(i32 %a) {
; CHECK-LABEL: @test5(
; CHECK-NEXT: [[TMP1:%.*]] = and i32 %a, -2013265920
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 0
; CHECK-NEXT: br i1 [[TMP2]], label %if.then, label %if.end
;
%and = and i32 %a, 134217728 %and = and i32 %a, 134217728
%1 = icmp eq i32 %and, 0 %1 = icmp eq i32 %and, 0
%2 = icmp sgt i32 %a, -1 %2 = icmp sgt i32 %a, -1
%or.cond = and i1 %1, %2 %or.cond = and i1 %1, %2
br i1 %or.cond, label %if.then, label %if.end br i1 %or.cond, label %if.then, label %if.end
; CHECK-LABEL: @test5(
; CHECK-NEXT: %1 = and i32 %a, -2013265920
; CHECK-NEXT: %2 = icmp eq i32 %1, 0
; CHECK-NEXT: br i1 %2, label %if.then, label %if.end
if.then: if.then:
tail call void @foo() nounwind tail call void @foo() nounwind
@ -98,17 +72,18 @@ if.end:
ret void ret void
} }
define void @test6(i32 %a) nounwind { define void @test6(i32 %a) {
; CHECK-LABEL: @test6(
; CHECK-NEXT: [[TMP1:%.*]] = and i32 %a, -2013265920
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 0
; CHECK-NEXT: br i1 [[TMP2]], label %if.then, label %if.end
;
%1 = icmp sgt i32 %a, -1 %1 = icmp sgt i32 %a, -1
%and = and i32 %a, 134217728 %and = and i32 %a, 134217728
%2 = icmp eq i32 %and, 0 %2 = icmp eq i32 %and, 0
%or.cond = and i1 %1, %2 %or.cond = and i1 %1, %2
br i1 %or.cond, label %if.then, label %if.end br i1 %or.cond, label %if.then, label %if.end
; CHECK-LABEL: @test6(
; CHECK-NEXT: %1 = and i32 %a, -2013265920
; CHECK-NEXT: %2 = icmp eq i32 %1, 0
; CHECK-NEXT: br i1 %2, label %if.then, label %if.end
if.then: if.then:
tail call void @foo() nounwind tail call void @foo() nounwind
@ -118,17 +93,18 @@ if.end:
ret void ret void
} }
define void @test7(i32 %a) nounwind { define void @test7(i32 %a) {
; CHECK-LABEL: @test7(
; CHECK-NEXT: [[TMP1:%.*]] = and i32 %a, -2013265920
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 0
; CHECK-NEXT: br i1 [[TMP2]], label %if.end, label %if.then
;
%and = and i32 %a, 134217728 %and = and i32 %a, 134217728
%1 = icmp ne i32 %and, 0 %1 = icmp ne i32 %and, 0
%2 = icmp slt i32 %a, 0 %2 = icmp slt i32 %a, 0
%or.cond = or i1 %1, %2 %or.cond = or i1 %1, %2
br i1 %or.cond, label %if.then, label %if.end br i1 %or.cond, label %if.then, label %if.end
; CHECK-LABEL: @test7(
; CHECK-NEXT: %1 = and i32 %a, -2013265920
; CHECK-NEXT: %2 = icmp eq i32 %1, 0
; CHECK-NEXT: br i1 %2, label %if.end, label %if.the
if.then: if.then:
tail call void @foo() nounwind tail call void @foo() nounwind
@ -138,80 +114,60 @@ if.end:
ret void ret void
} }
define void @test8(i32 %a) nounwind { define void @test8(i32 %a) {
; CHECK-LABEL: @test8(
; CHECK-NEXT: [[TMP1:%.*]] = and i32 %a, -2013265920
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 0
; CHECK-NEXT: br i1 [[TMP2]], label %if.end, label %if.then
;
%1 = icmp slt i32 %a, 0 %1 = icmp slt i32 %a, 0
%and = and i32 %a, 134217728 %and = and i32 %a, 134217728
%2 = icmp ne i32 %and, 0 %2 = icmp ne i32 %and, 0
%or.cond = or i1 %1, %2 %or.cond = or i1 %1, %2
br i1 %or.cond, label %if.then, label %if.end br i1 %or.cond, label %if.then, label %if.end
; CHECK-LABEL: @test8(
; CHECK-NEXT: %1 = and i32 %a, -2013265920
; CHECK-NEXT: %2 = icmp eq i32 %1, 0
; CHECK-NEXT: br i1 %2, label %if.end, label %if.the
if.then: if.then:
tail call void @foo() nounwind tail call void @foo()
ret void ret void
if.end: if.end:
ret void ret void
} }
define void @test9(i32 %a) nounwind { define i1 @test9(i32 %a) {
; CHECK-LABEL: @test9(
; CHECK-NEXT: [[TMP1:%.*]] = and i32 %a, -1073741824
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 1073741824
; CHECK-NEXT: ret i1 [[TMP2]]
;
%1 = and i32 %a, 1073741824 %1 = and i32 %a, 1073741824
%2 = icmp ne i32 %1, 0 %2 = icmp ne i32 %1, 0
%3 = icmp sgt i32 %a, -1 %3 = icmp sgt i32 %a, -1
%or.cond = and i1 %2, %3 %or.cond = and i1 %2, %3
br i1 %or.cond, label %if.then, label %if.end ret i1 %or.cond
; CHECK-LABEL: @test9(
; CHECK-NEXT: %1 = and i32 %a, -1073741824
; CHECK-NEXT: %2 = icmp eq i32 %1, 1073741824
; CHECK-NEXT: br i1 %2, label %if.then, label %if.end
if.then:
tail call void @foo() nounwind
ret void
if.end:
ret void
} }
define void @test10(i32 %a) nounwind { define i1 @test10(i32 %a) {
; CHECK-LABEL: @test10(
; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 %a, 2
; CHECK-NEXT: ret i1 [[TMP1]]
;
%1 = and i32 %a, 2 %1 = and i32 %a, 2
%2 = icmp eq i32 %1, 0 %2 = icmp eq i32 %1, 0
%3 = icmp ult i32 %a, 4 %3 = icmp ult i32 %a, 4
%or.cond = and i1 %2, %3 %or.cond = and i1 %2, %3
br i1 %or.cond, label %if.then, label %if.end ret i1 %or.cond
; CHECK-LABEL: @test10(
; CHECK-NEXT: %1 = icmp ult i32 %a, 2
; CHECK-NEXT: br i1 %1, label %if.then, label %if.end
if.then:
tail call void @foo() nounwind
ret void
if.end:
ret void
} }
define void @test11(i32 %a) nounwind { define i1 @test11(i32 %a) {
; CHECK-LABEL: @test11(
; CHECK-NEXT: [[TMP1:%.*]] = icmp ugt i32 %a, 1
; CHECK-NEXT: ret i1 [[TMP1]]
;
%1 = and i32 %a, 2 %1 = and i32 %a, 2
%2 = icmp ne i32 %1, 0 %2 = icmp ne i32 %1, 0
%3 = icmp ugt i32 %a, 3 %3 = icmp ugt i32 %a, 3
%or.cond = or i1 %2, %3 %or.cond = or i1 %2, %3
br i1 %or.cond, label %if.then, label %if.end ret i1 %or.cond
; CHECK-LABEL: @test11(
; CHECK-NEXT: %1 = icmp ugt i32 %a, 1
; CHECK-NEXT: br i1 %1, label %if.then, label %if.end
if.then:
tail call void @foo() nounwind
ret void
if.end:
ret void
} }