Remove llvm-upgrade and update tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47297 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tanya Lattner 2008-02-19 01:44:26 +00:00
parent 53a66d10f0
commit 2ad38be2cf
11 changed files with 118 additions and 137 deletions

View File

@ -1,15 +1,13 @@
; Call graph construction crash: Not handling indirect calls right
;
; RUN: llvm-upgrade < %s | llvm-as | opt -analyze -callgraph
; RUN: llvm-as < %s | opt -analyze -callgraph
;
%FunTy = type int(int)
%FunTy = type i32 (i32)
implementation
define void @invoke(%FunTy* %x) {
%foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
ret void
}
void "invoke"(%FunTy *%x)
begin
%foo = call %FunTy* %x(int 123)
ret void
end

View File

@ -1,26 +1,23 @@
; Inlining used to break PHI nodes. This tests that they are correctly updated
; Inlining used to break PHI nodes. This tests that they are correctly updated
; when a node is split around the call instruction. The verifier caught the error.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -inline
; RUN: llvm-as < %s | opt -inline
;
implementation
ulong "test"(ulong %X)
begin
ret ulong %X
end
define i64 @test(i64 %X) {
ret i64 %X
}
ulong "fib"(ulong %n)
begin
%T = setlt ulong %n, 2 ; {bool}:0
br bool %T, label %BaseCase, label %RecurseCase
define i64 @fib(i64 %n) {
; <label>:0
%T = icmp ult i64 %n, 2 ; <i1> [#uses=1]
br i1 %T, label %BaseCase, label %RecurseCase
RecurseCase:
%result = call ulong %test(ulong %n)
br label %BaseCase
BaseCase:
%X = phi ulong [1, %0], [2, %RecurseCase]
ret ulong %X
end
RecurseCase: ; preds = %0
%result = call i64 @test( i64 %n ) ; <i64> [#uses=0]
br label %BaseCase
BaseCase: ; preds = %RecurseCase, %0
%X = phi i64 [ 1, %0 ], [ 2, %RecurseCase ] ; <i64> [#uses=1]
ret i64 %X
}

View File

@ -5,21 +5,20 @@
;
; Fixed by adding new arguments to ConstantFoldTerminator
;
; RUN: llvm-upgrade < %s | llvm-as | opt -constprop
; RUN: llvm-as < %s | opt -constprop
implementation
define void @build_tree(i32 %ml) {
; <label>:0
br label %bb2
void "build_tree"(int %ml)
begin
br label %bb2
bb2: ; preds = %bb2, %0
%reg137 = phi i32 [ %reg140, %bb2 ], [ 12, %0 ] ; <i32> [#uses=1]
%reg138 = phi i32 [ %reg139, %bb2 ], [ 0, %0 ] ; <i32> [#uses=1]
%reg139 = add i32 %reg138, 1 ; <i32> [#uses=1]
%reg140 = add i32 %reg137, -1 ; <i32> [#uses=1]
br i1 false, label %bb2, label %bb3
bb2:
%reg137 = phi int [ %reg140, %bb2 ], [ 12, %0 ] ; <int> [#uses=2]
%reg138 = phi uint [ %reg139, %bb2 ], [ 0, %0 ] ; <uint> [#uses=3]
%reg139 = add uint %reg138, 1 ; <uint> [#uses=1]
%reg140 = add int %reg137, -1 ; <int> [#uses=1]
br bool false, label %bb2, label %bb3
bb3: ; preds = %bb2
ret void
}
bb3:
ret void
end

View File

@ -2,27 +2,28 @@
; figure out that loop "Inner" should be nested inside of leep "LoopHeader",
; and instead nests it just inside loop "Top"
;
; RUN: llvm-upgrade < %s | llvm-as | opt -analyze -loops | \
; RUN: llvm-as < %s | opt -analyze -loops | \
; RUN: grep { Loop Containing:\[ \]*%Inner}
;
define void @test() {
br label %Top
implementation
Top: ; preds = %Out, %0
br label %LoopHeader
void %test() {
br label %Top
Top:
br label %LoopHeader
Next:
br bool false, label %Inner, label %Out
Inner:
br bool false, label %Inner, label %LoopHeader
Next: ; preds = %LoopHeader
br i1 false, label %Inner, label %Out
LoopHeader:
br label %Next
Inner: ; preds = %Inner, %Next
br i1 false, label %Inner, label %LoopHeader
Out:
br bool false, label %Top, label %Done
LoopHeader: ; preds = %Inner, %Top
br label %Next
Done:
ret void
Out: ; preds = %Next
br i1 false, label %Top, label %Done
Done: ; preds = %Out
ret void
}

View File

@ -1,20 +1,16 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -lower-packed | llvm-dis
; RUN: llvm-as < %s | opt -lower-packed | llvm-dis
@foo = external global <2 x i32> ; <<2 x i32>*> [#uses=2]
@bar = external global <2 x i32> ; <<2 x i32>*> [#uses=1]
%foo = uninitialized global <2 x int>;
%bar = uninitialized global <2 x int>;
implementation ; Functions:
void %main()
{
%t0 = load <2 x int>* %foo
%t2 = add <2 x int> %t0, %t0
%t3 = select bool false, <2 x int> %t0, <2 x int> %t2
store <2 x int> %t3, <2 x int>* %bar
%c0 = add <2 x int> <int 1, int 1>, %t0
%c1 = add <2 x int> %t0, <int 0, int 0>
%c2 = select bool true, <2 x int> <int 1, int 1>, <2 x int> %t0
store <2 x int> <int 4, int 4>, <2 x int>* %foo
ret void
define void @main() {
%t0 = load <2 x i32>* @foo ; <<2 x i32>> [#uses=6]
%t2 = add <2 x i32> %t0, %t0 ; <<2 x i32>> [#uses=1]
%t3 = select i1 false, <2 x i32> %t0, <2 x i32> %t2 ; <<2 x i32>> [#uses=1]
store <2 x i32> %t3, <2 x i32>* @bar
%c0 = add <2 x i32> < i32 1, i32 1 >, %t0 ; <<2 x i32>> [#uses=0]
%c1 = add <2 x i32> %t0, zeroinitializer ; <<2 x i32>> [#uses=0]
%c2 = select i1 true, <2 x i32> < i32 1, i32 1 >, <2 x i32> %t0 ; <<2 x i32>> [#uses=0]
store <2 x i32> < i32 4, i32 4 >, <2 x i32>* @foo
ret void
}

View File

@ -1,11 +1,8 @@
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis
; RUN: llvm-as < %s | llvm-dis
@bar = external global <2 x i32> ; <<2 x i32>*> [#uses=1]
%bar = external global <2 x int> ; <<2 x int>*> [#uses=1]
implementation ; Functions:
void %main()
{
store <2 x int> < int 0, int 1 >, <2 x int>* %bar
ret void
define void @main() {
store <2 x i32> < i32 0, i32 1 >, <2 x i32>* @bar
ret void
}

View File

@ -1,13 +1,11 @@
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis
; RUN: llvm-as < %s | llvm-dis
%foo = global <2 x int> <int 0, int 1>;
%bar = uninitialized global <2 x int>;
@foo = global <2 x i32> < i32 0, i32 1 > ; <<2 x i32>*> [#uses=1]
@bar = external global <2 x i32> ; <<2 x i32>*> [#uses=1]
implementation ; Functions:
void %main()
{
%t0 = load <2 x int>* %foo;
store <2 x int> %t0, <2 x int>* %bar
ret void
define void @main() {
%t0 = load <2 x i32>* @foo ; <<2 x i32>> [#uses=1]
store <2 x i32> %t0, <2 x i32>* @bar
ret void
}

View File

@ -1,15 +1,13 @@
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis
; RUN: llvm-as < %s | llvm-dis
%foo = uninitialized global <4 x float>;
%bar = uninitialized global <4 x float>;
@foo = external global <4 x float> ; <<4 x float>*> [#uses=1]
@bar = external global <4 x float> ; <<4 x float>*> [#uses=1]
implementation ; Functions:
void %main()
{
%t0 = load <4 x float>* %foo
%t1 = add <4 x float> %t0, %t0
%t2 = select bool true, <4 x float> %t0, <4 x float> %t1
store <4 x float> %t2, <4 x float>* %bar
ret void
define void @main() {
%t0 = load <4 x float>* @foo ; <<4 x float>> [#uses=3]
%t1 = add <4 x float> %t0, %t0 ; <<4 x float>> [#uses=1]
%t2 = select i1 true, <4 x float> %t0, <4 x float> %t1 ; <<4 x float>> [#uses=1]
store <4 x float> %t2, <4 x float>* @bar
ret void
}

View File

@ -1,15 +1,13 @@
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis
; RUN: llvm-as < %s | llvm-dis
%foo = uninitialized global <4 x float>;
%bar = uninitialized global <4 x float>;
@foo = external global <4 x float> ; <<4 x float>*> [#uses=1]
@bar = external global <4 x float> ; <<4 x float>*> [#uses=1]
implementation ; Functions:
void %main()
{
%t0 = load <4 x float>* %foo
%t2 = add <4 x float> %t0, %t0
%t3 = select bool false, <4 x float> %t0, <4 x float> %t2
store <4 x float> %t3, <4 x float>* %bar
ret void
define void @main() {
%t0 = load <4 x float>* @foo ; <<4 x float>> [#uses=3]
%t2 = add <4 x float> %t0, %t0 ; <<4 x float>> [#uses=1]
%t3 = select i1 false, <4 x float> %t0, <4 x float> %t2 ; <<4 x float>> [#uses=1]
store <4 x float> %t3, <4 x float>* @bar
ret void
}

View File

@ -1,23 +1,22 @@
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | llvm-as > /dev/null
; RUN: llvm-as < %s | llvm-dis | llvm-as > /dev/null
%v4f = type <4 x float>
%v4f = type <4 x float>
@foo = external global %v4f ; <%v4f*> [#uses=1]
@bar = external global %v4f ; <%v4f*> [#uses=1]
%foo = uninitialized global %v4f
%bar = uninitialized global %v4f
define void @main() {
br label %A
implementation ; Functions:
C: ; preds = %B
store %v4f %t2, %v4f* @bar
ret void
void %main() {
br label %A
C:
store %v4f %t2, %v4f* %bar
ret void
B: ; preds = %A
%t2 = add %v4f %t0, %t0 ; <%v4f> [#uses=1]
br label %C
B:
%t2 = add %v4f %t0, %t0
br label %C
A:
%t0 = load %v4f* %foo
br label %B
A: ; preds = %0
%t0 = load %v4f* @foo ; <%v4f> [#uses=2]
br label %B
}

View File

@ -1,6 +1,6 @@
;RUN: llvm-upgrade < %s | llvm-as | opt -codegenprepare -disable-output
;RUN: llvm-as < %s | opt -codegenprepare -disable-output
void @foo() {
define void @foo() {
entry:
br i1 false, label %cond_next31, label %cond_true