1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Remove llvm-upgrade and update tests.

llvm-svn: 47296
This commit is contained in:
Tanya Lattner 2008-02-19 01:41:04 +00:00
parent bb577266bf
commit aeb9bb8ba4
162 changed files with 3148 additions and 3348 deletions

View File

@ -1,19 +1,17 @@
; There should be exactly two calls here (memset and malloc), no more.
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep jsr | count 2
; RUN: llvm-as < %s | llc -march=alpha | grep jsr | count 2
%typedef.bc_struct = type opaque
declare void @llvm.memset.i64(i8*, i8, i64, i32)
implementation ; Functions:
declare void %llvm.memset.i64(sbyte*, ubyte, ulong, uint)
bool %l12_l94_bc_divide_endif_2E_3_2E_ce(int* %tmp.71.reload, uint %scale2.1.3, uint %extra.0, %typedef.bc_struct* %n1, %typedef.bc_struct* %n2, int* %tmp.92.reload, uint %tmp.94.reload, int* %tmp.98.reload, uint %tmp.100.reload, sbyte** %tmp.112.out, uint* %tmp.157.out, sbyte** %tmp.158.out) {
define i1 @l12_l94_bc_divide_endif_2E_3_2E_ce(i32* %tmp.71.reload, i32 %scale2.1.3, i32 %extra.0, %typedef.bc_struct* %n1, %typedef.bc_struct* %n2, i32* %tmp.92.reload, i32 %tmp.94.reload, i32* %tmp.98.reload, i32 %tmp.100.reload, i8** %tmp.112.out, i32* %tmp.157.out, i8** %tmp.158.out) {
newFuncRoot:
%tmp.120 = add uint %extra.0, 2 ; <uint> [#uses=1]
%tmp.122 = add uint %tmp.120, %tmp.94.reload ; <uint> [#uses=1]
%tmp.123 = add uint %tmp.122, %tmp.100.reload ; <uint> [#uses=2]
%tmp.112 = malloc sbyte, uint %tmp.123 ; <sbyte*> [#uses=3]
%tmp.137 = cast uint %tmp.123 to ulong ; <ulong> [#uses=1]
tail call void %llvm.memset.i64( sbyte* %tmp.112, ubyte 0, ulong %tmp.137, uint 0 )
ret bool true
%tmp.120 = add i32 %extra.0, 2 ; <i32> [#uses=1]
%tmp.122 = add i32 %tmp.120, %tmp.94.reload ; <i32> [#uses=1]
%tmp.123 = add i32 %tmp.122, %tmp.100.reload ; <i32> [#uses=2]
%tmp.112 = malloc i8, i32 %tmp.123 ; <i8*> [#uses=1]
%tmp.137 = zext i32 %tmp.123 to i64 ; <i64> [#uses=1]
tail call void @llvm.memset.i64( i8* %tmp.112, i8 0, i64 %tmp.137, i32 0 )
ret i1 true
}

View File

@ -1,44 +1,40 @@
; This shouldn't crash
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
; RUN: llvm-as < %s | llc -march=alpha
; ModuleID = 'bugpoint-reduced-simplified.bc'
target endian = little
target pointersize = 64
%.str_4 = external global [44 x sbyte] ; <[44 x sbyte]*> [#uses=0]
@.str_4 = external global [44 x i8] ; <[44 x i8]*> [#uses=0]
implementation ; Functions:
declare void @printf(i32, ...)
declare void %printf(int, ...)
void %main() {
define void @main() {
entry:
%tmp.11861 = setlt long 0, 1 ; <bool> [#uses=1]
%tmp.19466 = setlt long 0, 1 ; <bool> [#uses=1]
%tmp.21571 = setlt long 0, 1 ; <bool> [#uses=1]
%tmp.36796 = setlt long 0, 1 ; <bool> [#uses=1]
br bool %tmp.11861, label %loopexit.2, label %no_exit.2
%tmp.11861 = icmp slt i64 0, 1 ; <i1> [#uses=1]
%tmp.19466 = icmp slt i64 0, 1 ; <i1> [#uses=1]
%tmp.21571 = icmp slt i64 0, 1 ; <i1> [#uses=1]
%tmp.36796 = icmp slt i64 0, 1 ; <i1> [#uses=1]
br i1 %tmp.11861, label %loopexit.2, label %no_exit.2
no_exit.2: ; preds = %entry
ret void
no_exit.2: ; preds = %entry
ret void
loopexit.2: ; preds = %entry
br bool %tmp.19466, label %loopexit.3, label %no_exit.3.preheader
loopexit.2: ; preds = %entry
br i1 %tmp.19466, label %loopexit.3, label %no_exit.3.preheader
no_exit.3.preheader: ; preds = %loopexit.2
ret void
no_exit.3.preheader: ; preds = %loopexit.2
ret void
loopexit.3: ; preds = %loopexit.2
br bool %tmp.21571, label %no_exit.6, label %no_exit.4
loopexit.3: ; preds = %loopexit.2
br i1 %tmp.21571, label %no_exit.6, label %no_exit.4
no_exit.4: ; preds = %loopexit.3
ret void
no_exit.4: ; preds = %loopexit.3
ret void
no_exit.6: ; preds = %no_exit.6, %loopexit.3
%tmp.30793 = setgt long 0, 0 ; <bool> [#uses=1]
br bool %tmp.30793, label %loopexit.6, label %no_exit.6
no_exit.6: ; preds = %no_exit.6, %loopexit.3
%tmp.30793 = icmp sgt i64 0, 0 ; <i1> [#uses=1]
br i1 %tmp.30793, label %loopexit.6, label %no_exit.6
loopexit.6: ; preds = %no_exit.6
%Z.1 = select bool %tmp.36796, double 1.000000e+00, double 0x3FEFFF7CEDE74EAE ; <double> [#uses=2]
tail call void (int, ...)* %printf( int 0, long 0, long 0, long 0, double 1.000000e+00, double 1.000000e+00, double %Z.1, double %Z.1 )
ret void
loopexit.6: ; preds = %no_exit.6
%Z.1 = select i1 %tmp.36796, double 1.000000e+00, double 0x3FEFFF7CEDE74EAE; <double> [#uses=2]
tail call void (i32, ...)* @printf( i32 0, i64 0, i64 0, i64 0, double 1.000000e+00, double 1.000000e+00, double %Z.1, double %Z.1 )
ret void
}

View File

@ -1,30 +1,27 @@
; The global symbol should be legalized
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
; RUN: llvm-as < %s | llc -march=alpha
target endian = little
target pointersize = 64
%struct.LIST_HELP = type { %struct.LIST_HELP*, sbyte* }
%struct._IO_FILE = type { int, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, %struct._IO_marker*, %struct._IO_FILE*, int, int, long, ushort, sbyte, [1 x sbyte], sbyte*, long, sbyte*, sbyte*, int, [44 x sbyte] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, int }
%clause_SORT = external global [21 x %struct.LIST_HELP*] ; <[21 x %struct.LIST_HELP*]*> [#uses=1]
%ia_in = external global %struct._IO_FILE* ; <%struct._IO_FILE**> [#uses=1]
%multvec_j = external global [100 x uint] ; <[100 x uint]*> [#uses=1]
target datalayout = "e-p:64:64"
%struct.LIST_HELP = type { %struct.LIST_HELP*, i8* }
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [44 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@clause_SORT = external global [21 x %struct.LIST_HELP*] ; <[21 x %struct.LIST_HELP*]*> [#uses=0]
@ia_in = external global %struct._IO_FILE* ; <%struct._IO_FILE**> [#uses=1]
@multvec_j = external global [100 x i32] ; <[100 x i32]*> [#uses=0]
implementation ; Functions:
void %main(int %argc) {
define void @main(i32 %argc) {
clock_Init.exit:
%tmp.5.i575 = load int* null ; <int> [#uses=1]
%tmp.309 = seteq int %tmp.5.i575, 0 ; <bool> [#uses=1]
br bool %tmp.309, label %UnifiedReturnBlock, label %then.17
%tmp.5.i575 = load i32* null ; <i32> [#uses=1]
%tmp.309 = icmp eq i32 %tmp.5.i575, 0 ; <i1> [#uses=1]
br i1 %tmp.309, label %UnifiedReturnBlock, label %then.17
then.17: ; preds = %clock_Init.exit
store %struct._IO_FILE* null, %struct._IO_FILE** %ia_in
%savedstack = call sbyte* %llvm.stacksave( ) ; <sbyte*> [#uses=0]
ret void
then.17: ; preds = %clock_Init.exit
store %struct._IO_FILE* null, %struct._IO_FILE** @ia_in
%savedstack = call i8* @llvm.stacksave( ) ; <i8*> [#uses=0]
ret void
UnifiedReturnBlock: ; preds = %clock_Init.exit
ret void
UnifiedReturnBlock: ; preds = %clock_Init.exit
ret void
}
declare sbyte* %llvm.stacksave()
declare i8* @llvm.stacksave()

View File

@ -1,17 +1,14 @@
; This shouldn't crash
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
; RUN: llvm-as < %s | llc -march=alpha
; ModuleID = 'simp.bc'
target endian = little
target pointersize = 64
target datalayout = "e-p:64:64"
target triple = "alphaev6-unknown-linux-gnu"
deplibs = [ "c", "crtend", "stdc++" ]
%struct.__va_list_tag = type { sbyte*, int }
%struct.__va_list_tag = type { i8*, i32 }
implementation ; Functions:
uint %emit_library_call_value(int %nargs, ...) {
define i32 @emit_library_call_value(i32 %nargs, ...) {
entry:
%tmp.223 = va_arg %struct.__va_list_tag* null, uint ; <uint> [#uses=0]
ret uint %tmp.223
%tmp.223 = va_arg %struct.__va_list_tag* null, i32 ; <i32> [#uses=1]
ret i32 %tmp.223
}

View File

@ -1,36 +1,34 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
; RUN: llvm-as < %s | llc -march=alpha
target endian = little
target pointersize = 64
target datalayout = "e-p:64:64"
target triple = "alphaev67-unknown-linux-gnu"
%llvm.dbg.compile_unit.type = type { uint, { }*, uint, uint, sbyte*, sbyte*, sbyte* }
%struct._Callback_list = type { %struct._Callback_list*, void (uint, %struct.ios_base*, int)*, int, int }
%struct._Impl = type { int, %struct.facet**, ulong, %struct.facet**, sbyte** }
%struct._Words = type { sbyte*, long }
"struct.__codecvt_abstract_base<char,char,__mbstate_t>" = type { %struct.facet }
"struct.basic_streambuf<char,std::char_traits<char> >" = type { int (...)**, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, %struct.locale }
%struct.facet = type { int (...)**, int }
%struct.ios_base = type { int (...)**, long, long, uint, uint, uint, %struct._Callback_list*, %struct._Words, [8 x %struct._Words], int, %struct._Words*, %struct.locale }
%struct.locale = type { %struct._Impl* }
"struct.ostreambuf_iterator<char,std::char_traits<char> >" = type { "struct.basic_streambuf<char,std::char_traits<char> >"*, bool }
%llvm.dbg.compile_unit1047 = external global %llvm.dbg.compile_unit.type ; <%llvm.dbg.compile_unit.type*> [#uses=1]
%llvm.dbg.compile_unit.type = type { i32, { }*, i32, i32, i8*, i8*, i8* }
%struct._Callback_list = type { %struct._Callback_list*, void (i32, %struct.ios_base*, i32)*, i32, i32 }
%struct._Impl = type { i32, %struct.facet**, i64, %struct.facet**, i8** }
%struct._Words = type { i8*, i64 }
%"struct.__codecvt_abstract_base<char,char,__mbstate_t>" = type { %struct.facet }
%"struct.basic_streambuf<char,std::char_traits<char> >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %struct.locale }
%struct.facet = type { i32 (...)**, i32 }
%struct.ios_base = type { i32 (...)**, i64, i64, i32, i32, i32, %struct._Callback_list*, %struct._Words, [8 x %struct._Words], i32, %struct._Words*, %struct.locale }
%struct.locale = type { %struct._Impl* }
%"struct.ostreambuf_iterator<char,std::char_traits<char> >" = type { %"struct.basic_streambuf<char,std::char_traits<char> >"*, i1 }
@llvm.dbg.compile_unit1047 = external global %llvm.dbg.compile_unit.type ; <%llvm.dbg.compile_unit.type*> [#uses=1]
implementation ; Functions:
void %_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_() {
define void @_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_() {
entry:
%tmp234 = seteq sbyte 0, 0 ; <bool> [#uses=1]
br bool %tmp234, label %cond_next243, label %cond_true235
%tmp234 = icmp eq i8 0, 0 ; <i1> [#uses=1]
br i1 %tmp234, label %cond_next243, label %cond_true235
cond_true235: ; preds = %entry
ret void
cond_true235: ; preds = %entry
ret void
cond_next243: ; preds = %entry
%tmp428 = load long* null ; <long> [#uses=1]
%tmp428 = cast long %tmp428 to uint ; <uint> [#uses=1]
%tmp429 = alloca sbyte, uint %tmp428 ; <sbyte*> [#uses=0]
call void %llvm.dbg.stoppoint( uint 1146, uint 0, { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit1047 to { }*) )
unreachable
cond_next243: ; preds = %entry
%tmp428 = load i64* null ; <i64> [#uses=1]
%tmp428.upgrd.1 = trunc i64 %tmp428 to i32 ; <i32> [#uses=1]
%tmp429 = alloca i8, i32 %tmp428.upgrd.1 ; <i8*> [#uses=0]
call void @llvm.dbg.stoppoint( i32 1146, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit1047 to { }*) )
unreachable
}
declare void %llvm.dbg.stoppoint(uint, uint, { }*)
declare void @llvm.dbg.stoppoint(i32, i32, { }*)

View File

@ -1,20 +1,18 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
; RUN: llvm-as < %s | llc -march=alpha
target endian = little
target pointersize = 64
target datalayout = "e-p:64:64"
target triple = "alphaev67-unknown-linux-gnu"
implementation ; Functions:
int %_ZN9__gnu_cxx18__exchange_and_addEPVii(int* %__mem, int %__val) {
define i32 @_ZN9__gnu_cxx18__exchange_and_addEPVii(i32* %__mem, i32 %__val) {
entry:
%__tmp = alloca int, align 4 ; <int*> [#uses=1]
%tmp3 = call int asm sideeffect "\0A$$Lxadd_0:\0A\09ldl_l $0,$3\0A\09addl $0,$4,$1\0A\09stl_c $1,$2\0A\09beq $1,$$Lxadd_0\0A\09mb", "=&r,=*&r,=*m,m,r"( int* %__tmp, int* %__mem, int* %__mem, int %__val ) ; <int> [#uses=1]
ret int %tmp3
%__tmp = alloca i32, align 4 ; <i32*> [#uses=1]
%tmp3 = call i32 asm sideeffect "\0A$$Lxadd_0:\0A\09ldl_l $0,$3\0A\09addl $0,$4,$1\0A\09stl_c $1,$2\0A\09beq $1,$$Lxadd_0\0A\09mb", "=&r,=*&r,=*m,m,r"( i32* %__tmp, i32* %__mem, i32* %__mem, i32 %__val ) ; <i32> [#uses=1]
ret i32 %tmp3
}
void %_ZN9__gnu_cxx12__atomic_addEPVii(int* %__mem, int %__val) {
define void @_ZN9__gnu_cxx12__atomic_addEPVii(i32* %__mem, i32 %__val) {
entry:
%tmp2 = call int asm sideeffect "\0A$$Ladd_1:\0A\09ldl_l $0,$2\0A\09addl $0,$3,$0\0A\09stl_c $0,$1\0A\09beq $0,$$Ladd_1\0A\09mb", "=&r,=*m,m,r"( int* %__mem, int* %__mem, int %__val ) ; <int> [#uses=0]
%tmp2 = call i32 asm sideeffect "\0A$$Ladd_1:\0A\09ldl_l $0,$2\0A\09addl $0,$3,$0\0A\09stl_c $0,$1\0A\09beq $0,$$Ladd_1\0A\09mb", "=&r,=*m,m,r"( i32* %__mem, i32* %__mem, i32 %__val ) ; <i32> [#uses=0]
ret void
}

View File

@ -1,18 +1,15 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
; RUN: llvm-as < %s | llc -march=alpha
target datalayout = "e-p:64:64"
target endian = little
target pointersize = 64
target triple = "alphaev67-unknown-linux-gnu"
%struct.va_list = type { sbyte*, int, int }
%struct.va_list = type { i8*, i32, i32 }
implementation ; Functions:
void %yyerror(int, ...) {
define void @yyerror(i32, ...) {
entry:
call void %llvm.va_start( %struct.va_list* null )
%va.upgrd.1 = bitcast %struct.va_list* null to i8* ; <i8*> [#uses=1]
call void @llvm.va_start( i8* %va.upgrd.1 )
ret void
}
declare void %llvm.va_start(%struct.va_list*)
declare void @llvm.va_start(i8*)

View File

@ -1,11 +1,9 @@
; Make sure this testcase codegens to the bic instruction
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep {bic}
; RUN: llvm-as < %s | llc -march=alpha | grep {bic}
implementation ; Functions:
long %bar(long %x, long %y) {
define i64 @bar(i64 %x, i64 %y) {
entry:
%tmp.1 = xor long %x, -1 ; <long> [#uses=1]
%tmp.2 = and long %y, %tmp.1
ret long %tmp.2
%tmp.1 = xor i64 %x, -1 ; <i64> [#uses=1]
%tmp.2 = and i64 %y, %tmp.1 ; <i64> [#uses=1]
ret i64 %tmp.2
}

View File

@ -1,13 +1,12 @@
; Make sure this testcase codegens the bsr instruction
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep bsr
; RUN: llvm-as < %s | llc -march=alpha | grep bsr
implementation
internal long %abc(int %x) {
%tmp.2 = add int %x, -1 ; <int> [#uses=1]
%tmp.0 = call long %abc( int %tmp.2 ) ; <long> [#uses=1]
%tmp.5 = add int %x, -2 ; <int> [#uses=1]
%tmp.3 = call long %abc( int %tmp.5 ) ; <long> [#uses=1]
%tmp.6 = add long %tmp.0, %tmp.3 ; <long> [#uses=1]
ret long %tmp.6
define internal i64 @abc(i32 %x) {
%tmp.2 = add i32 %x, -1 ; <i32> [#uses=1]
%tmp.0 = call i64 @abc( i32 %tmp.2 ) ; <i64> [#uses=1]
%tmp.5 = add i32 %x, -2 ; <i32> [#uses=1]
%tmp.3 = call i64 @abc( i32 %tmp.5 ) ; <i64> [#uses=1]
%tmp.6 = add i64 %tmp.0, %tmp.3 ; <i64> [#uses=1]
ret i64 %tmp.6
}

View File

@ -1,15 +1,13 @@
;All this should do is not crash
;RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
;RUN: llvm-as < %s | llc -march=alpha
target endian = little
target pointersize = 64
target datalayout = "e-p:64:64"
target triple = "alphaev67-unknown-linux-gnu"
implementation ; Functions:
void %_ZNSt13basic_filebufIcSt11char_traitsIcEE22_M_convert_to_externalEPcl(uint %f) {
define void @_ZNSt13basic_filebufIcSt11char_traitsIcEE22_M_convert_to_externalEPcl(i32 %f) {
entry:
%tmp49 = alloca sbyte, uint %f ; <sbyte*> [#uses=1]
%tmp = call uint null( sbyte* null, sbyte* null, sbyte* null, sbyte* null, sbyte* null, sbyte* null, sbyte* null)
ret void
%tmp49 = alloca i8, i32 %f ; <i8*> [#uses=0]
%tmp = call i32 null( i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null ) ; <i32> [#uses=0]
ret void
}

View File

@ -1,24 +1,23 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | not grep cmovlt
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep cmoveq
; RUN: llvm-as < %s | llc -march=alpha | not grep cmovlt
; RUN: llvm-as < %s | llc -march=alpha | grep cmoveq
long %cmov_lt(long %a, long %c) {
define i64 @cmov_lt(i64 %a, i64 %c) {
entry:
%tmp.1 = setlt long %c, 0
%retval = select bool %tmp.1, long %a, long 10
ret long %retval
%tmp.1 = icmp slt i64 %c, 0 ; <i1> [#uses=1]
%retval = select i1 %tmp.1, i64 %a, i64 10 ; <i64> [#uses=1]
ret i64 %retval
}
long %cmov_const(long %a, long %b, long %c) {
define i64 @cmov_const(i64 %a, i64 %b, i64 %c) {
entry:
%tmp.1 = setlt long %a, %b
%retval = select bool %tmp.1, long %c, long 10
ret long %retval
%tmp.1 = icmp slt i64 %a, %b ; <i1> [#uses=1]
%retval = select i1 %tmp.1, i64 %c, i64 10 ; <i64> [#uses=1]
ret i64 %retval
}
long %cmov_lt2(long %a, long %c) {
define i64 @cmov_lt2(i64 %a, i64 %c) {
entry:
%tmp.1 = setgt long %c, 0
%retval = select bool %tmp.1, long 10, long %a
ret long %retval
%tmp.1 = icmp sgt i64 %c, 0 ; <i1> [#uses=1]
%retval = select i1 %tmp.1, i64 10, i64 %a ; <i64> [#uses=1]
ret i64 %retval
}

View File

@ -1,16 +1,16 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep cmpbge | count 2
; RUN: llvm-as < %s | llc -march=alpha | grep cmpbge | count 2
bool %test1(ulong %A, ulong %B) {
%C = and ulong %A, 255
%D = and ulong %B, 255
%E = setge ulong %C, %D
ret bool %E
define i1 @test1(i64 %A, i64 %B) {
%C = and i64 %A, 255 ; <i64> [#uses=1]
%D = and i64 %B, 255 ; <i64> [#uses=1]
%E = icmp uge i64 %C, %D ; <i1> [#uses=1]
ret i1 %E
}
bool %test2(ulong %a, ulong %B) {
%A = shl ulong %a, ubyte 1
%C = and ulong %A, 254
%D = and ulong %B, 255
%E = setge ulong %C, %D
ret bool %E
define i1 @test2(i64 %a, i64 %B) {
%A = shl i64 %a, 1 ; <i64> [#uses=1]
%C = and i64 %A, 254 ; <i64> [#uses=1]
%D = and i64 %B, 255 ; <i64> [#uses=1]
%E = icmp uge i64 %C, %D ; <i1> [#uses=1]
ret i1 %E
}

View File

@ -1,12 +1,11 @@
; Make sure this testcase does not use ctpop
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | not grep -i ctpop
; RUN: llvm-as < %s | llc -march=alpha | not grep -i ctpop
declare ulong %llvm.ctlz.i64(ulong)
declare i64 @llvm.ctlz.i64(i64)
implementation ; Functions:
ulong %bar(ulong %x) {
define i64 @bar(i64 %x) {
entry:
%tmp.1 = call ulong %llvm.ctlz.i64( ulong %x )
ret ulong %tmp.1
%tmp.1 = call i64 @llvm.ctlz.i64( i64 %x ) ; <i64> [#uses=1]
ret i64 %tmp.1
}

View File

@ -1,20 +1,19 @@
; Make sure this testcase codegens to the ctpop instruction
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mcpu=ev67 | grep -i ctpop
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mattr=+CIX | \
; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev67 | grep -i ctpop
; RUN: llvm-as < %s | llc -march=alpha -mattr=+CIX | \
; RUN: grep -i ctpop
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mcpu=ev6 | \
; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev6 | \
; RUN: not grep -i ctpop
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mcpu=ev56 | \
; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev56 | \
; RUN: not grep -i ctpop
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mattr=-CIX | \
; RUN: llvm-as < %s | llc -march=alpha -mattr=-CIX | \
; RUN: not grep -i ctpop
declare long %llvm.ctpop.i64(long)
declare i64 @llvm.ctpop.i64(i64)
implementation ; Functions:
long %bar(long %x) {
define i64 @bar(i64 %x) {
entry:
%tmp.1 = call long %llvm.ctpop.i64( long %x )
ret long %tmp.1
%tmp.1 = call i64 @llvm.ctpop.i64( i64 %x ) ; <i64> [#uses=1]
ret i64 %tmp.1
}

View File

@ -1,11 +1,10 @@
; Make sure this testcase codegens to the eqv instruction
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep eqv
; RUN: llvm-as < %s | llc -march=alpha | grep eqv
implementation ; Functions:
long %bar(long %x, long %y) {
define i64 @bar(i64 %x, i64 %y) {
entry:
%tmp.1 = xor long %x, -1 ; <long> [#uses=1]
%tmp.2 = xor long %y, %tmp.1
ret long %tmp.2
%tmp.1 = xor i64 %x, -1 ; <i64> [#uses=1]
%tmp.2 = xor i64 %y, %tmp.1 ; <i64> [#uses=1]
ret i64 %tmp.2
}

View File

@ -1,101 +1,98 @@
; try to check that we have the most important instructions, which shouldn't
; appear otherwise
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep jmp
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep gprel32
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep ldl
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep rodata
; END.
; RUN: llvm-as < %s | llc -march=alpha | grep jmp
; RUN: llvm-as < %s | llc -march=alpha | grep gprel32
; RUN: llvm-as < %s | llc -march=alpha | grep ldl
; RUN: llvm-as < %s | llc -march=alpha | grep rodata
target endian = little
target pointersize = 64
target datalayout = "e-p:64:64"
target triple = "alphaev67-unknown-linux-gnu"
%str = internal constant [2 x sbyte] c"1\00" ; <[2 x sbyte]*> [#uses=1]
%str1 = internal constant [2 x sbyte] c"2\00" ; <[2 x sbyte]*> [#uses=1]
%str2 = internal constant [2 x sbyte] c"3\00" ; <[2 x sbyte]*> [#uses=1]
%str3 = internal constant [2 x sbyte] c"4\00" ; <[2 x sbyte]*> [#uses=1]
%str4 = internal constant [2 x sbyte] c"5\00" ; <[2 x sbyte]*> [#uses=1]
%str5 = internal constant [2 x sbyte] c"6\00" ; <[2 x sbyte]*> [#uses=1]
%str6 = internal constant [2 x sbyte] c"7\00" ; <[2 x sbyte]*> [#uses=1]
%str7 = internal constant [2 x sbyte] c"8\00" ; <[2 x sbyte]*> [#uses=1]
@str = internal constant [2 x i8] c"1\00" ; <[2 x i8]*> [#uses=1]
@str1 = internal constant [2 x i8] c"2\00" ; <[2 x i8]*> [#uses=1]
@str2 = internal constant [2 x i8] c"3\00" ; <[2 x i8]*> [#uses=1]
@str3 = internal constant [2 x i8] c"4\00" ; <[2 x i8]*> [#uses=1]
@str4 = internal constant [2 x i8] c"5\00" ; <[2 x i8]*> [#uses=1]
@str5 = internal constant [2 x i8] c"6\00" ; <[2 x i8]*> [#uses=1]
@str6 = internal constant [2 x i8] c"7\00" ; <[2 x i8]*> [#uses=1]
@str7 = internal constant [2 x i8] c"8\00" ; <[2 x i8]*> [#uses=1]
implementation ; Functions:
int %main(int %x, sbyte** %y) {
define i32 @main(i32 %x, i8** %y) {
entry:
%x_addr = alloca int ; <int*> [#uses=2]
%y_addr = alloca sbyte** ; <sbyte***> [#uses=1]
%retval = alloca int, align 4 ; <int*> [#uses=2]
%tmp = alloca int, align 4 ; <int*> [#uses=2]
%foo = alloca sbyte*, align 8 ; <sbyte**> [#uses=9]
"alloca point" = cast int 0 to int ; <int> [#uses=0]
store int %x, int* %x_addr
store sbyte** %y, sbyte*** %y_addr
%tmp = load int* %x_addr ; <int> [#uses=1]
switch int %tmp, label %bb15 [
int 1, label %bb
int 2, label %bb1
int 3, label %bb3
int 4, label %bb5
int 5, label %bb7
int 6, label %bb9
int 7, label %bb11
int 8, label %bb13
]
%x_addr = alloca i32 ; <i32*> [#uses=2]
%y_addr = alloca i8** ; <i8***> [#uses=1]
%retval = alloca i32, align 4 ; <i32*> [#uses=2]
%tmp = alloca i32, align 4 ; <i32*> [#uses=2]
%foo = alloca i8*, align 8 ; <i8**> [#uses=9]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
store i32 %x, i32* %x_addr
store i8** %y, i8*** %y_addr
%tmp.upgrd.1 = load i32* %x_addr ; <i32> [#uses=1]
switch i32 %tmp.upgrd.1, label %bb15 [
i32 1, label %bb
i32 2, label %bb1
i32 3, label %bb3
i32 4, label %bb5
i32 5, label %bb7
i32 6, label %bb9
i32 7, label %bb11
i32 8, label %bb13
]
bb: ; preds = %entry
%tmp = getelementptr [2 x sbyte]* %str, int 0, ulong 0 ; <sbyte*> [#uses=1]
store sbyte* %tmp, sbyte** %foo
br label %bb16
bb: ; preds = %entry
%tmp.upgrd.2 = getelementptr [2 x i8]* @str, i32 0, i64 0 ; <i8*> [#uses=1]
store i8* %tmp.upgrd.2, i8** %foo
br label %bb16
bb1: ; preds = %entry
%tmp2 = getelementptr [2 x sbyte]* %str1, int 0, ulong 0 ; <sbyte*> [#uses=1]
store sbyte* %tmp2, sbyte** %foo
br label %bb16
bb1: ; preds = %entry
%tmp2 = getelementptr [2 x i8]* @str1, i32 0, i64 0 ; <i8*> [#uses=1]
store i8* %tmp2, i8** %foo
br label %bb16
bb3: ; preds = %entry
%tmp4 = getelementptr [2 x sbyte]* %str2, int 0, ulong 0 ; <sbyte*> [#uses=1]
store sbyte* %tmp4, sbyte** %foo
br label %bb16
bb3: ; preds = %entry
%tmp4 = getelementptr [2 x i8]* @str2, i32 0, i64 0 ; <i8*> [#uses=1]
store i8* %tmp4, i8** %foo
br label %bb16
bb5: ; preds = %entry
%tmp6 = getelementptr [2 x sbyte]* %str3, int 0, ulong 0 ; <sbyte*> [#uses=1]
store sbyte* %tmp6, sbyte** %foo
br label %bb16
bb5: ; preds = %entry
%tmp6 = getelementptr [2 x i8]* @str3, i32 0, i64 0 ; <i8*> [#uses=1]
store i8* %tmp6, i8** %foo
br label %bb16
bb7: ; preds = %entry
%tmp8 = getelementptr [2 x sbyte]* %str4, int 0, ulong 0 ; <sbyte*> [#uses=1]
store sbyte* %tmp8, sbyte** %foo
br label %bb16
bb7: ; preds = %entry
%tmp8 = getelementptr [2 x i8]* @str4, i32 0, i64 0 ; <i8*> [#uses=1]
store i8* %tmp8, i8** %foo
br label %bb16
bb9: ; preds = %entry
%tmp10 = getelementptr [2 x sbyte]* %str5, int 0, ulong 0 ; <sbyte*> [#uses=1]
store sbyte* %tmp10, sbyte** %foo
br label %bb16
bb9: ; preds = %entry
%tmp10 = getelementptr [2 x i8]* @str5, i32 0, i64 0 ; <i8*> [#uses=1]
store i8* %tmp10, i8** %foo
br label %bb16
bb11: ; preds = %entry
%tmp12 = getelementptr [2 x sbyte]* %str6, int 0, ulong 0 ; <sbyte*> [#uses=1]
store sbyte* %tmp12, sbyte** %foo
br label %bb16
bb11: ; preds = %entry
%tmp12 = getelementptr [2 x i8]* @str6, i32 0, i64 0 ; <i8*> [#uses=1]
store i8* %tmp12, i8** %foo
br label %bb16
bb13: ; preds = %entry
%tmp14 = getelementptr [2 x sbyte]* %str7, int 0, ulong 0 ; <sbyte*> [#uses=1]
store sbyte* %tmp14, sbyte** %foo
br label %bb16
bb13: ; preds = %entry
%tmp14 = getelementptr [2 x i8]* @str7, i32 0, i64 0 ; <i8*> [#uses=1]
store i8* %tmp14, i8** %foo
br label %bb16
bb15: ; preds = %entry
br label %bb16
bb15: ; preds = %entry
br label %bb16
bb16: ; preds = %bb15, %bb13, %bb11, %bb9, %bb7, %bb5, %bb3, %bb1, %bb
%tmp17 = load sbyte** %foo ; <sbyte*> [#uses=1]
%tmp18 = call int (...)* %print( sbyte* %tmp17 ) ; <int> [#uses=0]
store int 0, int* %tmp
%tmp19 = load int* %tmp ; <int> [#uses=1]
store int %tmp19, int* %retval
br label %return
bb16: ; preds = %bb15, %bb13, %bb11, %bb9, %bb7, %bb5, %bb3, %bb1, %bb
%tmp17 = load i8** %foo ; <i8*> [#uses=1]
%tmp18 = call i32 (...)* @print( i8* %tmp17 ) ; <i32> [#uses=0]
store i32 0, i32* %tmp
%tmp19 = load i32* %tmp ; <i32> [#uses=1]
store i32 %tmp19, i32* %retval
br label %return
return: ; preds = %bb16
%retval = load int* %retval ; <int> [#uses=1]
ret int %retval
return: ; preds = %bb16
%retval.upgrd.3 = load i32* %retval ; <i32> [#uses=1]
ret i32 %retval.upgrd.3
}
declare int %print(...)
declare i32 @print(...)

View File

@ -1,52 +1,53 @@
; Make sure this testcase does not use mulq
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | \
; RUN: llvm-as < %s | llvm-as | llc -march=alpha | \
; RUN: not grep -i mul
; XFAIL: *
implementation ; Functions:
ulong %foo1(ulong %x) {
define i64 @foo1(i64 %x) {
entry:
%tmp.1 = mul ulong %x, 9 ; <ulong> [#uses=1]
ret ulong %tmp.1
}
ulong %foo3(ulong %x) {
entry:
%tmp.1 = mul ulong %x, 259
ret ulong %tmp.1
%tmp.1 = mul i64 %x, 9 ; <i64> [#uses=1]
ret i64 %tmp.1
}
ulong %foo4l(ulong %x) {
define i64 @foo3(i64 %x) {
entry:
%tmp.1 = mul ulong %x, 260
ret ulong %tmp.1
%tmp.1 = mul i64 %x, 259 ; <i64> [#uses=1]
ret i64 %tmp.1
}
ulong %foo4ln(ulong %x) {
define i64 @foo4l(i64 %x) {
entry:
%tmp.1 = mul ulong %x, 508
ret ulong %tmp.1
}
ulong %foo4ln_more(ulong %x) {
entry:
%tmp.1 = mul ulong %x, 252
ret ulong %tmp.1
%tmp.1 = mul i64 %x, 260 ; <i64> [#uses=1]
ret i64 %tmp.1
}
ulong %foo1n(ulong %x) {
define i64 @foo4ln(i64 %x) {
entry:
%tmp.1 = mul ulong %x, 511
ret ulong %tmp.1
%tmp.1 = mul i64 %x, 508 ; <i64> [#uses=1]
ret i64 %tmp.1
}
ulong %foo8l(ulong %x) {
define i64 @foo4ln_more(i64 %x) {
entry:
%tmp.1 = mul ulong %x, 768
ret ulong %tmp.1
%tmp.1 = mul i64 %x, 252 ; <i64> [#uses=1]
ret i64 %tmp.1
}
long %bar(long %x) {
define i64 @foo1n(i64 %x) {
entry:
%tmp.1 = mul long %x, 5 ; <long> [#uses=1]
ret long %tmp.1
%tmp.1 = mul i64 %x, 511 ; <i64> [#uses=1]
ret i64 %tmp.1
}
define i64 @foo8l(i64 %x) {
entry:
%tmp.1 = mul i64 %x, 768 ; <i64> [#uses=1]
ret i64 %tmp.1
}
define i64 @bar(i64 %x) {
entry:
%tmp.1 = mul i64 %x, 5 ; <i64> [#uses=1]
ret i64 %tmp.1
}

View File

@ -1,9 +1,7 @@
; Make sure this testcase codegens to the lda -1 instruction
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep {\\-1}
; RUN: llvm-as < %s | llc -march=alpha | grep {\\-1}
implementation ; Functions:
long %bar() {
define i64 @bar() {
entry:
ret long -1
ret i64 -1
}

View File

@ -1,10 +1,8 @@
; Make sure this testcase codegens to the ornot instruction
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep eqv
; RUN: llvm-as < %s | llc -march=alpha | grep eqv
implementation ; Functions:
long %bar(long %x) {
define i64 @bar(i64 %x) {
entry:
%tmp.1 = xor long %x, -1 ; <long> [#uses=1]
ret long %tmp.1
%tmp.1 = xor i64 %x, -1 ; <i64> [#uses=1]
ret i64 %tmp.1
}

View File

@ -1,11 +1,10 @@
; Make sure this testcase codegens to the ornot instruction
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep ornot
; RUN: llvm-as < %s | llc -march=alpha | grep ornot
implementation ; Functions:
long %bar(long %x, long %y) {
define i64 @bar(i64 %x, i64 %y) {
entry:
%tmp.1 = xor long %x, -1 ; <long> [#uses=1]
%tmp.2 = or long %y, %tmp.1
ret long %tmp.2
%tmp.1 = xor i64 %x, -1 ; <i64> [#uses=1]
%tmp.2 = or i64 %y, %tmp.1 ; <i64> [#uses=1]
ret i64 %tmp.2
}

View File

@ -1,10 +1,9 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep rpcc
; RUN: llvm-as < %s | llc -march=alpha | grep rpcc
declare ulong %llvm.readcyclecounter()
declare i64 @llvm.readcyclecounter()
ulong %foo() {
define i64 @foo() {
entry:
%tmp.1 = call ulong %llvm.readcyclecounter ()
ret ulong %tmp.1
%tmp.1 = call i64 @llvm.readcyclecounter( ) ; <i64> [#uses=1]
ret i64 %tmp.1
}

View File

@ -1,10 +1,10 @@
; Make sure this testcase codegens to the zapnot instruction
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep zapnot
; RUN: llvm-as < %s | llc -march=alpha | grep zapnot
ulong %foo(ulong %y) {
define i64 @foo(i64 %y) {
entry:
%tmp = shr ulong %y, ubyte 3 ; <ulong> [#uses=1]
%tmp2 = and ulong %tmp, 8191 ; <ulong> [#uses=1]
ret ulong %tmp2
%tmp = lshr i64 %y, 3 ; <i64> [#uses=1]
%tmp2 = and i64 %tmp, 8191 ; <i64> [#uses=1]
ret i64 %tmp2
}

View File

@ -1,17 +1,16 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep .weak.*f
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep .weak.*h
; RUN: llvm-as < %s | llc -march=alpha | grep .weak.*f
; RUN: llvm-as < %s | llc -march=alpha | grep .weak.*h
implementation ; Functions:
weak uint %f() {
define weak i32 @f() {
entry:
unreachable
unreachable
}
void %g() {
define void @g() {
entry:
tail call void %h( )
tail call void @h( )
ret void
}
declare extern_weak void %h()
declare extern_weak void @h()

View File

@ -1,10 +1,9 @@
; Make sure this testcase codegens to the zapnot instruction
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep zapnot
; RUN: llvm-as < %s | llc -march=alpha | grep zapnot
implementation ; Functions:
long %bar(long %x) {
define i64 @bar(i64 %x) {
entry:
%tmp.1 = and long %x, 16711935 ; <long> [#uses=1]
ret long %tmp.1
%tmp.1 = and i64 %x, 16711935 ; <i64> [#uses=1]
ret i64 %tmp.1
}

View File

@ -1,15 +1,15 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep zapnot
; RUN: llvm-as < %s | llc -march=alpha | grep zapnot
;demanded bits mess up this mask in a hard to fix way
;ulong %foo(ulong %y) {
; %tmp = and ulong %y, 65535
; %tmp2 = shr ulong %tmp, ubyte 3
; ret ulong %tmp2
;define i64 @foo(i64 %y) {
; %tmp = and i64 %y, 65535
; %tmp2 = shr i64 %tmp, i8 3
; ret i64 %tmp2
;}
ulong %foo2(ulong %y) {
%tmp = shr ulong %y, ubyte 3 ; <ulong> [#uses=1]
%tmp2 = and ulong %tmp, 8191 ; <ulong> [#uses=1]
ret ulong %tmp2
define i64 @foo2(i64 %y) {
%tmp = lshr i64 %y, 3 ; <i64> [#uses=1]
%tmp2 = and i64 %tmp, 8191 ; <i64> [#uses=1]
ret i64 %tmp2
}

View File

@ -1,8 +1,7 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep zapnot
; RUN: llvm-as < %s | llc -march=alpha | grep zapnot
ulong %foo(ulong %y) {
%tmp = shl ulong %y, ubyte 3 ; <ulong> [#uses=1]
%tmp2 = and ulong %tmp, 65535 ; <ulong> [#uses=1]
ret ulong %tmp2
define i64 @foo(i64 %y) {
%tmp = shl i64 %y, 3 ; <i64> [#uses=1]
%tmp2 = and i64 %tmp, 65535 ; <i64> [#uses=1]
ret i64 %tmp2
}

View File

@ -1,7 +1,8 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
; Make sure that global variables do not collide if they have the same name,
; but different types.
%X = global int 5
%X = global long 7
@X = global i32 5 ; <i32*> [#uses=0]
@X.upgrd.1 = global i64 7 ; <i64*> [#uses=0]

View File

@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
; This case was emitting code that looked like this:
; ...
@ -8,10 +8,13 @@
; Which the Sun C compiler rejected, so now we are sure to put a return
; instruction in there if the basic block is otherwise empty.
;
void "test"() {
br label %BB1
BB2:
br label %BB2
BB1:
ret void
define void @test() {
br label %BB1
BB2: ; preds = %BB2
br label %BB2
BB1: ; preds = %0
ret void
}

View File

@ -1,7 +1,7 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
; Test const pointer refs & forward references
%t3 = global int * %t1 ;; Forward reference
%t1 = global int 4
@t3 = global i32* @t1 ; <i32**> [#uses=0]
@t1 = global i32 4 ; <i32*> [#uses=1]

View File

@ -1,9 +1,8 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
global int* cast (float* %0 to int*) ;; Forward numeric reference
global float* %0 ;; Duplicate forward numeric reference
global i32* bitcast (float* @2 to i32*) ;; Forward numeric reference
global float* @2 ;; Duplicate forward numeric reference
global float 0.0
%array = constant [2 x int] [ int 12, int 52 ]
%arrayPtr = global int* getelementptr ([2 x int]* %array, long 0, long 0) ;; int* &%array[0][0]
@array = constant [2 x i32] [ i32 12, i32 52 ]
@arrayPtr = global i32* getelementptr ([2 x i32]* @array, i64 0, i64 0)

View File

@ -1,5 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
%sptr1 = global [11x sbyte]* %somestr ;; Forward ref to a constant
%somestr = constant [11x sbyte] c"hello world"
; RUN: llvm-as < %s | llc -march=c
@sptr1 = global [11 x i8]* @somestr ;; Forward ref to a constant
@somestr = constant [11 x i8] c"hello world"

View File

@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
%fptr = global void() * %f ;; Forward ref method defn
declare void "f"() ;; External method
@fptr = global void ()* @f ;; Forward ref method defn
declare void @f() ;; External method

View File

@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
%array = constant [2 x int] [ int 12, int 52 ] ; <[2 x int]*> [#uses=1]
%arrayPtr = global int* getelementptr ([2 x int]* %array, long 0, long 0) ; <int**> [#uses=1]
@array = constant [2 x i32] [ i32 12, i32 52 ] ; <[2 x i32]*> [#uses=1]
@arrayPtr = global i32* getelementptr ([2 x i32]* @array, i64 0, i64 0) ; <i32**> [#uses=0]

View File

@ -1,4 +1,3 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
%MyIntList = uninitialized global { \2 *, int }
; RUN: llvm-as < %s | llc -march=c
@MyIntList = external global { \2*, i32 }

View File

@ -1,11 +1,10 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
; The C Writer bombs on this testcase because it tries the print the prototype
; for the test function, which tries to print the argument name. The function
; has not been incorporated into the slot calculator, so after it does the name
; lookup, it tries a slot calculator lookup, which fails.
int %test(int) {
ret int 0
define i32 @test(i32) {
ret i32 0
}

View File

@ -1,16 +1,17 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
; Indirect function call test... found by Joel & Brian
;
%taskArray = uninitialized global int*
@taskArray = external global i32* ; <i32**> [#uses=1]
void %test(int %X) {
%Y = add int %X, -1 ; <int>:1 [#uses=3]
%cast100 = cast int %Y to long ; <uint> [#uses=1]
%gep100 = getelementptr int** %taskArray, long %cast100 ; <int**> [#uses=1]
%fooPtr = load int** %gep100 ; <int*> [#uses=1]
%cast101 = cast int* %fooPtr to void (int)* ; <void (int)*> [#uses=1]
call void %cast101( int 1000 )
ret void
define void @test(i32 %X) {
%Y = add i32 %X, -1 ; <i32> [#uses=1]
%cast100 = sext i32 %Y to i64 ; <i64> [#uses=1]
%gep100 = getelementptr i32** @taskArray, i64 %cast100 ; <i32**> [#uses=1]
%fooPtr = load i32** %gep100 ; <i32*> [#uses=1]
%cast101 = bitcast i32* %fooPtr to void (i32)* ; <void (i32)*> [#uses=1]
call void %cast101( i32 1000 )
ret void
}

View File

@ -1,7 +1,8 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
; This testcase fails because the C backend does not arrange to output the
; contents of a structure type before it outputs the structure type itself.
%Y = uninitialized global { {int } }
%X = uninitialized global { float }
@Y = external global { { i32 } } ; <{ { i32 } }*> [#uses=0]
@X = external global { float } ; <{ float }*> [#uses=0]

View File

@ -1,10 +1,7 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
implementation
void %test() {
%X = alloca [4xint]
ret void
define void @test() {
%X = alloca [4 x i32] ; <[4 x i32]*> [#uses=0]
ret void
}

View File

@ -1,6 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
declare void %foo(...)
declare void @foo(...)

View File

@ -1,7 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
%MPI_Comm = type %struct.Comm*
%struct.Comm = type opaque
%thing = global %MPI_Comm* null ; <%MPI_Comm**> [#uses=0]
%MPI_Comm = type %struct.Comm*
%struct.Comm = type opaque
@thing = global %MPI_Comm* null ; <%MPI_Comm**> [#uses=0]
implementation ; Functions:

View File

@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
%bob = external global int ; <int*> [#uses=2]
@bob = external global i32 ; <i32*> [#uses=0]

View File

@ -1,12 +1,10 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
%BitField = type i32
%tokenptr = type i32*
%BitField = type int
%tokenptr = type %BitField*
implementation
void %test() {
%pmf1 = alloca %tokenptr (%tokenptr, sbyte*)*
ret void
define void @test() {
%pmf1 = alloca %tokenptr (%tokenptr, i8*)* ; <%tokenptr (%tokenptr, i8*)**> [#uses=0]
ret void
}

View File

@ -1,12 +1,11 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
%testString = internal constant [18 x sbyte] c "Escaped newline\n\00"
@testString = internal constant [18 x i8] c"Escaped newline\5Cn\00" ; <[18 x i8]*> [#uses=1]
implementation
declare i32 @printf(i8*, ...)
declare int %printf(sbyte*, ...)
int %main() {
call int (sbyte*, ...)* %printf( sbyte* getelementptr ([18 x sbyte]* %testString, long 0, long 0))
ret int 0
define i32 @main() {
call i32 (i8*, ...)* @printf( i8* getelementptr ([18 x i8]* @testString, i64 0, i64 0) ) ; <i32>:1 [#uses=0]
ret i32 0
}

View File

@ -1,7 +1,8 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
; Apparently this constant was unsigned in ISO C 90, but not in C 99.
int %foo() {
ret int -2147483648
define i32 @foo() {
ret i32 -2147483648
}

View File

@ -1,10 +1,11 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
; This testcase breaks the C backend, because gcc doesn't like (...) functions
; with no arguments at all.
void %test(long %Ptr) {
%P = cast long %Ptr to void(...) *
call void(...)* %P(long %Ptr)
ret void
define void @test(i64 %Ptr) {
%P = inttoptr i64 %Ptr to void (...)* ; <void (...)*> [#uses=1]
call void (...)* %P( i64 %Ptr )
ret void
}

View File

@ -1,6 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
; The C backend was dying when there was no typename for a struct type!
declare int %test(int,{ [32 x int] }*)
declare i32 @test(i32, { [32 x i32] }*)

View File

@ -1,9 +1,9 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
%X = type { i32, float }
%X = type { int, float }
void %test() {
getelementptr %X* null, long 0, uint 1
ret void
define void @test() {
getelementptr %X* null, i64 0, i32 1 ; <float*>:1 [#uses=0]
ret void
}

View File

@ -1,5 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
; Make sure hex constant does not continue into a valid hexadecimal letter/number
%version = global [3 x sbyte] c"\001\00"
@version = global [3 x i8] c"\001\00"

View File

@ -1,5 +1,3 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
%version = global [3 x sbyte] c"1\00\00"
; RUN: llvm-as < %s | llc -march=c
@version = global [3 x i8] c"1\00\00"

View File

@ -1,16 +1,17 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c > %t1.cbe.c
; RUN: llvm-as < %s | llc -march=c > %t1.cbe.c
; RUN: gcc -B/usr/bin/ %t1.cbe.c -o %t1.cbe
; RUN: ./%t1.cbe
bool %doTest(ubyte %x) {
%dec.0 = add ubyte %x, 255
%tmp.1001 = trunc ubyte %dec.0 to bool
ret bool %tmp.1001
define i1 @doTest(i8 %x) {
%dec.0 = add i8 %x, -1 ; <i8> [#uses=1]
%tmp.1001 = trunc i8 %dec.0 to i1 ; <i1> [#uses=1]
ret i1 %tmp.1001
}
int %main () {
%result = call bool %doTest(ubyte 1)
%p = cast bool %result to int
ret int %p
define i32 @main() {
%result = call i1 @doTest( i8 1 ) ; <i1> [#uses=1]
%p = zext i1 %result to i32 ; <i32> [#uses=1]
ret i32 %p
}

View File

@ -1,14 +1,17 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
declare i32 @callee(i32, i32)
declare int %callee(int, int)
define i32 @test(i32 %X) {
; <label>:0
%A = invoke i32 @callee( i32 %X, i32 5 )
to label %Ok unwind label %Threw ; <i32> [#uses=1]
Ok: ; preds = %Threw, %0
%B = phi i32 [ %A, %0 ], [ -1, %Threw ] ; <i32> [#uses=1]
ret i32 %B
int %test(int %X) {
%A = invoke int %callee(int %X, int 5) to label %Ok except label %Threw
Ok:
%B = phi int [%A, %0], [-1, %Threw]
ret int %B
Threw:
br label %Ok
Threw: ; preds = %0
br label %Ok
}

View File

@ -1,4 +1,3 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep common | grep X
%X = linkonce global int 5
; RUN: llvm-as < %s | llc -march=c | grep common | grep X
@X = linkonce global i32 5

View File

@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
; This is a non-normal FP value: it's a nan.
%NAN = global { float } { float 0x7FF8000000000000 }
%NANs = global { float } { float 0x7FF4000000000000 }
@NAN = global { float } { float 0x7FF8000000000000 } ; <{ float }*> [#uses=0]
@NANs = global { float } { float 0x7FFC000000000000 } ; <{ float }*> [#uses=0]

View File

@ -1,6 +1,8 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
%A = type { i32, i8*, { i32, i32, i32, i32, i32, i32, i32, i32 }*, i16 }
%A = type { uint, sbyte*, { uint, uint, uint, uint, uint, uint, uint, uint }*, ushort }
define void @test(%A*) {
ret void
}
void %test(%A *) { ret void }

View File

@ -1,12 +1,12 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
; reduced from DOOM.
%union._XEvent = type { int }
%.X_event_9 = global %union._XEvent zeroinitializer
%union._XEvent = type { i32 }
@.X_event_9 = global %union._XEvent zeroinitializer ; <%union._XEvent*> [#uses=1]
implementation ; Functions:
void %I_InitGraphics() {
shortcirc_next.3: ; preds = %no_exit.1
%tmp.319 = load int* getelementptr ({ int, int }* cast (%union._XEvent* %.X_event_9 to { int, int }*), long 0, uint 1) ; <int> [#uses=1]
ret void
define void @I_InitGraphics() {
shortcirc_next.3:
%tmp.319 = load i32* getelementptr ({ i32, i32 }* bitcast (%union._XEvent* @.X_event_9 to { i32, i32 }*), i64 0, i32 1) ; <i32> [#uses=0]
ret void
}

View File

@ -1,12 +1,13 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
@y = weak global i8 0 ; <i8*> [#uses=1]
%y = weak global sbyte 0
implementation
uint %testcaseshr() {
define i32 @testcaseshr() {
entry:
ret uint shr (uint cast (sbyte* %y to uint), ubyte 4)
ret i32 lshr (i32 ptrtoint (i8* @y to i32), i32 4)
}
uint %testcaseshl() {
define i32 @testcaseshl() {
entry:
ret uint shl (uint cast (sbyte* %y to uint), ubyte 4)
ret i32 shl (i32 ptrtoint (i8* @y to i32), i32 4)
}

View File

@ -1,14 +1,16 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep builtin_return_address
; RUN: llvm-as < %s | llc -march=c | grep builtin_return_address
declare sbyte* %llvm.returnaddress(uint)
declare sbyte* %llvm.frameaddress(uint)
declare i8* @llvm.returnaddress(i32)
sbyte *%test1() {
%X = call sbyte* %llvm.returnaddress(uint 0)
ret sbyte* %X
declare i8* @llvm.frameaddress(i32)
define i8* @test1() {
%X = call i8* @llvm.returnaddress( i32 0 ) ; <i8*> [#uses=1]
ret i8* %X
}
sbyte *%test2() {
%X = call sbyte* %llvm.frameaddress(uint 0)
ret sbyte* %X
define i8* @test2() {
%X = call i8* @llvm.frameaddress( i32 0 ) ; <i8*> [#uses=1]
ret i8* %X
}

View File

@ -4,13 +4,15 @@
; this testcase for example, which caused the CBE to mangle one, screwing
; everything up. :( Test that this does not happen anymore.
;
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | not grep _memcpy
; RUN: llvm-as < %s | llc -march=c | not grep _memcpy
declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint,uint)
declare float* %memcpy(int*, uint,int)
declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
int %test(sbyte *%A, sbyte* %B, int* %C) {
call float* %memcpy(int* %C, uint 4, int 17)
call void %llvm.memcpy.i32(sbyte* %A, sbyte* %B, uint 123, uint 14)
ret int 7
declare float* @memcpy(i32*, i32, i32)
define i32 @test(i8* %A, i8* %B, i32* %C) {
call float* @memcpy( i32* %C, i32 4, i32 17 ) ; <float*>:1 [#uses=0]
call void @llvm.memcpy.i32( i8* %A, i8* %B, i32 123, i32 14 )
ret i32 7
}

View File

@ -1,10 +1,11 @@
; This is a non-normal FP value
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep FPConstant | grep static
; RUN: llvm-as < %s | llc -march=c | grep FPConstant | grep static
float %func () {
ret float 0xFFF0000000000000 ; -inf
define float @func() {
ret float 0xFFF0000000000000
}
double %func2() {
ret double 0xFF20000000000000 ; -inf
define double @func2() {
ret double 0xFF20000000000000
}

View File

@ -1,8 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep func1 | grep WEAK
; RUN: llvm-as < %s | llc -march=c | grep func1 | grep WEAK
implementation
linkonce int %func1 () {
ret int 5
define linkonce i32 @func1() {
ret i32 5
}

View File

@ -1,9 +1,10 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
declare void %llvm.va_end(sbyte*)
declare void @llvm.va_end(i8*)
void %test() {
call void %llvm.va_end( sbyte* null )
ret void
define void @test() {
%va.upgrd.1 = bitcast i8* null to i8* ; <i8*> [#uses=1]
call void @llvm.va_end( i8* %va.upgrd.1 )
ret void
}

View File

@ -1,17 +1,12 @@
; The CBE should not emit code that casts the function pointer. This causes
; GCC to get testy and insert trap instructions instead of doing the right
; thing. :(
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
implementation
declare void @external(i8*)
declare void %external(sbyte*)
int %test(int *%X) {
%RV = call int (int*)* cast (void(sbyte*)* %external to int(int*)*)(int* %X)
ret int %RV
define i32 @test(i32* %X) {
%RV = call i32 bitcast (void (i8*)* @external to i32 (i32*)*)( i32* %X ) ; <i32> [#uses=1]
ret i32 %RV
}

View File

@ -1,12 +1,10 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | not grep extern.*msg
; RUN: llvm-as < %s | llc -march=c | not grep extern.*msg
; PR472
; This is PR472
@msg = internal global [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1]
%msg = internal global [6 x sbyte] c"hello\00"
implementation ; Functions:
sbyte* %foo() {
define i8* @foo() {
entry:
ret sbyte* getelementptr ([6 x sbyte]* %msg, int 0, int 0)
ret i8* getelementptr ([6 x i8]* @msg, i32 0, i32 0)
}

View File

@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
int %foo() {
ret int and (int 123456, int cast (int()* %foo to int))
define i32 @foo() {
ret i32 and (i32 123456, i32 ptrtoint (i32 ()* @foo to i32))
}

View File

@ -1,7 +1,8 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep volatile
; RUN: llvm-as < %s | llc -march=c | grep volatile
void %test(int* %P) {
%X = volatile load int*%P
volatile store int %X, int* %P
ret void
define void @test(i32* %P) {
%X = volatile load i32* %P ; <i32> [#uses=1]
volatile store i32 %X, i32* %P
ret void
}

View File

@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
; RUN: llvm-as < %s | llc -march=c
%JNIEnv = type %struct.JNINa*
%struct.JNINa = type { sbyte*, sbyte*, sbyte*, void (%JNIEnv*)* }
%JNIEnv = type %struct.JNINa*
%struct.JNINa = type { i8*, i8*, i8*, void (%JNIEnv*)* }

View File

@ -1,20 +1,18 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | not grep -- --65535
; RUN: llvm-as < %s | llc -march=c | not grep -- --65535
; PR596
target endian = little
target pointersize = 32
target datalayout = "e-p:32:32"
target triple = "i686-pc-linux-gnu"
implementation ; Functions:
declare void @func(i32)
declare void %func(int)
void %funcb() {
define void @funcb() {
entry:
%tmp.1 = sub int 0, -65535 ; <int> [#uses=1]
call void %func( int %tmp.1 )
br label %return
%tmp.1 = sub i32 0, -65535 ; <i32> [#uses=1]
call void @func( i32 %tmp.1 )
br label %return
return: ; preds = %entry
ret void
return: ; preds = %entry
ret void
}

View File

@ -1,6 +1,7 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep fmod
; RUN: llvm-as < %s | llc -march=c | grep fmod
double %test(double %A, double %B) {
%C = rem double %A, %B
ret double %C
define double @test(double %A, double %B) {
%C = frem double %A, %B ; <double> [#uses=1]
ret double %C
}

View File

@ -1,9 +1,10 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep {\\* *volatile *\\*}
; RUN: llvm-as < %s | llc -march=c | grep {\\* *volatile *\\*}
%G = external global void()*
@G = external global void ()* ; <void ()**> [#uses=2]
void %test() {
volatile store void()* %test, void()** %G
volatile load void()** %G
ret void
define void @test() {
volatile store void ()* @test, void ()** @G
volatile load void ()** @G ; <void ()*>:1 [#uses=0]
ret void
}

View File

@ -1,48 +1,49 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | \
; RUN: llvm-as < %s | llc -march=c | \
; RUN: grep __BITCAST | count 14
int %test1(float %F) {
%X = bitcast float %F to int
ret int %X
define i32 @test1(float %F) {
%X = bitcast float %F to i32 ; <i32> [#uses=1]
ret i32 %X
}
float %test2(int %I) {
%X = bitcast int %I to float
ret float %X
define float @test2(i32 %I) {
%X = bitcast i32 %I to float ; <float> [#uses=1]
ret float %X
}
long %test3(double %D) {
%X = bitcast double %D to long
ret long %X
define i64 @test3(double %D) {
%X = bitcast double %D to i64 ; <i64> [#uses=1]
ret i64 %X
}
double %test4(long %L) {
%X = bitcast long %L to double
ret double %X
define double @test4(i64 %L) {
%X = bitcast i64 %L to double ; <double> [#uses=1]
ret double %X
}
double %test5(double %D) {
%X = bitcast double %D to double
%Y = add double %X, 2.0
%Z = bitcast double %Y to long
%res = bitcast long %Z to double
ret double %res
define double @test5(double %D) {
%X = bitcast double %D to double ; <double> [#uses=1]
%Y = add double %X, 2.000000e+00 ; <double> [#uses=1]
%Z = bitcast double %Y to i64 ; <i64> [#uses=1]
%res = bitcast i64 %Z to double ; <double> [#uses=1]
ret double %res
}
float %test6(float %F) {
%X = bitcast float %F to float
%Y = add float %X, 2.0
%Z = bitcast float %Y to int
%res = bitcast int %Z to float
ret float %res
define float @test6(float %F) {
%X = bitcast float %F to float ; <float> [#uses=1]
%Y = add float %X, 2.000000e+00 ; <float> [#uses=1]
%Z = bitcast float %Y to i32 ; <i32> [#uses=1]
%res = bitcast i32 %Z to float ; <float> [#uses=1]
ret float %res
}
int %main(int %argc, sbyte** %argv) {
%a = call int %test1(float 0x400921FB40000000)
%b = call float %test2(int %a)
%c = call long %test3(double 0x400921FB4D12D84A)
%d = call double %test4(long %c)
%e = call double %test5(double 7.0)
%f = call float %test6(float 7.0)
ret int %a
define i32 @main(i32 %argc, i8** %argv) {
%a = call i32 @test1( float 0x400921FB40000000 ) ; <i32> [#uses=2]
%b = call float @test2( i32 %a ) ; <float> [#uses=0]
%c = call i64 @test3( double 0x400921FB4D12D84A ) ; <i64> [#uses=1]
%d = call double @test4( i64 %c ) ; <double> [#uses=0]
%e = call double @test5( double 7.000000e+00 ) ; <double> [#uses=0]
%f = call float @test6( float 7.000000e+00 ) ; <float> [#uses=0]
ret i32 %a
}

View File

@ -1,15 +1,13 @@
; RUN: llvm-upgrade < %s | llvm-as -o - | llc
; RUN: llvm-as < %s -o - | llc
; This caused the backend to assert out with:
; SparcInstrInfo.cpp:103: failed assertion `0 && "Unexpected unsigned type"'
;
implementation
declare void "bar"(sbyte* %G)
declare void @bar(i8*)
void "foo"()
begin
%cast225 = cast ulong 123456 to sbyte* ; <sbyte*> [#uses=1]
call void %bar( sbyte* %cast225)
ret void
end
define void @foo() {
%cast225 = inttoptr i64 123456 to i8* ; <i8*> [#uses=1]
call void @bar( i8* %cast225 )
ret void
}

View File

@ -1,18 +1,14 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
; Compiling this file produces:
; Sparc.cpp:91: failed assertion `(offset - OFFSET) % getStackFrameSizeAlignment() == 0'
;
implementation
declare int "SIM"(sbyte* %A, sbyte* %B, int %M, int %N, int %K, [256 x int]* %V, int %Q, int %R, int %nseq)
void "foo"()
begin
bb0: ;[#uses=0]
%V = alloca [256 x int], uint 256 ; <[256 x int]*> [#uses=1]
call int %SIM( sbyte* null, sbyte* null, int 0, int 0, int 0, [256 x int]* %V, int 0, int 0, int 2 ) ; <int>:0 [#uses=0]
ret void
end
declare i32 @SIM(i8*, i8*, i32, i32, i32, [256 x i32]*, i32, i32, i32)
define void @foo() {
bb0:
%V = alloca [256 x i32], i32 256 ; <[256 x i32]*> [#uses=1]
call i32 @SIM( i8* null, i8* null, i32 0, i32 0, i32 0, [256 x i32]* %V, i32 0, i32 0, i32 2 ) ; <i32>:0 [#uses=0]
ret void
}

View File

@ -1,18 +1,19 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
void %QRiterate(int %p.1, double %tmp.212) {
entry: ; No predecessors!
%tmp.184 = setgt int %p.1, 0 ; <bool> [#uses=1]
br bool %tmp.184, label %shortcirc_next.1, label %shortcirc_done.1
define void @QRiterate(i32 %p.1, double %tmp.212) {
entry:
%tmp.184 = icmp sgt i32 %p.1, 0 ; <i1> [#uses=1]
br i1 %tmp.184, label %shortcirc_next.1, label %shortcirc_done.1
shortcirc_next.1: ; preds = %entry
%tmp.213 = setne double %tmp.212, 0.000000e+00
shortcirc_next.1: ; preds = %shortcirc_done.1, %entry
%tmp.213 = fcmp une double %tmp.212, 0.000000e+00 ; <i1> [#uses=1]
br label %shortcirc_done.1
shortcirc_done.1: ; preds = %entry, %shortcirc_next.1
%val.1 = phi bool [ false, %entry ], [ %tmp.213, %shortcirc_next.1 ]
br bool %val.1, label %shortcirc_next.1, label %exit.1
shortcirc_done.1: ; preds = %shortcirc_next.1, %entry
%val.1 = phi i1 [ false, %entry ], [ %tmp.213, %shortcirc_next.1 ] ; <i1> [#uses=1]
br i1 %val.1, label %shortcirc_next.1, label %exit.1
exit.1:
ret void
exit.1: ; preds = %shortcirc_done.1
ret void
}

View File

@ -1,13 +1,13 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
void %QRiterate(double %tmp.212) {
%tmp.213 = setne double %tmp.212, 0.000000e+00
define void @QRiterate(double %tmp.212) {
%tmp.213 = fcmp une double %tmp.212, 0.000000e+00 ; <i1> [#uses=1]
br label %shortcirc_next.1
shortcirc_next.1: ; preds = %entry
br bool %tmp.213, label %shortcirc_next.1, label %exit.1
shortcirc_next.1: ; preds = %shortcirc_next.1, %0
br i1 %tmp.213, label %shortcirc_next.1, label %exit.1
exit.1:
ret void
exit.1: ; preds = %shortcirc_next.1
ret void
}

View File

@ -1,13 +1,14 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
void %QRiterate(double %tmp.212) {
entry: ; No predecessors!
define void @QRiterate(double %tmp.212) {
entry:
br label %shortcirc_next.1
shortcirc_next.1: ; preds = %entry
%tmp.213 = setne double %tmp.212, 0.000000e+00
br bool %tmp.213, label %shortcirc_next.1, label %exit.1
shortcirc_next.1: ; preds = %shortcirc_next.1, %entry
%tmp.213 = fcmp une double %tmp.212, 0.000000e+00 ; <i1> [#uses=1]
br i1 %tmp.213, label %shortcirc_next.1, label %exit.1
exit.1:
ret void
exit.1: ; preds = %shortcirc_next.1
ret void
}

View File

@ -1,156 +1,153 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
;; Date: May 28, 2003.
;; From: test/Programs/External/SPEC/CINT2000/175.vpr.llvm.bc
;; Function: int %main(int %argc.1, sbyte** %argv.1)
;;
;; Error: A function call with about 56 arguments causes an assertion failure
;; in llc because the register allocator cannot find a register
;; not used explicitly by the call instruction.
;;
;; in llc because the register allocator cannot find a register
;; not used explicitly by the call instruction.
;;
;; Cause: Regalloc was not keeping track of free registers correctly.
;; It was counting the registers allocated to all outgoing arguments,
;; even though most of those are copied to the stack (so those
;; registers are not actually used by the call instruction).
;; It was counting the registers allocated to all outgoing arguments,
;; even though most of those are copied to the stack (so those
;; registers are not actually used by the call instruction).
;;
;; Fixed: By rewriting selection and allocation so that selection explicitly
;; inserts all copy operations required for passing arguments and
;; inserts all copy operations required for passing arguments and
;; for the return value of a call, copying to/from registers
;; and/or to stack locations as needed.
;;
%struct..s_annealing_sched = type { i32, float, float, float, float }
%struct..s_chan = type { i32, float, float, float, float }
%struct..s_det_routing_arch = type { i32, float, float, float, i32, i32, i16, i16, i16, float, float }
%struct..s_placer_opts = type { i32, float, i32, i32, i8*, i32, i32 }
%struct..s_router_opts = type { float, float, float, float, float, i32, i32, i32, i32 }
%struct..s_segment_inf = type { float, i32, i16, i16, float, float, i32, float, float }
%struct..s_switch_inf = type { i32, float, float, float, float }
%struct..s_annealing_sched = type { uint, float, float, float, float }
%struct..s_chan = type { uint, float, float, float, float }
%struct..s_det_routing_arch = type { uint, float, float, float, uint, int, short, short, short, float, float }
%struct..s_placer_opts = type { int, float, int, uint, sbyte*, uint, int }
%struct..s_router_opts = type { float, float, float, float, float, int, int, uint, int }
%struct..s_segment_inf = type { float, int, short, short, float, float, uint, float, float }
%struct..s_switch_inf = type { uint, float, float, float, float }
define i32 @main(i32 %argc.1, i8** %argv.1) {
entry:
%net_file = alloca [300 x i8] ; <[300 x i8]*> [#uses=1]
%place_file = alloca [300 x i8] ; <[300 x i8]*> [#uses=1]
%arch_file = alloca [300 x i8] ; <[300 x i8]*> [#uses=1]
%route_file = alloca [300 x i8] ; <[300 x i8]*> [#uses=1]
%full_stats = alloca i32 ; <i32*> [#uses=1]
%operation = alloca i32 ; <i32*> [#uses=1]
%verify_binary_search = alloca i32 ; <i32*> [#uses=1]
%show_graphics = alloca i32 ; <i32*> [#uses=1]
%annealing_sched = alloca %struct..s_annealing_sched ; <%struct..s_annealing_sched*> [#uses=5]
%placer_opts = alloca %struct..s_placer_opts ; <%struct..s_placer_opts*> [#uses=7]
%router_opts = alloca %struct..s_router_opts ; <%struct..s_router_opts*> [#uses=9]
%det_routing_arch = alloca %struct..s_det_routing_arch ; <%struct..s_det_routing_arch*> [#uses=11]
%segment_inf = alloca %struct..s_segment_inf* ; <%struct..s_segment_inf**> [#uses=1]
%timing_inf = alloca { i32, float, float, float, float, float, float, float, float, float, float } ; <{ i32, float, float, float, float, float, float, float, float, float, float }*> [#uses=11]
%tmp.101 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 4 ; <i8**> [#uses=1]
%tmp.105 = getelementptr [300 x i8]* %net_file, i64 0, i64 0 ; <i8*> [#uses=1]
%tmp.106 = getelementptr [300 x i8]* %arch_file, i64 0, i64 0 ; <i8*> [#uses=1]
%tmp.107 = getelementptr [300 x i8]* %place_file, i64 0, i64 0 ; <i8*> [#uses=1]
%tmp.108 = getelementptr [300 x i8]* %route_file, i64 0, i64 0 ; <i8*> [#uses=1]
%tmp.109 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 0 ; <i32*> [#uses=1]
%tmp.112 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 0 ; <i32*> [#uses=1]
%tmp.114 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 6 ; <i32*> [#uses=1]
%tmp.118 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 7 ; <i32*> [#uses=1]
%tmp.135 = load i32* %operation ; <i32> [#uses=1]
%tmp.137 = load i32* %tmp.112 ; <i32> [#uses=1]
%tmp.138 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 1 ; <float*> [#uses=1]
%tmp.139 = load float* %tmp.138 ; <float> [#uses=1]
%tmp.140 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 2 ; <i32*> [#uses=1]
%tmp.141 = load i32* %tmp.140 ; <i32> [#uses=1]
%tmp.142 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 3 ; <i32*> [#uses=1]
%tmp.143 = load i32* %tmp.142 ; <i32> [#uses=1]
%tmp.145 = load i8** %tmp.101 ; <i8*> [#uses=1]
%tmp.146 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 5 ; <i32*> [#uses=1]
%tmp.147 = load i32* %tmp.146 ; <i32> [#uses=1]
%tmp.149 = load i32* %tmp.114 ; <i32> [#uses=1]
%tmp.154 = load i32* %full_stats ; <i32> [#uses=1]
%tmp.155 = load i32* %verify_binary_search ; <i32> [#uses=1]
%tmp.156 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 0 ; <i32*> [#uses=1]
%tmp.157 = load i32* %tmp.156 ; <i32> [#uses=1]
%tmp.158 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 1 ; <float*> [#uses=1]
%tmp.159 = load float* %tmp.158 ; <float> [#uses=1]
%tmp.160 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 2 ; <float*> [#uses=1]
%tmp.161 = load float* %tmp.160 ; <float> [#uses=1]
%tmp.162 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 3 ; <float*> [#uses=1]
%tmp.163 = load float* %tmp.162 ; <float> [#uses=1]
%tmp.164 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 4 ; <float*> [#uses=1]
%tmp.165 = load float* %tmp.164 ; <float> [#uses=1]
%tmp.166 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 0 ; <float*> [#uses=1]
%tmp.167 = load float* %tmp.166 ; <float> [#uses=1]
%tmp.168 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 1 ; <float*> [#uses=1]
%tmp.169 = load float* %tmp.168 ; <float> [#uses=1]
%tmp.170 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 2 ; <float*> [#uses=1]
%tmp.171 = load float* %tmp.170 ; <float> [#uses=1]
%tmp.172 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 3 ; <float*> [#uses=1]
%tmp.173 = load float* %tmp.172 ; <float> [#uses=1]
%tmp.174 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 4 ; <float*> [#uses=1]
%tmp.175 = load float* %tmp.174 ; <float> [#uses=1]
%tmp.176 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 5 ; <i32*> [#uses=1]
%tmp.177 = load i32* %tmp.176 ; <i32> [#uses=1]
%tmp.178 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 6 ; <i32*> [#uses=1]
%tmp.179 = load i32* %tmp.178 ; <i32> [#uses=1]
%tmp.181 = load i32* %tmp.118 ; <i32> [#uses=1]
%tmp.182 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 8 ; <i32*> [#uses=1]
%tmp.183 = load i32* %tmp.182 ; <i32> [#uses=1]
%tmp.184 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 0 ; <i32*> [#uses=1]
%tmp.185 = load i32* %tmp.184 ; <i32> [#uses=1]
%tmp.186 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 1 ; <float*> [#uses=1]
%tmp.187 = load float* %tmp.186 ; <float> [#uses=1]
%tmp.188 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 2 ; <float*> [#uses=1]
%tmp.189 = load float* %tmp.188 ; <float> [#uses=1]
%tmp.190 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 3 ; <float*> [#uses=1]
%tmp.191 = load float* %tmp.190 ; <float> [#uses=1]
%tmp.192 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 4 ; <i32*> [#uses=1]
%tmp.193 = load i32* %tmp.192 ; <i32> [#uses=1]
%tmp.194 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 5 ; <i32*> [#uses=1]
%tmp.195 = load i32* %tmp.194 ; <i32> [#uses=1]
%tmp.196 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 6 ; <i16*> [#uses=1]
%tmp.197 = load i16* %tmp.196 ; <i16> [#uses=1]
%tmp.198 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 7 ; <i16*> [#uses=1]
%tmp.199 = load i16* %tmp.198 ; <i16> [#uses=1]
%tmp.200 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 8 ; <i16*> [#uses=1]
%tmp.201 = load i16* %tmp.200 ; <i16> [#uses=1]
%tmp.202 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 9 ; <float*> [#uses=1]
%tmp.203 = load float* %tmp.202 ; <float> [#uses=1]
%tmp.204 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 10 ; <float*> [#uses=1]
%tmp.205 = load float* %tmp.204 ; <float> [#uses=1]
%tmp.206 = load %struct..s_segment_inf** %segment_inf ; <%struct..s_segment_inf*> [#uses=1]
%tmp.208 = load i32* %tmp.109 ; <i32> [#uses=1]
%tmp.209 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 1 ; <float*> [#uses=1]
%tmp.210 = load float* %tmp.209 ; <float> [#uses=1]
%tmp.211 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 2 ; <float*> [#uses=1]
%tmp.212 = load float* %tmp.211 ; <float> [#uses=1]
%tmp.213 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 3 ; <float*> [#uses=1]
%tmp.214 = load float* %tmp.213 ; <float> [#uses=1]
%tmp.215 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 4 ; <float*> [#uses=1]
%tmp.216 = load float* %tmp.215 ; <float> [#uses=1]
%tmp.217 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 5 ; <float*> [#uses=1]
%tmp.218 = load float* %tmp.217 ; <float> [#uses=1]
%tmp.219 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 6 ; <float*> [#uses=1]
%tmp.220 = load float* %tmp.219 ; <float> [#uses=1]
%tmp.221 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 7 ; <float*> [#uses=1]
%tmp.222 = load float* %tmp.221 ; <float> [#uses=1]
%tmp.223 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 8 ; <float*> [#uses=1]
%tmp.224 = load float* %tmp.223 ; <float> [#uses=1]
%tmp.225 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 9 ; <float*> [#uses=1]
%tmp.226 = load float* %tmp.225 ; <float> [#uses=1]
%tmp.227 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 10 ; <float*> [#uses=1]
%tmp.228 = load float* %tmp.227 ; <float> [#uses=1]
call void @place_and_route( i32 %tmp.135, i32 %tmp.137, float %tmp.139, i32 %tmp.141, i32 %tmp.143, i8* %tmp.145, i32 %tmp.147, i32 %tmp.149, i8* %tmp.107, i8* %tmp.105, i8* %tmp.106, i8* %tmp.108, i32 %tmp.154, i32 %tmp.155, i32 %tmp.157, float %tmp.159, float %tmp.161, float %tmp.163, float %tmp.165, float %tmp.167, float %tmp.169, float %tmp.171, float %tmp.173, float %tmp.175, i32 %tmp.177, i32 %tmp.179, i32 %tmp.181, i32 %tmp.183, i32 %tmp.185, float %tmp.187, float %tmp.189, float %tmp.191, i32 %tmp.193, i32 %tmp.195, i16 %tmp.197, i16 %tmp.199, i16 %tmp.201, float %tmp.203, float %tmp.205, %struct..s_segment_inf* %tmp.206, i32 %tmp.208, float %tmp.210, float %tmp.212, float %tmp.214, float %tmp.216, float %tmp.218, float %tmp.220, float %tmp.222, float %tmp.224, float %tmp.226, float %tmp.228 )
%tmp.231 = load i32* %show_graphics ; <i32> [#uses=1]
%tmp.232 = icmp ne i32 %tmp.231, 0 ; <i1> [#uses=1]
br i1 %tmp.232, label %then.2, label %endif.2
implementation
int %main(int %argc.1, sbyte** %argv.1) {
entry:
%net_file = alloca [300 x sbyte]
%place_file = alloca [300 x sbyte]
%arch_file = alloca [300 x sbyte]
%route_file = alloca [300 x sbyte]
%full_stats = alloca uint
%operation = alloca int
%verify_binary_search = alloca uint
%show_graphics = alloca uint
%annealing_sched = alloca %struct..s_annealing_sched
%placer_opts = alloca %struct..s_placer_opts
%router_opts = alloca %struct..s_router_opts
%det_routing_arch = alloca %struct..s_det_routing_arch
%segment_inf = alloca %struct..s_segment_inf*
%timing_inf = alloca { uint, float, float, float, float, float, float, float, float, float, float }
%tmp.101 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 4
%tmp.105 = getelementptr [300 x sbyte]* %net_file, long 0, long 0
%tmp.106 = getelementptr [300 x sbyte]* %arch_file, long 0, long 0
%tmp.107 = getelementptr [300 x sbyte]* %place_file, long 0, long 0
%tmp.108 = getelementptr [300 x sbyte]* %route_file, long 0, long 0
%tmp.109 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 0
%tmp.112 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 0
%tmp.114 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 6
%tmp.118 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 7
%tmp.135 = load int* %operation
%tmp.137 = load int* %tmp.112
%tmp.138 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 1
%tmp.139 = load float* %tmp.138
%tmp.140 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 2
%tmp.141 = load int* %tmp.140
%tmp.142 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 3
%tmp.143 = load uint* %tmp.142
%tmp.145 = load sbyte** %tmp.101
%tmp.146 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 5
%tmp.147 = load uint* %tmp.146
%tmp.149 = load int* %tmp.114
%tmp.154 = load uint* %full_stats
%tmp.155 = load uint* %verify_binary_search
%tmp.156 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 0
%tmp.157 = load uint* %tmp.156
%tmp.158 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 1
%tmp.159 = load float* %tmp.158
%tmp.160 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 2
%tmp.161 = load float* %tmp.160
%tmp.162 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 3
%tmp.163 = load float* %tmp.162
%tmp.164 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 4
%tmp.165 = load float* %tmp.164
%tmp.166 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 0
%tmp.167 = load float* %tmp.166
%tmp.168 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 1
%tmp.169 = load float* %tmp.168
%tmp.170 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 2
%tmp.171 = load float* %tmp.170
%tmp.172 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 3
%tmp.173 = load float* %tmp.172
%tmp.174 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 4
%tmp.175 = load float* %tmp.174
%tmp.176 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 5
%tmp.177 = load int* %tmp.176
%tmp.178 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 6
%tmp.179 = load int* %tmp.178
%tmp.181 = load uint* %tmp.118
%tmp.182 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 8
%tmp.183 = load int* %tmp.182
%tmp.184 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 0
%tmp.185 = load uint* %tmp.184
%tmp.186 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 1
%tmp.187 = load float* %tmp.186
%tmp.188 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 2
%tmp.189 = load float* %tmp.188
%tmp.190 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 3
%tmp.191 = load float* %tmp.190
%tmp.192 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 4
%tmp.193 = load uint* %tmp.192
%tmp.194 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 5
%tmp.195 = load int* %tmp.194
%tmp.196 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 6
%tmp.197 = load short* %tmp.196
%tmp.198 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 7
%tmp.199 = load short* %tmp.198
%tmp.200 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 8
%tmp.201 = load short* %tmp.200
%tmp.202 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 9
%tmp.203 = load float* %tmp.202
%tmp.204 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 10
%tmp.205 = load float* %tmp.204
%tmp.206 = load %struct..s_segment_inf** %segment_inf
%tmp.208 = load uint* %tmp.109
%tmp.209 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 1
%tmp.210 = load float* %tmp.209
%tmp.211 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 2
%tmp.212 = load float* %tmp.211
%tmp.213 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 3
%tmp.214 = load float* %tmp.213
%tmp.215 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 4
%tmp.216 = load float* %tmp.215
%tmp.217 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 5
%tmp.218 = load float* %tmp.217
%tmp.219 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 6
%tmp.220 = load float* %tmp.219
%tmp.221 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 7
%tmp.222 = load float* %tmp.221
%tmp.223 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 8
%tmp.224 = load float* %tmp.223
%tmp.225 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 9
%tmp.226 = load float* %tmp.225
%tmp.227 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 10
%tmp.228 = load float* %tmp.227
call void %place_and_route( int %tmp.135, int %tmp.137, float %tmp.139, int %tmp.141, uint %tmp.143, sbyte* %tmp.145, uint %tmp.147, int %tmp.149, sbyte* %tmp.107, sbyte* %tmp.105, sbyte* %tmp.106, sbyte* %tmp.108, uint %tmp.154, uint %tmp.155, uint %tmp.157, float %tmp.159, float %tmp.161, float %tmp.163, float %tmp.165, float %tmp.167, float %tmp.169, float %tmp.171, float %tmp.173, float %tmp.175, int %tmp.177, int %tmp.179, uint %tmp.181, int %tmp.183, uint %tmp.185, float %tmp.187, float %tmp.189, float %tmp.191, uint %tmp.193, int %tmp.195, short %tmp.197, short %tmp.199, short %tmp.201, float %tmp.203, float %tmp.205, %struct..s_segment_inf* %tmp.206, uint %tmp.208, float %tmp.210, float %tmp.212, float %tmp.214, float %tmp.216, float %tmp.218, float %tmp.220, float %tmp.222, float %tmp.224, float %tmp.226, float %tmp.228 )
%tmp.231 = load uint* %show_graphics
%tmp.232 = setne uint %tmp.231, 0
br bool %tmp.232, label %then.2, label %endif.2
then.2:
then.2: ; preds = %entry
br label %endif.2
endif.2:
ret int 0
endif.2: ; preds = %then.2, %entry
ret i32 0
}
declare int %printf(sbyte*, ...)
declare i32 @printf(i8*, ...)
declare void %place_and_route(int, int, float, int, uint, sbyte*, uint, int, sbyte*, sbyte*, sbyte*, sbyte*, uint, uint, uint, float, float, float, float, float, float, float, float, float, int, int, uint, int, uint, float, float, float, uint, int, short, short, short, float, float, %struct..s_segment_inf*, uint, float, float, float, float, float, float, float, float, float, float)
declare void @place_and_route(i32, i32, float, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i8*, i32, i32, i32, float, float, float, float, float, float, float, float, float, i32, i32, i32, i32, i32, float, float, float, i32, i32, i16, i16, i16, float, float, %struct..s_segment_inf*, i32, float, float, float, float, float, float, float, float, float, float)

View File

@ -1,4 +1,4 @@
; RUN: llvm-upgrade %s | llvm-as | llc
; RUN: llvm-as < %s | llc
;; Date: May 28, 2003.
;; From: test/Programs/External/SPEC/CINT2000/254.gap.llvm.bc
@ -16,35 +16,24 @@
;; The next instruction contributes a leading non-zero so another
;; zero should not be added before it!
;;
%FileType = type { i32, [256 x i8], i32, i32, i32, i32 }
@OutputFiles = external global [16 x %FileType] ; <[16 x %FileType]*> [#uses=1]
@Output = internal global %FileType* null ; <%FileType**> [#uses=1]
%FileType = type { int, [256 x sbyte], int, int, int, int }
%OutputFiles = uninitialized global [16 x %FileType]
%Output = internal global %FileType* null
implementation; Functions:
internal int %OpenOutput(sbyte* %filename.1) {
define internal i32 @OpenOutput(i8* %filename.1) {
entry:
%tmp.0 = load %FileType** %Output
%tmp.4 = getelementptr %FileType* %tmp.0, long 1
%tmp.0 = load %FileType** @Output ; <%FileType*> [#uses=1]
%tmp.4 = getelementptr %FileType* %tmp.0, i64 1 ; <%FileType*> [#uses=1]
%addrOfGlobal = getelementptr [16 x %FileType]* @OutputFiles, i64 0 ; <[16 x %FileType]*> [#uses=1]
%constantGEP = getelementptr [16 x %FileType]* %addrOfGlobal, i64 1 ; <[16 x %FileType]*> [#uses=1]
%constantGEP.upgrd.1 = getelementptr [16 x %FileType]* %constantGEP, i64 0, i64 0 ; <%FileType*> [#uses=1]
%tmp.10 = icmp eq %FileType* %tmp.4, %constantGEP.upgrd.1 ; <i1> [#uses=1]
br i1 %tmp.10, label %return, label %endif.0
;;------ Original instruction in 254.gap.llvm.bc:
;; %tmp.10 = seteq { int, [256 x sbyte], int, int, int, int }* %tmp.4, getelementptr ([16 x { int, [256 x sbyte], int, int, int, int }]* getelementptr ([16 x { int, [256 x sbyte], int, int, int, int }]* %OutputFiles, long 1), long 0, long 0)
endif.0: ; preds = %entry
ret i32 0
;;------ Code sequence produced by preselection phase for above instr:
;; This code sequence is folded incorrectly by llc during selection
;; causing an assertion about a dynamic casting error.
%addrOfGlobal = getelementptr [16 x %FileType]* %OutputFiles, long 0
%constantGEP = getelementptr [16 x %FileType]* %addrOfGlobal, long 1
%constantGEP = getelementptr [16 x %FileType]* %constantGEP, long 0, long 0
%tmp.10 = seteq %FileType* %tmp.4, %constantGEP
br bool %tmp.10, label %return, label %endif.0
endif.0:
ret int 0
return:
ret int 1
return: ; preds = %entry
ret i32 1
}

View File

@ -1,4 +1,4 @@
; RUN: llvm-upgrade %s | llvm-as | llc
; RUN: llvm-as < %s | llc
;; Date: May 28, 2003.
;; From: test/Programs/SingleSource/richards_benchmark.c
@ -9,26 +9,25 @@
;; causes llc to produces an invalid register <NULL VALUE>
;; for the phi arguments.
%struct..packet = type { %struct..packet*, int, int, int, [4 x sbyte] }
%struct..task = type { %struct..task*, int, int, %struct..packet*, int, %struct..task* (%struct..packet*)*, int, int }
%v1 = external global int
%v2 = external global int
%struct..packet = type { %struct..packet*, i32, i32, i32, [4 x i8] }
%struct..task = type { %struct..task*, i32, i32, %struct..packet*, i32, %struct..task* (%struct..packet*)*, i32, i32 }
@v1 = external global i32 ; <i32*> [#uses=1]
@v2 = external global i32 ; <i32*> [#uses=1]
implementation ; Functions:
define %struct..task* @handlerfn(%struct..packet* %pkt.2) {
entry:
%tmp.1 = icmp ne %struct..packet* %pkt.2, null ; <i1> [#uses=1]
br i1 %tmp.1, label %cond_false, label %cond_continue
%struct..task* %handlerfn(%struct..packet* %pkt.2) {
entry: ; No predecessors!
%tmp.1 = setne %struct..packet* %pkt.2, null
br bool %tmp.1, label %cond_false, label %cond_continue
cond_false: ; preds = %entry
br label %cond_continue
cond_false: ; preds = %entry
br label %cond_continue
cond_continue: ; preds = %entry, %cond_false
%mem_tmp.0 = phi int* [ %v2, %cond_false ], [ %v1, %entry ]
%tmp.12 = cast int* %mem_tmp.0 to %struct..packet*
call void %append( %struct..packet* %pkt.2, %struct..packet* %tmp.12 )
ret %struct..task* null
cond_continue: ; preds = %cond_false, %entry
%mem_tmp.0 = phi i32* [ @v2, %cond_false ], [ @v1, %entry ] ; <i32*> [#uses=1]
%tmp.12 = bitcast i32* %mem_tmp.0 to %struct..packet* ; <%struct..packet*> [#uses=1]
call void @append( %struct..packet* %pkt.2, %struct..packet* %tmp.12 )
ret %struct..task* null
}
declare void %append(%struct..packet*, %struct..packet*)
declare void @append(%struct..packet*, %struct..packet*)

View File

@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
;; Date: May 28, 2003.
;; From: test/Programs/MultiSource/Olden-perimeter/maketree.c
@ -12,41 +12,40 @@
;; is wrong because the value being compared (int euclid = x*x + y*y)
;; overflows, so that the 64-bit and 32-bit compares are not equal.
%.str_1 = internal constant [6 x sbyte] c"true\0A\00"
%.str_2 = internal constant [7 x sbyte] c"false\0A\00"
@.str_1 = internal constant [6 x i8] c"true\0A\00" ; <[6 x i8]*> [#uses=1]
@.str_2 = internal constant [7 x i8] c"false\0A\00" ; <[7 x i8]*> [#uses=1]
implementation ; Functions:
declare i32 @printf(i8*, ...)
declare int %printf(sbyte*, ...)
internal void %__main() {
entry: ; No predecessors!
ret void
define internal void @__main() {
entry:
ret void
}
internal void %CheckOutside(int %x.1, int %y.1) {
entry: ; No predecessors!
%tmp.2 = mul int %x.1, %x.1 ; <int> [#uses=1]
%tmp.5 = mul int %y.1, %y.1 ; <int> [#uses=1]
%tmp.6 = add int %tmp.2, %tmp.5 ; <int> [#uses=1]
%tmp.8 = setle int %tmp.6, 4194304 ; <bool> [#uses=1]
br bool %tmp.8, label %then, label %else
define internal void @CheckOutside(i32 %x.1, i32 %y.1) {
entry:
%tmp.2 = mul i32 %x.1, %x.1 ; <i32> [#uses=1]
%tmp.5 = mul i32 %y.1, %y.1 ; <i32> [#uses=1]
%tmp.6 = add i32 %tmp.2, %tmp.5 ; <i32> [#uses=1]
%tmp.8 = icmp sle i32 %tmp.6, 4194304 ; <i1> [#uses=1]
br i1 %tmp.8, label %then, label %else
then: ; preds = %entry
%tmp.11 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([6 x sbyte]* %.str_1, long 0, long 0) ) ; <int> [#uses=0]
br label %UnifiedExitNode
then: ; preds = %entry
%tmp.11 = call i32 (i8*, ...)* @printf( i8* getelementptr ([6 x i8]* @.str_1, i64 0, i64 0) ) ; <i32> [#uses=0]
br label %UnifiedExitNode
else: ; preds = %entry
%tmp.13 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([7 x sbyte]* %.str_2, long 0, long 0) ) ; <int> [#uses=0]
br label %UnifiedExitNode
else: ; preds = %entry
%tmp.13 = call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @.str_2, i64 0, i64 0) ) ; <i32> [#uses=0]
br label %UnifiedExitNode
UnifiedExitNode: ; preds = %then, %else
ret void
UnifiedExitNode: ; preds = %else, %then
ret void
}
int %main() {
entry: ; No predecessors!
call void %__main( )
call void %CheckOutside( int 2097152, int 2097152 )
ret int 0
define i32 @main() {
entry:
call void @__main( )
call void @CheckOutside( i32 2097152, i32 2097152 )
ret i32 0
}

View File

@ -1,22 +1,20 @@
; RUN: llvm-upgrade %s | llvm-as | llc
; RUN: llvm-as < %s | llc
@.str_1 = internal constant [42 x i8] c" ui = %u (0x%x)\09\09UL-ui = %lld (0x%llx)\0A\00" ; <[42 x i8]*> [#uses=1]
%.str_1 = internal constant [42 x sbyte] c" ui = %u (0x%x)\09\09UL-ui = %lld (0x%llx)\0A\00"
declare i32 @printf(i8*, ...)
implementation ; Functions:
declare int %printf(sbyte*, ...)
internal ulong %getL() {
entry: ; No predecessors!
ret ulong 12659530247033960611
define internal i64 @getL() {
entry:
ret i64 -5787213826675591005
}
int %main(int %argc.1, sbyte** %argv.1) {
entry: ; No predecessors!
%tmp.11 = call ulong %getL( )
%tmp.5 = cast ulong %tmp.11 to uint
%tmp.23 = and ulong %tmp.11, 18446744069414584320
%tmp.16 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([42 x sbyte]* %.str_1, long 0, long 0), uint %tmp.5, uint %tmp.5, ulong %tmp.23, ulong %tmp.23 )
ret int 0
define i32 @main(i32 %argc.1, i8** %argv.1) {
entry:
%tmp.11 = call i64 @getL( ) ; <i64> [#uses=2]
%tmp.5 = trunc i64 %tmp.11 to i32 ; <i32> [#uses=2]
%tmp.23 = and i64 %tmp.11, -4294967296 ; <i64> [#uses=2]
%tmp.16 = call i32 (i8*, ...)* @printf( i8* getelementptr ([42 x i8]* @.str_1, i64 0, i64 0), i32 %tmp.5, i32 %tmp.5, i64 %tmp.23, i64 %tmp.23 ) ; <i32> [#uses=0]
ret i32 0
}

View File

@ -1,4 +1,4 @@
; RUN: llvm-upgrade %s | llvm-as | llc
; RUN: llvm-as < %s | llc
;; Date: Jul 8, 2003.
;; From: test/Programs/MultiSource/Olden-perimeter
@ -11,26 +11,24 @@
;; for bitwise operations but not booleans! For booleans,
;; the result has to be compared with 0.
%.str_1 = internal constant [30 x sbyte] c"d = %d, ct = %d, d ^ ct = %d\0A\00"
@.str_1 = internal constant [30 x i8] c"d = %d, ct = %d, d ^ ct = %d\0A\00"
declare i32 @printf(i8*, ...)
implementation ; Functions:
declare int %printf(sbyte*, ...)
int %adj(uint %d.1, uint %ct.1) {
define i32 @adj(i32 %d.1, i32 %ct.1) {
entry:
%tmp.19 = seteq uint %ct.1, 2
%tmp.22.not = cast uint %ct.1 to bool
%tmp.221 = xor bool %tmp.22.not, true
%tmp.26 = or bool %tmp.19, %tmp.221
%tmp.27 = cast bool %tmp.26 to int
ret int %tmp.27
%tmp.19 = icmp eq i32 %ct.1, 2 ; <i1> [#uses=1]
%tmp.22.not = trunc i32 %ct.1 to i1 ; <i1> [#uses=1]
%tmp.221 = xor i1 %tmp.22.not, true ; <i1> [#uses=1]
%tmp.26 = or i1 %tmp.19, %tmp.221 ; <i1> [#uses=1]
%tmp.27 = zext i1 %tmp.26 to i32 ; <i32> [#uses=1]
ret i32 %tmp.27
}
int %main() {
define i32 @main() {
entry:
%result = call int %adj(uint 3, uint 2)
%tmp.0 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([30 x sbyte]* %.str_1, long 0, long 0), uint 3, uint 2, int %result)
ret int 0
%result = call i32 @adj( i32 3, i32 2 ) ; <i32> [#uses=1]
%tmp.0 = call i32 (i8*, ...)* @printf( i8* getelementptr ([30 x i8]* @.str_1, i64 0, i64 0), i32 3, i32 2, i32 %result ) ; <i32> [#uses=0]
ret i32 0
}

View File

@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
;; Date: Jul 29, 2003.
;; From: test/Programs/MultiSource/Ptrdist-bc
@ -14,28 +14,27 @@
;; .ascii "\000\001\001\001\001\001\001\001\001\002\003\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\002\004\005\001\001\006\a\001\b\t\n\v\f\r\016\017\020\020\020\020\020\020\020\020\020\020\001\021\022\023\024\001\001\025\025\025\025\025\025\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\026\027\030\031\032\001\033\034\035\036\037 !\"#$%&'()*+,-./$0$1$234\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
;;
@yy_ec = internal constant [6 x i8] c"\06\07\01\08\01\09" ; <[6 x i8]*> [#uses=1]
@.str_3 = internal constant [8 x i8] c"[%d] = \00" ; <[8 x i8]*> [#uses=1]
@.str_4 = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
%yy_ec = internal constant [6 x sbyte] c"\06\07\01\08\01\09"
declare i32 @printf(i8*, ...)
%.str_3 = internal constant [8 x sbyte] c"[%d] = \00"
%.str_4 = internal constant [4 x sbyte] c"%d\0A\00"
implementation
declare int %printf(sbyte*, ...)
int %main() {
define i32 @main() {
entry:
br label %loopentry
loopentry:
%i = phi long [0, %entry], [%inc.i, %loopentry]
%cptr = getelementptr [6 x sbyte]* %yy_ec, long 0, long %i
%c = load sbyte* %cptr
%ignore = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([8 x sbyte]* %.str_3, long 0, long 0), long %i)
%ignore2 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([4 x sbyte]* %.str_4, long 0, long 0), sbyte %c)
%inc.i = add long %i, 1
%done = setle long %inc.i, 5
br bool %done, label %loopentry, label %exit.1
exit.1:
ret int 0
};
br label %loopentry
loopentry: ; preds = %loopentry, %entry
%i = phi i64 [ 0, %entry ], [ %inc.i, %loopentry ] ; <i64> [#uses=3]
%cptr = getelementptr [6 x i8]* @yy_ec, i64 0, i64 %i ; <i8*> [#uses=1]
%c = load i8* %cptr ; <i8> [#uses=1]
%ignore = call i32 (i8*, ...)* @printf( i8* getelementptr ([8 x i8]* @.str_3, i64 0, i64 0), i64 %i ) ; <i32> [#uses=0]
%ignore2 = call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @.str_4, i64 0, i64 0), i8 %c ) ; <i32> [#uses=0]
%inc.i = add i64 %i, 1 ; <i64> [#uses=2]
%done = icmp sle i64 %inc.i, 5 ; <i1> [#uses=1]
br i1 %done, label %loopentry, label %exit.1
exit.1: ; preds = %loopentry
ret i32 0
}

View File

@ -1,13 +1,17 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -enable-correct-eh-support
; RUN: llvm-as < %s | llc -enable-correct-eh-support
int %test() {
unwind
define i32 @test() {
unwind
}
int %main() {
%X = invoke int %test() to label %cont except label %EH
cont:
ret int 1
EH:
ret int 0
define i32 @main() {
%X = invoke i32 @test( )
to label %cont unwind label %EH ; <i32> [#uses=0]
cont: ; preds = %0
ret i32 1
EH: ; preds = %0
ret i32 0
}

View File

@ -1,15 +1,13 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
@global_long_1 = linkonce global i64 7 ; <i64*> [#uses=1]
@global_long_2 = linkonce global i64 49 ; <i64*> [#uses=1]
%global_long_1 = linkonce global long 7
%global_long_2 = linkonce global long 49
implementation ; Functions:
int %main() {
%l1 = load long* %global_long_1
%l2 = load long* %global_long_2
%cond = setle long %l1, %l2
%cast2 = cast bool %cond to int
%RV = sub int 1, %cast2
ret int %RV
define i32 @main() {
%l1 = load i64* @global_long_1 ; <i64> [#uses=1]
%l2 = load i64* @global_long_2 ; <i64> [#uses=1]
%cond = icmp sle i64 %l1, %l2 ; <i1> [#uses=1]
%cast2 = zext i1 %cond to i32 ; <i32> [#uses=1]
%RV = sub i32 1, %cast2 ; <i32> [#uses=1]
ret i32 %RV
}

View File

@ -1,19 +1,20 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
void %intersect_pixel() {
define void @intersect_pixel() {
entry:
%tmp125 = call bool %llvm.isunordered.f64( double 0.000000e+00, double 0.000000e+00 ) ; <bool> [#uses=1]
%tmp126 = or bool %tmp125, false ; <bool> [#uses=1]
%tmp126.not = xor bool %tmp126, true ; <bool> [#uses=1]
%brmerge1 = or bool %tmp126.not, false ; <bool> [#uses=1]
br bool %brmerge1, label %bb154, label %cond_false133
%tmp125 = fcmp uno double 0.000000e+00, 0.000000e+00 ; <i1> [#uses=1]
%tmp126 = or i1 %tmp125, false ; <i1> [#uses=1]
%tmp126.not = xor i1 %tmp126, true ; <i1> [#uses=1]
%brmerge1 = or i1 %tmp126.not, false ; <i1> [#uses=1]
br i1 %brmerge1, label %bb154, label %cond_false133
cond_false133: ; preds = %entry
ret void
cond_false133: ; preds = %entry
ret void
bb154: ; preds = %entry
%tmp164 = seteq uint 0, 0 ; <bool> [#uses=0]
ret void
bb154: ; preds = %entry
%tmp164 = icmp eq i32 0, 0 ; <i1> [#uses=0]
ret void
}
declare bool %llvm.isunordered.f64(double, double)
declare i1 @llvm.isunordered.f64(double, double)

View File

@ -1,21 +1,20 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
%struct.TypHeader = type { uint, %struct.TypHeader**, [3 x sbyte], ubyte }
%.str_67 = external global [4 x sbyte] ; <[4 x sbyte]*> [#uses=1]
%.str_87 = external global [17 x sbyte] ; <[17 x sbyte]*> [#uses=1]
; RUN: llvm-as < %s | llc
%struct.TypHeader = type { i32, %struct.TypHeader**, [3 x i8], i8 }
@.str_67 = external global [4 x i8] ; <[4 x i8]*> [#uses=1]
@.str_87 = external global [17 x i8] ; <[17 x i8]*> [#uses=1]
implementation ; Functions:
void %PrBinop() {
define void @PrBinop() {
entry:
br bool false, label %cond_true, label %else.0
br i1 false, label %cond_true, label %else.0
cond_true: ; preds = %entry
br label %else.0
cond_true: ; preds = %entry
br label %else.0
else.0:
%tmp.167.1 = phi int [ cast ([17 x sbyte]* %.str_87 to int), %entry ], [ 0, %cond_true ]
call void %Pr( sbyte* getelementptr ([4 x sbyte]* %.str_67, int 0, int 0), int 0, int 0 )
ret void
else.0: ; preds = %cond_true, %entry
%tmp.167.1 = phi i32 [ ptrtoint ([17 x i8]* @.str_87 to i32), %entry ], [ 0, %cond_true ] ; <i32> [#uses=0]
call void @Pr( i8* getelementptr ([4 x i8]* @.str_67, i32 0, i32 0), i32 0, i32 0 )
ret void
}
declare void %Pr(sbyte*, int, int)
declare void @Pr(i8*, i32, i32)

View File

@ -1,11 +1,11 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
; Test that llvm.memcpy works with a i64 length operand on all targets.
declare void @llvm.memcpy.i64(i8*, i8*, i64, i32)
declare void %llvm.memcpy.i64(sbyte*, sbyte*, ulong, uint)
void %l12_l94_bc_divide_endif_2E_3_2E_ce() {
define void @l12_l94_bc_divide_endif_2E_3_2E_ce() {
newFuncRoot:
tail call void %llvm.memcpy.i64( sbyte* null, sbyte* null, ulong 0, uint 1 )
unreachable
tail call void @llvm.memcpy.i64( i8* null, i8* null, i64 0, i32 1 )
unreachable
}

View File

@ -1,6 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
void %test() {
%X = alloca {}
ret void
define void @test() {
%X = alloca { } ; <{ }*> [#uses=0]
ret void
}

View File

@ -1,12 +1,16 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
float %t(long %u_arg) {
%u = cast long %u_arg to ulong ; <ulong> [#uses=1]
%tmp5 = add ulong %u, 9007199254740991 ; <ulong> [#uses=1]
%tmp = setgt ulong %tmp5, 18014398509481982 ; <bool> [#uses=1]
br bool %tmp, label %T, label %F
T:
ret float 1.0
F:
call float %t(long 0)
ret float 0.0
; RUN: llvm-as < %s | llc
define float @t(i64 %u_arg) {
%u = bitcast i64 %u_arg to i64 ; <i64> [#uses=1]
%tmp5 = add i64 %u, 9007199254740991 ; <i64> [#uses=1]
%tmp = icmp ugt i64 %tmp5, 18014398509481982 ; <i1> [#uses=1]
br i1 %tmp, label %T, label %F
T: ; preds = %0
ret float 1.000000e+00
F: ; preds = %0
call float @t( i64 0 ) ; <float>:1 [#uses=0]
ret float 0.000000e+00
}

View File

@ -1,23 +1,20 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
@str = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
@str.upgrd.1 = external global [29 x i8] ; <[29 x i8]*> [#uses=0]
@str1 = external global [29 x i8] ; <[29 x i8]*> [#uses=0]
@str2 = external global [29 x i8] ; <[29 x i8]*> [#uses=1]
@str.upgrd.2 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
@str3 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
@str4 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
@str5 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
%str = external global [36 x sbyte] ; <[36 x sbyte]*> [#uses=0]
%str = external global [29 x sbyte] ; <[29 x sbyte]*> [#uses=0]
%str1 = external global [29 x sbyte] ; <[29 x sbyte]*> [#uses=0]
%str2 = external global [29 x sbyte] ; <[29 x sbyte]*> [#uses=1]
%str = external global [2 x sbyte] ; <[2 x sbyte]*> [#uses=0]
%str3 = external global [2 x sbyte] ; <[2 x sbyte]*> [#uses=0]
%str4 = external global [2 x sbyte] ; <[2 x sbyte]*> [#uses=0]
%str5 = external global [2 x sbyte] ; <[2 x sbyte]*> [#uses=0]
implementation ; Functions:
void %printArgsNoRet(int %a1, float %a2, sbyte %a3, double %a4, sbyte* %a5, int %a6, float %a7, sbyte %a8, double %a9, sbyte* %a10, int %a11, float %a12, sbyte %a13, double %a14, sbyte* %a15) {
define void @printArgsNoRet(i32 %a1, float %a2, i8 %a3, double %a4, i8* %a5, i32 %a6, float %a7, i8 %a8, double %a9, i8* %a10, i32 %a11, float %a12, i8 %a13, double %a14, i8* %a15) {
entry:
%tmp17 = cast sbyte %a13 to int ; <int> [#uses=1]
%tmp23 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([29 x sbyte]* %str2, int 0, uint 0), int %a11, double 0.000000e+00, int %tmp17, double %a14, int 0 ) ; <int> [#uses=0]
%tmp17 = sext i8 %a13 to i32 ; <i32> [#uses=1]
%tmp23 = call i32 (i8*, ...)* @printf( i8* getelementptr ([29 x i8]* @str2, i32 0, i64 0), i32 %a11, double 0.000000e+00, i32 %tmp17, double %a14, i32 0 ) ; <i32> [#uses=0]
ret void
}
declare int %printf(sbyte*, ...)
declare i32 @printf(i8*, ...)
declare int %main(int, sbyte**)
declare i32 @main(i32, i8**)

View File

@ -1,7 +1,7 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
long %test(long %A) {
%B = cast long %A to sbyte
%C = cast sbyte %B to long
ret long %C
define i64 @test(i64 %A) {
%B = trunc i64 %A to i8 ; <i8> [#uses=1]
%C = sext i8 %B to i64 ; <i64> [#uses=1]
ret i64 %C
}

View File

@ -1,33 +1,31 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
; ModuleID = '2006-01-12-BadSetCCFold.ll'
%struct.node_t = type { double*, %struct.node_t*, %struct.node_t**, double**, double*, i32, i32 }
%struct.node_t = type { double*, %struct.node_t*, %struct.node_t**, double**, double*, int, int }
implementation ; Functions:
void %main() {
define void @main() {
entry:
br bool false, label %then.2.i, label %endif.2.i
br i1 false, label %then.2.i, label %endif.2.i
then.2.i: ; preds = %entry
br label %dealwithargs.exit
endif.2.i: ; preds = %entry
br bool false, label %then.3.i, label %dealwithargs.exit
br i1 false, label %then.3.i, label %dealwithargs.exit
then.3.i: ; preds = %endif.2.i
br label %dealwithargs.exit
dealwithargs.exit: ; preds = %then.3.i, %endif.2.i, %then.2.i
%n_nodes.4 = phi int [ 64, %then.3.i ], [ 64, %then.2.i ], [ 64, %endif.2.i ] ; <int> [#uses=1]
%tmp.14.i1134.i.i = setgt int %n_nodes.4, 1 ; <bool> [#uses=2]
br bool %tmp.14.i1134.i.i, label %no_exit.i12.i.i, label %fill_table.exit22.i.i
%n_nodes.4 = phi i32 [ 64, %then.3.i ], [ 64, %then.2.i ], [ 64, %endif.2.i ] ; <i32> [#uses=1]
%tmp.14.i1134.i.i = icmp sgt i32 %n_nodes.4, 1 ; <i1> [#uses=2]
br i1 %tmp.14.i1134.i.i, label %no_exit.i12.i.i, label %fill_table.exit22.i.i
no_exit.i12.i.i: ; preds = %no_exit.i12.i.i, %dealwithargs.exit
br bool false, label %fill_table.exit22.i.i, label %no_exit.i12.i.i
br i1 false, label %fill_table.exit22.i.i, label %no_exit.i12.i.i
fill_table.exit22.i.i: ; preds = %no_exit.i12.i.i, %dealwithargs.exit
%cur_node.0.i8.1.i.i = phi %struct.node_t* [ undef, %dealwithargs.exit ], [ null, %no_exit.i12.i.i ] ; <%struct.node_t*> [#uses=0]
br bool %tmp.14.i1134.i.i, label %no_exit.i.preheader.i.i, label %make_tables.exit.i
br i1 %tmp.14.i1134.i.i, label %no_exit.i.preheader.i.i, label %make_tables.exit.i
no_exit.i.preheader.i.i: ; preds = %fill_table.exit22.i.i
ret void

View File

@ -1,16 +1,15 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
; This crashed the PPC backend.
void %test() {
%tmp125 = call bool %llvm.isunordered.f64( double 0.000000e+00, double 0.000000e+00 ) ; <bool> [#uses=1]
br bool %tmp125, label %bb154, label %cond_false133
define void @test() {
%tmp125 = fcmp uno double 0.000000e+00, 0.000000e+00 ; <i1> [#uses=1]
br i1 %tmp125, label %bb154, label %cond_false133
cond_false133: ; preds = %entry
ret void
cond_false133: ; preds = %0
ret void
bb154: ; preds = %entry
%tmp164 = seteq uint 0, 0 ; <bool> [#uses=0]
ret void
bb154: ; preds = %0
%tmp164 = icmp eq i32 0, 0 ; <i1> [#uses=0]
ret void
}
declare bool %llvm.isunordered.f64(double, double)

View File

@ -1,54 +1,54 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
%G = external global int
; RUN: llvm-as < %s | llc
@G = external global i32 ; <i32*> [#uses=1]
void %encode_one_frame(long %tmp.2i) {
define void @encode_one_frame(i64 %tmp.2i) {
entry:
%tmp.9 = seteq int 0, 0 ; <bool> [#uses=1]
br bool %tmp.9, label %endif.0, label %shortcirc_next.0
%tmp.9 = icmp eq i32 0, 0 ; <i1> [#uses=1]
br i1 %tmp.9, label %endif.0, label %shortcirc_next.0
then.5.i: ; preds = %shortcirc_next.i
%tmp.114.i = div long %tmp.2i, 3 ; <long> [#uses=1]
%tmp.111.i = call long %lseek( int 0, long %tmp.114.i, int 1 ) ; <long> [#uses=0]
%tmp.114.i = sdiv i64 %tmp.2i, 3 ; <i64> [#uses=1]
%tmp.111.i = call i64 @lseek( i32 0, i64 %tmp.114.i, i32 1 ) ; <i64> [#uses=0]
ret void
shortcirc_next.0: ; preds = %entry
ret void
endif.0: ; preds = %entry
%tmp.324.i = seteq int 0, 0 ; <bool> [#uses=2]
%tmp.362.i = setlt int 0, 0 ; <bool> [#uses=1]
br bool %tmp.324.i, label %else.4.i, label %then.11.i37
%tmp.324.i = icmp eq i32 0, 0 ; <i1> [#uses=2]
%tmp.362.i = icmp slt i32 0, 0 ; <i1> [#uses=1]
br i1 %tmp.324.i, label %else.4.i, label %then.11.i37
then.11.i37: ; preds = %endif.0
ret void
else.4.i: ; preds = %endif.0
br bool %tmp.362.i, label %else.5.i, label %then.12.i
br i1 %tmp.362.i, label %else.5.i, label %then.12.i
then.12.i: ; preds = %else.4.i
ret void
else.5.i: ; preds = %else.4.i
br bool %tmp.324.i, label %then.0.i40, label %then.17.i
br i1 %tmp.324.i, label %then.0.i40, label %then.17.i
then.17.i: ; preds = %else.5.i
ret void
then.0.i40: ; preds = %else.5.i
%tmp.8.i42 = seteq int 0, 0 ; <bool> [#uses=1]
br bool %tmp.8.i42, label %else.1.i56, label %then.1.i52
%tmp.8.i42 = icmp eq i32 0, 0 ; <i1> [#uses=1]
br i1 %tmp.8.i42, label %else.1.i56, label %then.1.i52
then.1.i52: ; preds = %then.0.i40
ret void
else.1.i56: ; preds = %then.0.i40
%tmp.28.i = load int* %G
%tmp.29.i = seteq int %tmp.28.i, 1 ; <bool> [#uses=1]
br bool %tmp.29.i, label %shortcirc_next.i, label %shortcirc_done.i
%tmp.28.i = load i32* @G ; <i32> [#uses=1]
%tmp.29.i = icmp eq i32 %tmp.28.i, 1 ; <i1> [#uses=1]
br i1 %tmp.29.i, label %shortcirc_next.i, label %shortcirc_done.i
shortcirc_next.i: ; preds = %else.1.i56
%tmp.34.i = seteq int 0, 3 ; <bool> [#uses=1]
br bool %tmp.34.i, label %then.5.i, label %endif.5.i
%tmp.34.i = icmp eq i32 0, 3 ; <i1> [#uses=1]
br i1 %tmp.34.i, label %then.5.i, label %endif.5.i
shortcirc_done.i: ; preds = %else.1.i56
ret void
@ -57,4 +57,4 @@ endif.5.i: ; preds = %shortcirc_next.i
ret void
}
declare long %lseek(int, long, int)
declare i64 @lseek(i32, i64, i32)

View File

@ -1,98 +1,95 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; Infinite loop in the dag combiner, reduced from 176.gcc.
%struct._obstack_chunk = type { sbyte*, %struct._obstack_chunk*, [4 x sbyte] }
%struct.anon = type { int }
; RUN: llvm-as < %s | llc
; Infinite loop in the dag combiner, reduced from 176.gcc.
%struct._obstack_chunk = type { i8*, %struct._obstack_chunk*, [4 x i8] }
%struct.anon = type { i32 }
%struct.lang_decl = type opaque
%struct.lang_type = type { int, [1 x %struct.tree_node*] }
%struct.obstack = type { int, %struct._obstack_chunk*, sbyte*, sbyte*, sbyte*, int, int, %struct._obstack_chunk* (...)*, void (...)*, sbyte*, ubyte }
%struct.rtx_def = type { ushort, ubyte, ubyte, [1 x %struct.anon] }
%struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, ubyte, ubyte, ubyte, ubyte }
%struct.tree_decl = type { [12 x sbyte], sbyte*, int, %struct.tree_node*, uint, ubyte, ubyte, ubyte, ubyte, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.anon, { %struct.rtx_def* }, %struct.tree_node*, %struct.lang_decl* }
%struct.tree_list = type { [12 x sbyte], %struct.tree_node*, %struct.tree_node* }
%struct.lang_type = type { i32, [1 x %struct.tree_node*] }
%struct.obstack = type { i32, %struct._obstack_chunk*, i8*, i8*, i8*, i32, i32, %struct._obstack_chunk* (...)*, void (...)*, i8*, i8 }
%struct.rtx_def = type { i16, i8, i8, [1 x %struct.anon] }
%struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, i8, i8, i8, i8 }
%struct.tree_decl = type { [12 x i8], i8*, i32, %struct.tree_node*, i32, i8, i8, i8, i8, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.anon, { %struct.rtx_def* }, %struct.tree_node*, %struct.lang_decl* }
%struct.tree_list = type { [12 x i8], %struct.tree_node*, %struct.tree_node* }
%struct.tree_node = type { %struct.tree_decl }
%struct.tree_type = type { [12 x sbyte], %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, uint, ubyte, ubyte, ubyte, ubyte, uint, %struct.tree_node*, %struct.tree_node*, %struct.anon, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.obstack*, %struct.lang_type* }
%void_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
%char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
%short_integer_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
%short_unsigned_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
%float_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
%signed_char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
%unsigned_char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
%struct.tree_type = type { [12 x i8], %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i32, i8, i8, i8, i8, i32, %struct.tree_node*, %struct.tree_node*, %struct.anon, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.obstack*, %struct.lang_type* }
@void_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
@char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
@short_integer_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
@short_unsigned_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
@float_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
@signed_char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
@unsigned_char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
implementation ; Functions:
fastcc int %self_promoting_args_p(%struct.tree_node* %parms) {
define fastcc i32 @self_promoting_args_p(%struct.tree_node* %parms) {
entry:
%tmp915 = seteq %struct.tree_node* %parms, null ; <bool> [#uses=1]
br bool %tmp915, label %return, label %cond_true92.preheader
%tmp915 = icmp eq %struct.tree_node* %parms, null ; <i1> [#uses=1]
br i1 %tmp915, label %return, label %cond_true92.preheader
cond_true: ; preds = %cond_true92
%tmp9.not = setne %struct.tree_node* %tmp2, %tmp7 ; <bool> [#uses=1]
%tmp14 = seteq %struct.tree_node* %tmp2, null ; <bool> [#uses=1]
%bothcond = or bool %tmp9.not, %tmp14 ; <bool> [#uses=1]
br bool %bothcond, label %return, label %cond_next18
%tmp9.not = icmp ne %struct.tree_node* %tmp2, %tmp7 ; <i1> [#uses=1]
%tmp14 = icmp eq %struct.tree_node* %tmp2, null ; <i1> [#uses=1]
%bothcond = or i1 %tmp9.not, %tmp14 ; <i1> [#uses=1]
br i1 %bothcond, label %return, label %cond_next18
cond_next12: ; preds = %cond_true92
%tmp14.old = seteq %struct.tree_node* %tmp2, null ; <bool> [#uses=1]
br bool %tmp14.old, label %return, label %cond_next18
%tmp14.old = icmp eq %struct.tree_node* %tmp2, null ; <i1> [#uses=1]
br i1 %tmp14.old, label %return, label %cond_next18
cond_next18: ; preds = %cond_next12, %cond_true
%tmp20 = cast %struct.tree_node* %tmp2 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1]
%tmp21 = getelementptr %struct.tree_type* %tmp20, int 0, uint 17 ; <%struct.tree_node**> [#uses=1]
%tmp20 = bitcast %struct.tree_node* %tmp2 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1]
%tmp21 = getelementptr %struct.tree_type* %tmp20, i32 0, i32 17 ; <%struct.tree_node**> [#uses=1]
%tmp22 = load %struct.tree_node** %tmp21 ; <%struct.tree_node*> [#uses=6]
%tmp24 = seteq %struct.tree_node* %tmp22, %tmp23 ; <bool> [#uses=1]
br bool %tmp24, label %return, label %cond_next28
%tmp24 = icmp eq %struct.tree_node* %tmp22, %tmp23 ; <i1> [#uses=1]
br i1 %tmp24, label %return, label %cond_next28
cond_next28: ; preds = %cond_next18
%tmp30 = cast %struct.tree_node* %tmp2 to %struct.tree_common* ; <%struct.tree_common*> [#uses=1]
%tmp = getelementptr %struct.tree_common* %tmp30, int 0, uint 2 ; <ubyte*> [#uses=1]
%tmp = cast ubyte* %tmp to uint* ; <uint*> [#uses=1]
%tmp = load uint* %tmp ; <uint> [#uses=1]
%tmp32 = cast uint %tmp to ubyte ; <ubyte> [#uses=1]
%tmp33 = seteq ubyte %tmp32, 7 ; <bool> [#uses=1]
br bool %tmp33, label %cond_true34, label %cond_next84
%tmp30 = bitcast %struct.tree_node* %tmp2 to %struct.tree_common* ; <%struct.tree_common*> [#uses=1]
%tmp = getelementptr %struct.tree_common* %tmp30, i32 0, i32 2 ; <i8*> [#uses=1]
%tmp.upgrd.1 = bitcast i8* %tmp to i32* ; <i32*> [#uses=1]
%tmp.upgrd.2 = load i32* %tmp.upgrd.1 ; <i32> [#uses=1]
%tmp32 = trunc i32 %tmp.upgrd.2 to i8 ; <i8> [#uses=1]
%tmp33 = icmp eq i8 %tmp32, 7 ; <i1> [#uses=1]
br i1 %tmp33, label %cond_true34, label %cond_next84
cond_true34: ; preds = %cond_next28
%tmp40 = seteq %struct.tree_node* %tmp22, %tmp39 ; <bool> [#uses=1]
%tmp49 = seteq %struct.tree_node* %tmp22, %tmp48 ; <bool> [#uses=1]
%bothcond6 = or bool %tmp40, %tmp49 ; <bool> [#uses=1]
%tmp58 = seteq %struct.tree_node* %tmp22, %tmp57 ; <bool> [#uses=1]
%bothcond7 = or bool %bothcond6, %tmp58 ; <bool> [#uses=1]
%tmp67 = seteq %struct.tree_node* %tmp22, %tmp66 ; <bool> [#uses=1]
%bothcond8 = or bool %bothcond7, %tmp67 ; <bool> [#uses=1]
%tmp76 = seteq %struct.tree_node* %tmp22, %tmp75 ; <bool> [#uses=1]
%bothcond9 = or bool %bothcond8, %tmp76 ; <bool> [#uses=2]
%brmerge = or bool %bothcond9, %tmp ; <bool> [#uses=1]
%bothcond9 = cast bool %bothcond9 to int ; <int> [#uses=1]
%.mux = xor int %bothcond9, 1 ; <int> [#uses=1]
br bool %brmerge, label %return, label %cond_true92
%tmp40 = icmp eq %struct.tree_node* %tmp22, %tmp39 ; <i1> [#uses=1]
%tmp49 = icmp eq %struct.tree_node* %tmp22, %tmp48 ; <i1> [#uses=1]
%bothcond6 = or i1 %tmp40, %tmp49 ; <i1> [#uses=1]
%tmp58 = icmp eq %struct.tree_node* %tmp22, %tmp57 ; <i1> [#uses=1]
%bothcond7 = or i1 %bothcond6, %tmp58 ; <i1> [#uses=1]
%tmp67 = icmp eq %struct.tree_node* %tmp22, %tmp66 ; <i1> [#uses=1]
%bothcond8 = or i1 %bothcond7, %tmp67 ; <i1> [#uses=1]
%tmp76 = icmp eq %struct.tree_node* %tmp22, %tmp75 ; <i1> [#uses=1]
%bothcond9 = or i1 %bothcond8, %tmp76 ; <i1> [#uses=2]
%brmerge = or i1 %bothcond9, %tmp.upgrd.6 ; <i1> [#uses=1]
%bothcond9.upgrd.3 = zext i1 %bothcond9 to i32 ; <i32> [#uses=1]
%.mux = xor i32 %bothcond9.upgrd.3, 1 ; <i32> [#uses=1]
br i1 %brmerge, label %return, label %cond_true92
cond_next84: ; preds = %cond_next28
br bool %tmp, label %return, label %cond_true92
br i1 %tmp.upgrd.6, label %return, label %cond_true92
cond_true92.preheader: ; preds = %entry
%tmp7 = load %struct.tree_node** %void_type_node ; <%struct.tree_node*> [#uses=1]
%tmp23 = load %struct.tree_node** %float_type_node ; <%struct.tree_node*> [#uses=1]
%tmp39 = load %struct.tree_node** %char_type_node ; <%struct.tree_node*> [#uses=1]
%tmp48 = load %struct.tree_node** %signed_char_type_node ; <%struct.tree_node*> [#uses=1]
%tmp57 = load %struct.tree_node** %unsigned_char_type_node ; <%struct.tree_node*> [#uses=1]
%tmp66 = load %struct.tree_node** %short_integer_type_node ; <%struct.tree_node*> [#uses=1]
%tmp75 = load %struct.tree_node** %short_unsigned_type_node ; <%struct.tree_node*> [#uses=1]
%tmp7 = load %struct.tree_node** @void_type_node ; <%struct.tree_node*> [#uses=1]
%tmp23 = load %struct.tree_node** @float_type_node ; <%struct.tree_node*> [#uses=1]
%tmp39 = load %struct.tree_node** @char_type_node ; <%struct.tree_node*> [#uses=1]
%tmp48 = load %struct.tree_node** @signed_char_type_node ; <%struct.tree_node*> [#uses=1]
%tmp57 = load %struct.tree_node** @unsigned_char_type_node ; <%struct.tree_node*> [#uses=1]
%tmp66 = load %struct.tree_node** @short_integer_type_node ; <%struct.tree_node*> [#uses=1]
%tmp75 = load %struct.tree_node** @short_unsigned_type_node ; <%struct.tree_node*> [#uses=1]
br label %cond_true92
cond_true92: ; preds = %cond_true92.preheader, %cond_next84, %cond_true34
%t.0.0 = phi %struct.tree_node* [ %parms, %cond_true92.preheader ], [ %tmp6, %cond_true34 ], [ %tmp6, %cond_next84 ] ; <%struct.tree_node*> [#uses=2]
%tmp = cast %struct.tree_node* %t.0.0 to %struct.tree_list* ; <%struct.tree_list*> [#uses=1]
%tmp = getelementptr %struct.tree_list* %tmp, int 0, uint 2 ; <%struct.tree_node**> [#uses=1]
%tmp2 = load %struct.tree_node** %tmp ; <%struct.tree_node*> [#uses=5]
%tmp4 = cast %struct.tree_node* %t.0.0 to %struct.tree_common* ; <%struct.tree_common*> [#uses=1]
%tmp5 = getelementptr %struct.tree_common* %tmp4, int 0, uint 0 ; <%struct.tree_node**> [#uses=1]
%tmp.upgrd.4 = bitcast %struct.tree_node* %t.0.0 to %struct.tree_list* ; <%struct.tree_list*> [#uses=1]
%tmp.upgrd.5 = getelementptr %struct.tree_list* %tmp.upgrd.4, i32 0, i32 2 ; <%struct.tree_node**> [#uses=1]
%tmp2 = load %struct.tree_node** %tmp.upgrd.5 ; <%struct.tree_node*> [#uses=5]
%tmp4 = bitcast %struct.tree_node* %t.0.0 to %struct.tree_common* ; <%struct.tree_common*> [#uses=1]
%tmp5 = getelementptr %struct.tree_common* %tmp4, i32 0, i32 0 ; <%struct.tree_node**> [#uses=1]
%tmp6 = load %struct.tree_node** %tmp5 ; <%struct.tree_node*> [#uses=3]
%tmp = seteq %struct.tree_node* %tmp6, null ; <bool> [#uses=3]
br bool %tmp, label %cond_true, label %cond_next12
%tmp.upgrd.6 = icmp eq %struct.tree_node* %tmp6, null ; <i1> [#uses=3]
br i1 %tmp.upgrd.6, label %cond_true, label %cond_next12
return: ; preds = %cond_next84, %cond_true34, %cond_next18, %cond_next12, %cond_true, %entry
%retval.0 = phi int [ 1, %entry ], [ 1, %cond_next84 ], [ %.mux, %cond_true34 ], [ 0, %cond_next18 ], [ 0, %cond_next12 ], [ 0, %cond_true ] ; <int> [#uses=1]
ret int %retval.0
%retval.0 = phi i32 [ 1, %entry ], [ 1, %cond_next84 ], [ %.mux, %cond_true34 ], [ 0, %cond_next18 ], [ 0, %cond_next12 ], [ 0, %cond_true ] ; <i32> [#uses=1]
ret i32 %retval.0
}

View File

@ -1,10 +1,9 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
implementation ; Functions:
declare void @llvm.dbg.declare({ }*, { }*)
declare void %llvm.dbg.declare({ }*, { }*)
void %foo() {
call void %llvm.dbg.declare( { }* null, { }* null )
ret void
define void @foo() {
call void @llvm.dbg.declare( { }* null, { }* null )
ret void
}

View File

@ -1,11 +1,11 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah
; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah
; The vload was getting memoized to the previous scalar load!
void %VertexProgram2() {
define void @VertexProgram2() {
%xFloat0.688 = load float* null ; <float> [#uses=0]
%loadVector37.712 = load <4 x float>* null ; <<4 x float>> [#uses=1]
%inFloat3.713 = insertelement <4 x float> %loadVector37.712, float 0.000000e+00, uint 3 ; <<4 x float>> [#uses=1]
%inFloat3.713 = insertelement <4 x float> %loadVector37.712, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
store <4 x float> %inFloat3.713, <4 x float>* null
unreachable
}

View File

@ -1,36 +1,33 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
; PR748
@G = external global i16 ; <i16*> [#uses=1]
%G = external global ushort ; <ushort*> [#uses=1]
implementation ; Functions:
void %OmNewObjHdr() {
define void @OmNewObjHdr() {
entry:
br bool false, label %endif.4, label %then.0
br i1 false, label %endif.4, label %then.0
then.0: ; preds = %entry
ret void
endif.4: ; preds = %entry
br bool false, label %else.3, label %shortcirc_next.3
br i1 false, label %else.3, label %shortcirc_next.3
shortcirc_next.3: ; preds = %endif.4
ret void
else.3: ; preds = %endif.4
switch int 0, label %endif.10 [
int 5001, label %then.10
int -5008, label %then.10
switch i32 0, label %endif.10 [
i32 5001, label %then.10
i32 -5008, label %then.10
]
then.10: ; preds = %else.3, %else.3
%tmp.112 = load ushort* null ; <ushort> [#uses=2]
%tmp.113 = load ushort* %G ; <ushort> [#uses=2]
%tmp.114 = setgt ushort %tmp.112, %tmp.113 ; <bool> [#uses=1]
%tmp.120 = setlt ushort %tmp.112, %tmp.113 ; <bool> [#uses=1]
%bothcond = and bool %tmp.114, %tmp.120 ; <bool> [#uses=1]
br bool %bothcond, label %else.4, label %then.11
%tmp.112 = load i16* null ; <i16> [#uses=2]
%tmp.113 = load i16* @G ; <i16> [#uses=2]
%tmp.114 = icmp ugt i16 %tmp.112, %tmp.113 ; <i1> [#uses=1]
%tmp.120 = icmp ult i16 %tmp.112, %tmp.113 ; <i1> [#uses=1]
%bothcond = and i1 %tmp.114, %tmp.120 ; <i1> [#uses=1]
br i1 %bothcond, label %else.4, label %then.11
then.11: ; preds = %then.10
ret void

View File

@ -1,10 +1,9 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
int %test(int %tmp93) {
%tmp98 = shl int %tmp93, ubyte 31 ; <int> [#uses=1]
%tmp99 = shr int %tmp98, ubyte 31 ; <int> [#uses=1]
%tmp99 = cast int %tmp99 to sbyte ; <sbyte> [#uses=1]
%tmp99100 = cast sbyte %tmp99 to int ; <int> [#uses=1]
ret int %tmp99100
define i32 @test(i32 %tmp93) {
%tmp98 = shl i32 %tmp93, 31 ; <i32> [#uses=1]
%tmp99 = ashr i32 %tmp98, 31 ; <i32> [#uses=1]
%tmp99.upgrd.1 = trunc i32 %tmp99 to i8 ; <i8> [#uses=1]
%tmp99100 = sext i8 %tmp99.upgrd.1 to i32 ; <i32> [#uses=1]
ret i32 %tmp99100
}

View File

@ -1,33 +1,29 @@
; RUN: llvm-upgrade < %s | llvm-as | llc
; RUN: llvm-as < %s | llc
%struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
%struct.SYMBOL_TABLE_ENTRY = type { [9 x i8], [9 x i8], i32, i32, i32, %struct.SYMBOL_TABLE_ENTRY* }
%struct.__sFILEX = type opaque
%struct.__sbuf = type { i8*, i32 }
@str14 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
%struct.FILE = type { ubyte*, int, int, short, short, %struct.__sbuf, int, sbyte*, int (sbyte*)*, int (sbyte*, sbyte*, int)*, long (sbyte*, long, int)*, int (sbyte*, sbyte*, int)*, %struct.__sbuf, %struct.__sFILEX*, int, [3 x ubyte], [1 x ubyte], %struct.__sbuf, int, long }
%struct.SYMBOL_TABLE_ENTRY = type { [9 x sbyte], [9 x sbyte], int, int, uint, %struct.SYMBOL_TABLE_ENTRY* }
%struct.__sFILEX = type opaque
%struct.__sbuf = type { ubyte*, int }
%str14 = external global [6 x sbyte] ; <[6 x sbyte]*> [#uses=0]
declare void @fprintf(i32, ...)
implementation ; Functions:
declare void %fprintf(int, ...)
void %OUTPUT_TABLE(%struct.SYMBOL_TABLE_ENTRY* %SYM_TAB) {
define void @OUTPUT_TABLE(%struct.SYMBOL_TABLE_ENTRY* %SYM_TAB) {
entry:
%tmp11 = getelementptr %struct.SYMBOL_TABLE_ENTRY* %SYM_TAB, int 0, uint 1, int 0 ; <sbyte*> [#uses=2]
%tmp.i = cast sbyte* %tmp11 to ubyte* ; <ubyte*> [#uses=1]
br label %bb.i
%tmp11 = getelementptr %struct.SYMBOL_TABLE_ENTRY* %SYM_TAB, i32 0, i32 1, i32 0 ; <i8*> [#uses=2]
%tmp.i = bitcast i8* %tmp11 to i8* ; <i8*> [#uses=1]
br label %bb.i
bb.i: ; preds = %cond_next.i, %entry
%s1.0.i = phi ubyte* [ %tmp.i, %entry ], [ null, %cond_next.i ] ; <ubyte*> [#uses=0]
br bool false, label %cond_true.i31, label %cond_next.i
bb.i: ; preds = %cond_next.i, %entry
%s1.0.i = phi i8* [ %tmp.i, %entry ], [ null, %cond_next.i ] ; <i8*> [#uses=0]
br i1 false, label %cond_true.i31, label %cond_next.i
cond_true.i31: ; preds = %bb.i
call void (int, ...)* %fprintf( int 0, sbyte* %tmp11, sbyte* null )
ret void
cond_true.i31: ; preds = %bb.i
call void (i32, ...)* @fprintf( i32 0, i8* %tmp11, i8* null )
ret void
cond_next.i: ; preds = %bb.i
br bool false, label %bb.i, label %bb19.i
cond_next.i: ; preds = %bb.i
br i1 false, label %bb.i, label %bb19.i
bb19.i: ; preds = %cond_next.i
ret void
bb19.i: ; preds = %cond_next.i
ret void
}

Some files were not shown because too many files have changed in this diff Show More