diff options
author | Tanya Lattner <tonic@nondot.org> | 2008-03-01 09:15:35 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2008-03-01 09:15:35 +0000 |
commit | 4c4d0b8429d3ec0b9348fbd308e2551fc0f8bda8 (patch) | |
tree | c1b0621415acc20f94152c51174d53fae3dbc8cc /test/Transforms/GlobalOpt | |
parent | 3272c7f6996b0af462e9663b81bd8ff2afa68634 (diff) | |
download | external_llvm-4c4d0b8429d3ec0b9348fbd308e2551fc0f8bda8.zip external_llvm-4c4d0b8429d3ec0b9348fbd308e2551fc0f8bda8.tar.gz external_llvm-4c4d0b8429d3ec0b9348fbd308e2551fc0f8bda8.tar.bz2 |
Remove llvm-upgrade and update test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47793 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GlobalOpt')
23 files changed, 382 insertions, 391 deletions
diff --git a/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.llx b/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.llx index 8150c52..5f784e0 100644 --- a/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.llx +++ b/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.llx @@ -1,17 +1,17 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt +; RUN: llvm-as < %s | opt -globalopt -%V = global float 12.0 -%G = internal global int* null +@V = global float 1.200000e+01 ; <float*> [#uses=1] +@G = internal global i32* null ; <i32**> [#uses=2] -int %user() { - %P = load int** %G - %Q = load int* %P - ret int %Q +define i32 @user() { + %P = load i32** @G ; <i32*> [#uses=1] + %Q = load i32* %P ; <i32> [#uses=1] + ret i32 %Q } -void %setter() { - %Vi = cast float* %V to int* - store int* %Vi, int** %G - ret void +define void @setter() { + %Vi = bitcast float* @V to i32* ; <i32*> [#uses=1] + store i32* %Vi, i32** @G + ret void } diff --git a/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll b/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll index 19458c7..80f8243 100644 --- a/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll +++ b/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll @@ -1,9 +1,10 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt -disable-output +; RUN: llvm-as < %s | opt -globalopt -disable-output ; PR579 -%g_40507551 = internal global short 31038 ; <short*> [#uses=1] +@g_40507551 = internal global i16 31038 ; <i16*> [#uses=1] -void %main() { - %tmp.4.i.1 = load ubyte* getelementptr (ubyte* cast (short* %g_40507551 to ubyte*), int 1) - ret void +define void @main() { + %tmp.4.i.1 = load i8* getelementptr (i8* bitcast (i16* @g_40507551 to i8*), i32 1) ; <i8> [#uses=0] + ret void } + diff --git a/test/Transforms/GlobalOpt/2005-09-27-Crash.ll b/test/Transforms/GlobalOpt/2005-09-27-Crash.ll index 9486877..5eac431 100644 --- a/test/Transforms/GlobalOpt/2005-09-27-Crash.ll +++ b/test/Transforms/GlobalOpt/2005-09-27-Crash.ll @@ -1,28 +1,27 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt -disable-output - %RPyString = type { int, %arraytype.Char } - %arraytype.Char = type { int, [0 x sbyte] } - %arraytype.Signed = type { int, [0 x int] } - %functiontype.1 = type %RPyString* (int) - %structtype.test = type { int, %arraytype.Signed } -%structinstance.test = internal global { int, { int, [2 x int] } } { int 41, { int, [2 x int] } { int 2, [2 x int] [ int 100, int 101 ] } } ; <{ int, { int, [2 x int] } }*> [#uses=1] +; RUN: llvm-as < %s | opt -globalopt -disable-output + %RPyString = type { i32, %arraytype.Char } + %arraytype.Char = type { i32, [0 x i8] } + %arraytype.Signed = type { i32, [0 x i32] } + %functiontype.1 = type %RPyString* (i32) + %structtype.test = type { i32, %arraytype.Signed } +@structinstance.test = internal global { i32, { i32, [2 x i32] } } { i32 41, { i32, [2 x i32] } { i32 2, [2 x i32] [ i32 100, i32 101 ] } } ; <{ i32, { i32, [2 x i32] } }*> [#uses=1] -implementation ; Functions: - -fastcc void %pypy_array_constant() { +define fastcc void @pypy_array_constant() { block0: - %tmp.9 = getelementptr %structtype.test* cast ({ int, { int, [2 x int] } }* %structinstance.test to %structtype.test*), int 0, uint 0 ; <int*> [#uses=0] - ret void + %tmp.9 = getelementptr %structtype.test* bitcast ({ i32, { i32, [2 x i32] } }* @structinstance.test to %structtype.test*), i32 0, i32 0 ; <i32*> [#uses=0] + ret void } -fastcc void %new.varsizestruct.rpy_string() { - unreachable +define fastcc void @new.varsizestruct.rpy_string() { + unreachable } -void %__entrypoint__pypy_array_constant() { - call fastcc void %pypy_array_constant( ) - ret void +define void @__entrypoint__pypy_array_constant() { + call fastcc void @pypy_array_constant( ) + ret void } -void %__entrypoint__raised_LLVMException() { - ret void +define void @__entrypoint__raised_LLVMException() { + ret void } + diff --git a/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll b/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll index 61df345..5559ef1 100644 --- a/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll +++ b/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll @@ -1,138 +1,135 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt -disable-output +; RUN: llvm-as < %s | opt -globalopt -disable-output ; PR820 -target endian = little -target pointersize = 32 +target datalayout = "e-p:32:32" target triple = "i686-pc-linux-gnu" - %struct..0FileDescriptor = type { int } - "struct.FlagDescription<int32>" = type { ubyte*, int*, bool, bool, int, ubyte* } - "struct.FlagRegisterer<bool>" = type { ubyte } + %struct..0FileDescriptor = type { i32 } + %"struct.FlagDescription<int32>" = type { i8*, i32*, i1, i1, i32, i8* } + %"struct.FlagRegisterer<bool>" = type { i8 } %struct.MutexLock = type { %struct..0FileDescriptor* } - "struct.std::DisabledRangeMap" = type { "struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >" } - "struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >" = type { "struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >::_Rb_tree_impl<StringCmp,false>" } - "struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >::_Rb_tree_impl<StringCmp,false>" = type { "struct.FlagRegisterer<bool>", "struct.std::_Rb_tree_node_base", uint } - "struct.std::_Rb_tree_const_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >" = type { "struct.std::_Rb_tree_node_base"* } - "struct.std::_Rb_tree_node_base" = type { uint, "struct.std::_Rb_tree_node_base"*, "struct.std::_Rb_tree_node_base"*, "struct.std::_Rb_tree_node_base"* } - "struct.std::_Vector_base<int,std::allocator<int> >" = type { "struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl" } - "struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl" = type { int*, int*, int* } - "struct.std::vector<int,std::allocator<int> >" = type { "struct.std::_Vector_base<int,std::allocator<int> >" } -%registry_lock = external global %struct..0FileDescriptor ; <%struct..0FileDescriptor*> [#uses=0] -%_ZN61FLAG__foo_int32_44FLAGS_E = external global "struct.FlagRegisterer<bool>" ; <"struct.FlagRegisterer<bool>"*> [#uses=0] -%llvm.global_ctors = appending global [20 x { int, void ()* }] [ { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN62FLAG__foo_string_10FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN60FLAG__foo_bool_19FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZNK5Bzh4Enum13is_contiguousEv }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN61FLAG__foo_int32_21FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN7ScannerC2Ev }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__Z11StripStringPSsPKcc }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZNK9__gnu_cxx4hashI11StringPieceEclERKS1_ }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN8Hasher325ResetEj }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__Z25ACLRv }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN61FLAG__foo_int64_25FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN61FLAG__foo_int32_7FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN62FLAG__foo_string_18FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN61FLAG__foo_int32_25FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I_eventbuf }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN61FLAG__foo_int32_26FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN62FLAG__foo_string_16FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN17InitializerC2EPKcS1_PFvvE }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__checker_bcad_variable } ] ; <[20 x { int, void ()* }]*> [#uses=0] + %"struct.std::DisabledRangeMap" = type { %"struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >" } + %"struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >" = type { %"struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >::_Rb_tree_impl<StringCmp,false>" } + %"struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >::_Rb_tree_impl<StringCmp,false>" = type { %"struct.FlagRegisterer<bool>", %"struct.std::_Rb_tree_node_base", i32 } + %"struct.std::_Rb_tree_const_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >" = type { %"struct.std::_Rb_tree_node_base"* } + %"struct.std::_Rb_tree_node_base" = type { i32, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"* } + %"struct.std::_Vector_base<int,std::allocator<int> >" = type { %"struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl" } + %"struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl" = type { i32*, i32*, i32* } + %"struct.std::vector<int,std::allocator<int> >" = type { %"struct.std::_Vector_base<int,std::allocator<int> >" } +@registry_lock = external global %struct..0FileDescriptor ; <%struct..0FileDescriptor*> [#uses=0] +@_ZN61FLAG__foo_int32_44FLAGS_E = external global %"struct.FlagRegisterer<bool>" ; <%"struct.FlagRegisterer<bool>"*> [#uses=0] +@llvm.global_ctors = appending global [20 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_10FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN60FLAG__foo_bool_19FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZNK5Bzh4Enum13is_contiguousEv }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_21FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN7ScannerC2Ev }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__Z11StripStringPSsPKcc }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZNK9__gnu_cxx4hashI11StringPieceEclERKS1_ }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN8Hasher325ResetEj }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__Z25ACLRv }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int64_25FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_7FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_18FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_25FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_eventbuf }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_26FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_16FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN17InitializerC2EPKcS1_PFvvE }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__checker_bcad_variable } ] ; <[20 x { i32, void ()* }]*> [#uses=0] -implementation ; Functions: +declare void @_GLOBAL__I__ZN62FLAG__foo_string_10FLAGS_E() -declare void %_GLOBAL__I__ZN62FLAG__foo_string_10FLAGS_E() +declare void @_GLOBAL__I__ZN60FLAG__foo_bool_19FLAGS_E() -declare void %_GLOBAL__I__ZN60FLAG__foo_bool_19FLAGS_E() +declare void @_GLOBAL__I__ZNK5Bzh4Enum13is_contiguousEv() -declare void %_GLOBAL__I__ZNK5Bzh4Enum13is_contiguousEv() +declare void @_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E() -declare void %_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E() +declare void @_GLOBAL__I__ZN61FLAG__foo_int32_21FLAGS_E() -declare void %_GLOBAL__I__ZN61FLAG__foo_int32_21FLAGS_E() - -void %_ZN14FlagRegistererIiEC1EPKcRK15FlagDescriptionIiE() { +define void @_ZN14FlagRegistererIiEC1EPKcRK15FlagDescriptionIiE() { entry: - call void %_Z12RegisterFlagIiEvPKcRK15FlagDescriptionIT_E( ) + call void @_Z12RegisterFlagIiEvPKcRK15FlagDescriptionIT_E( ) ret void } -void %_Z12RegisterFlagIiEvPKcRK15FlagDescriptionIT_E() { +define void @_Z12RegisterFlagIiEvPKcRK15FlagDescriptionIT_E() { entry: - call void %_ZN9MutexLockC1EP5Mutex( ) + call void @_ZN9MutexLockC1EP5Mutex( ) ret void } -declare void %_GLOBAL__I__ZN7ScannerC2Ev() +declare void @_GLOBAL__I__ZN7ScannerC2Ev() -declare void %_GLOBAL__I__Z11StripStringPSsPKcc() +declare void @_GLOBAL__I__Z11StripStringPSsPKcc() -void %_ZNSt6vectorIiSaIiEEC1ERKS0_() { +define void @_ZNSt6vectorIiSaIiEEC1ERKS0_() { entry: unreachable } -declare void %_GLOBAL__I__ZNK9__gnu_cxx4hashI11StringPieceEclERKS1_() +declare void @_GLOBAL__I__ZNK9__gnu_cxx4hashI11StringPieceEclERKS1_() -declare void %_GLOBAL__I__ZN8Hasher325ResetEj() +declare void @_GLOBAL__I__ZN8Hasher325ResetEj() -declare void %_GLOBAL__I__Z25ACLRv() +declare void @_GLOBAL__I__Z25ACLRv() -void %_ZN9MutexLockC1EP5Mutex() { +define void @_ZN9MutexLockC1EP5Mutex() { entry: - call void %_ZN5Mutex4LockEv( ) + call void @_ZN5Mutex4LockEv( ) ret void } -void %_ZN5Mutex4LockEv() { +define void @_ZN5Mutex4LockEv() { entry: - call void %_Z22Acquire_CASPViii( ) + call void @_Z22Acquire_CASPViii( ) ret void } -csretcc void %_ZNSt3mapIPKc15FlagDescriptionIiE9StringCmpSaISt4pairIKS1_S3_EEE3endEv("struct.std::_Rb_tree_const_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >"* %agg.result) { +define void @_ZNSt3mapIPKc15FlagDescriptionIiE9StringCmpSaISt4pairIKS1_S3_EEE3endEv(%"struct.std::_Rb_tree_const_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >"* sret %agg.result) { entry: unreachable } -declare void %_GLOBAL__I__ZN61FLAG__foo_int64_25FLAGS_E() +declare void @_GLOBAL__I__ZN61FLAG__foo_int64_25FLAGS_E() -void %_Z14CASPViii() { +define void @_Z14CASPViii() { entry: - %tmp3 = call int asm sideeffect "lock; cmpxchg $1,$2", "={ax},q,m,0,~{dirflag},~{fpsr},~{flags},~{memory}"( int 0, int* null, int 0 ) ; <int> [#uses=0] + %tmp3 = call i32 asm sideeffect "lock; cmpxchg $1,$2", "={ax},q,m,0,~{dirflag},~{fpsr},~{flags},~{memory}"( i32 0, i32* null, i32 0 ) ; <i32> [#uses=0] unreachable } -declare void %_GLOBAL__I__ZN61FLAG__foo_int32_7FLAGS_E() +declare void @_GLOBAL__I__ZN61FLAG__foo_int32_7FLAGS_E() -declare void %_GLOBAL__I__ZN62FLAG__foo_string_18FLAGS_E() +declare void @_GLOBAL__I__ZN62FLAG__foo_string_18FLAGS_E() -void %_Z22Acquire_CASPViii() { +define void @_Z22Acquire_CASPViii() { entry: - call void %_Z14CASPViii( ) + call void @_Z14CASPViii( ) unreachable } -declare void %_GLOBAL__I__ZN61FLAG__foo_int32_25FLAGS_E() +declare void @_GLOBAL__I__ZN61FLAG__foo_int32_25FLAGS_E() -declare void %_GLOBAL__I_eventbuf() +declare void @_GLOBAL__I_eventbuf() -void %_GLOBAL__I__ZN61FLAG__foo_int32_26FLAGS_E() { +define void @_GLOBAL__I__ZN61FLAG__foo_int32_26FLAGS_E() { entry: - call void %_Z41__static_initialization_and_destruction_0ii1662( int 1, int 65535 ) + call void @_Z41__static_initialization_and_destruction_0ii1662( i32 1, i32 65535 ) ret void } -void %_Z41__static_initialization_and_destruction_0ii1662(int %__initialize_p, int %__priority) { +define void @_Z41__static_initialization_and_destruction_0ii1662(i32 %__initialize_p, i32 %__priority) { entry: - %__initialize_p_addr = alloca int ; <int*> [#uses=2] - %__priority_addr = alloca int ; <int*> [#uses=2] - store int %__initialize_p, int* %__initialize_p_addr - store int %__priority, int* %__priority_addr - %tmp = load int* %__priority_addr ; <int> [#uses=1] - %tmp = seteq int %tmp, 65535 ; <bool> [#uses=1] - br bool %tmp, label %cond_true, label %cond_next14 + %__initialize_p_addr = alloca i32 ; <i32*> [#uses=2] + %__priority_addr = alloca i32 ; <i32*> [#uses=2] + store i32 %__initialize_p, i32* %__initialize_p_addr + store i32 %__priority, i32* %__priority_addr + %tmp = load i32* %__priority_addr ; <i32> [#uses=1] + %tmp.upgrd.1 = icmp eq i32 %tmp, 65535 ; <i1> [#uses=1] + br i1 %tmp.upgrd.1, label %cond_true, label %cond_next14 cond_true: ; preds = %entry - %tmp8 = load int* %__initialize_p_addr ; <int> [#uses=1] - %tmp9 = seteq int %tmp8, 1 ; <bool> [#uses=1] - br bool %tmp9, label %cond_true10, label %cond_next14 + %tmp8 = load i32* %__initialize_p_addr ; <i32> [#uses=1] + %tmp9 = icmp eq i32 %tmp8, 1 ; <i1> [#uses=1] + br i1 %tmp9, label %cond_true10, label %cond_next14 cond_true10: ; preds = %cond_true - call void %_ZN14FlagRegistererIiEC1EPKcRK15FlagDescriptionIiE( ) + call void @_ZN14FlagRegistererIiEC1EPKcRK15FlagDescriptionIiE( ) ret void cond_next14: ; preds = %cond_true, %entry ret void } -declare void %_GLOBAL__I__ZN62FLAG__foo_string_16FLAGS_E() +declare void @_GLOBAL__I__ZN62FLAG__foo_string_16FLAGS_E() -void %_ZN9__gnu_cxx13new_allocatorIPNS_15_Hashtable_nodeIjEEEC2Ev() { +define void @_ZN9__gnu_cxx13new_allocatorIPNS_15_Hashtable_nodeIjEEEC2Ev() { entry: unreachable } -declare void %_GLOBAL__I__ZN17InitializerC2EPKcS1_PFvvE() +declare void @_GLOBAL__I__ZN17InitializerC2EPKcS1_PFvvE() -declare void %_GLOBAL__I__checker_bcad_variable() +declare void @_GLOBAL__I__checker_bcad_variable() diff --git a/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll b/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll index cd76681..39be6c4 100644 --- a/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll +++ b/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll @@ -1,33 +1,33 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt -disable-output - %struct._list = type { int*, %struct._list* } - %struct._play = type { int, int*, %struct._list*, %struct._play* } -%nrow = internal global int 0 ; <int*> [#uses=2] +; RUN: llvm-as < %s | opt -globalopt -disable-output -implementation ; Functions: + %struct._list = type { i32*, %struct._list* } + %struct._play = type { i32, i32*, %struct._list*, %struct._play* } +@nrow = internal global i32 0 ; <i32*> [#uses=2] -void %make_play() { +define void @make_play() { entry: - br label %cond_true16.i + br label %cond_true16.i -cond_true16.i: ; preds = %cond_true16.i, %entry - %low.0.in.i.0 = phi int* [ %nrow, %entry ], [ null, %cond_true16.i ] ; <int*> [#uses=1] - %low.0.i = load int* %low.0.in.i.0 ; <int> [#uses=0] - br label %cond_true16.i +cond_true16.i: ; preds = %cond_true16.i, %entry + %low.0.in.i.0 = phi i32* [ @nrow, %entry ], [ null, %cond_true16.i ] ; <i32*> [#uses=1] + %low.0.i = load i32* %low.0.in.i.0 ; <i32> [#uses=0] + br label %cond_true16.i } -void %make_wanted() { +define void @make_wanted() { entry: - unreachable + unreachable } -void %get_good_move() { +define void @get_good_move() { entry: - ret void + ret void } -void %main() { +define void @main() { entry: - store int 8, int* %nrow - tail call void %make_play( ) - ret void + store i32 8, i32* @nrow + tail call void @make_play( ) + ret void } + diff --git a/test/Transforms/GlobalOpt/basictest.llx b/test/Transforms/GlobalOpt/basictest.llx index 1f97fc0..1c3bdbb 100644 --- a/test/Transforms/GlobalOpt/basictest.llx +++ b/test/Transforms/GlobalOpt/basictest.llx @@ -1,9 +1,9 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep global +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global -%X = internal global int 4 +@X = internal global i32 4 ; <i32*> [#uses=1] - -int %foo() { - %V = load int* %X - ret int %V +define i32 @foo() { + %V = load i32* @X ; <i32> [#uses=1] + ret i32 %V } + diff --git a/test/Transforms/GlobalOpt/ctor-list-opt.ll b/test/Transforms/GlobalOpt/ctor-list-opt.ll index 6270f4f..56aeadb 100644 --- a/test/Transforms/GlobalOpt/ctor-list-opt.ll +++ b/test/Transforms/GlobalOpt/ctor-list-opt.ll @@ -1,97 +1,85 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep CTOR +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep CTOR +@llvm.global_ctors = appending global [10 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @CTOR1 }, { i32, void ()* } { i32 65535, void ()* @CTOR1 }, { i32, void ()* } { i32 65535, void ()* @CTOR2 }, { i32, void ()* } { i32 65535, void ()* @CTOR3 }, { i32, void ()* } { i32 65535, void ()* @CTOR4 }, { i32, void ()* } { i32 65535, void ()* @CTOR5 }, { i32, void ()* } { i32 65535, void ()* @CTOR6 }, { i32, void ()* } { i32 65535, void ()* @CTOR7 }, { i32, void ()* } { i32 65535, void ()* @CTOR8 }, { i32, void ()* } { i32 2147483647, void ()* null } ] ; <[10 x { i32, void ()* }]*> [#uses=0] +@G = global i32 0 ; <i32*> [#uses=1] +@G2 = global i32 0 ; <i32*> [#uses=1] +@G3 = global i32 -123 ; <i32*> [#uses=2] +@X = global { i32, [2 x i32] } { i32 0, [2 x i32] [ i32 17, i32 21 ] } ; <{ i32, [2 x i32] }*> [#uses=2] +@Y = global i32 -1 ; <i32*> [#uses=2] +@Z = global i32 123 ; <i32*> [#uses=1] +@D = global double 0.000000e+00 ; <double*> [#uses=1] +@CTORGV = internal global i1 false ; <i1*> [#uses=2] -%llvm.global_ctors = appending global [10 x { int, void ()* }] [ - { int, void ()* } { int 65535, void ()* %CTOR1 }, - { int, void ()* } { int 65535, void ()* %CTOR1 }, - { int, void ()* } { int 65535, void ()* %CTOR2 }, - { int, void ()* } { int 65535, void ()* %CTOR3 }, - { int, void ()* } { int 65535, void ()* %CTOR4 }, - { int, void ()* } { int 65535, void ()* %CTOR5 }, - { int, void ()* } { int 65535, void ()* %CTOR6 }, - { int, void ()* } { int 65535, void ()* %CTOR7 }, - { int, void ()* } { int 65535, void ()* %CTOR8 }, - { int, void ()* } { int 2147483647, void ()* null } -] - -%G = global int 0 -%G2 = global int 0 -%G3 = global int -123 -%X = global {int, [2 x int]} { int 0, [2 x int] [ int 17, int 21] } -%Y = global int -1 -%Z = global int 123 -%D = global double 0.0 - -%CTORGV = internal global bool false ;; Should become constant after eval - -implementation - -internal void %CTOR1() { ;; noop ctor, remove. - ret void +define internal void @CTOR1() { + ret void } -internal void %CTOR2() { ;; evaluate the store - %A = add int 1, 23 - store int %A, int* %G - store bool true, bool* %CTORGV - ret void +define internal void @CTOR2() { + %A = add i32 1, 23 ; <i32> [#uses=1] + store i32 %A, i32* @G + store i1 true, i1* @CTORGV + ret void } -internal void %CTOR3() { - %X = or bool true, false +define internal void @CTOR3() { + %X = or i1 true, false ; <i1> [#uses=1] br label %Cont -Cont: - br bool %X, label %S, label %T -S: - store int 24, int* %G2 + +Cont: ; preds = %0 + br i1 %X, label %S, label %T + +S: ; preds = %Cont + store i32 24, i32* @G2 ret void -T: + +T: ; preds = %Cont ret void } -internal void %CTOR4() { - %X = load int* %G3 - %Y = add int %X, 123 - store int %Y, int* %G3 +define internal void @CTOR4() { + %X = load i32* @G3 ; <i32> [#uses=1] + %Y = add i32 %X, 123 ; <i32> [#uses=1] + store i32 %Y, i32* @G3 ret void } -internal void %CTOR5() { - %X.2p = getelementptr {int,[2 x int]}* %X, int 0, uint 1, int 0 - %X.2 = load int* %X.2p - %X.1p = getelementptr {int,[2 x int]}* %X, int 0, uint 0 - store int %X.2, int* %X.1p - store int 42, int* %X.2p +define internal void @CTOR5() { + %X.2p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2] + %X.2 = load i32* %X.2p ; <i32> [#uses=1] + %X.1p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1] + store i32 %X.2, i32* %X.1p + store i32 42, i32* %X.2p ret void } -internal void %CTOR6() { - %A = alloca int - %y = load int* %Y - store int %y, int* %A - %Av = load int* %A - %Av1 = add int %Av, 1 - store int %Av1, int* %Y +define internal void @CTOR6() { + %A = alloca i32 ; <i32*> [#uses=2] + %y = load i32* @Y ; <i32> [#uses=1] + store i32 %y, i32* %A + %Av = load i32* %A ; <i32> [#uses=1] + %Av1 = add i32 %Av, 1 ; <i32> [#uses=1] + store i32 %Av1, i32* @Y ret void } -internal void %CTOR7() { - call void %setto(int* %Z, int 0) +define internal void @CTOR7() { + call void @setto( i32* @Z, i32 0 ) ret void } -void %setto(int* %P, int %V) { - store int %V, int* %P +define void @setto(i32* %P, i32 %V) { + store i32 %V, i32* %P ret void } -declare double %cos(double) +declare double @cos(double) -internal void %CTOR8() { - %X = call double %cos(double 1.0) - store double %X, double* %D +define internal void @CTOR8() { + %X = call double @cos( double 1.000000e+00 ) ; <double> [#uses=1] + store double %X, double* @D ret void } -bool %accessor() { - %V = load bool* %CTORGV ;; constant true - ret bool %V + +define i1 @accessor() { + %V = load i1* @CTORGV ; <i1> [#uses=1] + ret i1 %V } diff --git a/test/Transforms/GlobalOpt/deadglobal.llx b/test/Transforms/GlobalOpt/deadglobal.llx index a7397bf..7a47b8e 100644 --- a/test/Transforms/GlobalOpt/deadglobal.llx +++ b/test/Transforms/GlobalOpt/deadglobal.llx @@ -1,8 +1,9 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep internal +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep internal -%G = internal global int 123 +@G = internal global i32 123 ; <i32*> [#uses=1] -void %foo() { - store int 1, int* %G - ret void +define void @foo() { + store i32 1, i32* @G + ret void } + diff --git a/test/Transforms/GlobalOpt/globalsra-partial.llx b/test/Transforms/GlobalOpt/globalsra-partial.llx index e060565..e52e7fe 100644 --- a/test/Transforms/GlobalOpt/globalsra-partial.llx +++ b/test/Transforms/GlobalOpt/globalsra-partial.llx @@ -1,23 +1,23 @@ ; In this case, the global can only be broken up by one level. -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep 12345 +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep 12345 -%G = internal global { int, [4 x float] } zeroinitializer +@G = internal global { i32, [4 x float] } zeroinitializer ; <{ i32, [4 x float] }*> [#uses=3] -void %onlystore() { - store int 12345, int* getelementptr ({ int, [4 x float] }* %G, int 0, uint 0) - ret void +define void @onlystore() { + store i32 12345, i32* getelementptr ({ i32, [4 x float] }* @G, i32 0, i32 0) + ret void } -void %storeinit(int %i) { - %Ptr = getelementptr { int, [4 x float] }* %G, int 0, uint 1, int %i - store float 1.0, float* %Ptr - ret void +define void @storeinit(i32 %i) { + %Ptr = getelementptr { i32, [4 x float] }* @G, i32 0, i32 1, i32 %i ; <float*> [#uses=1] + store float 1.000000e+00, float* %Ptr + ret void } -float %readval(int %i) { - %Ptr = getelementptr { int, [4 x float] }* %G, int 0, uint 1, int %i - %V = load float* %Ptr - ret float %V +define float @readval(i32 %i) { + %Ptr = getelementptr { i32, [4 x float] }* @G, i32 0, i32 1, i32 %i ; <float*> [#uses=1] + %V = load float* %Ptr ; <float> [#uses=1] + ret float %V } diff --git a/test/Transforms/GlobalOpt/globalsra.llx b/test/Transforms/GlobalOpt/globalsra.llx index a87b954..3623555 100644 --- a/test/Transforms/GlobalOpt/globalsra.llx +++ b/test/Transforms/GlobalOpt/globalsra.llx @@ -1,19 +1,23 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep global +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global -%G = internal global { int, float, {double} } { int 1, float 1.0, {double} {double 17.27} } +@G = internal global { i32, float, { double } } { + i32 1, + float 1.000000e+00, + { double } { double 1.727000e+01 } } ; <{ i32, float, { double } }*> [#uses=3] -void %onlystore() { - store int 123, int* getelementptr ({ int, float, {double} }* %G, int 0, uint 0) - ret void +define void @onlystore() { + store i32 123, i32* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 0) + ret void } -float %storeinit() { - store float 1.0, float* getelementptr ({ int, float, {double} }* %G, int 0, uint 1) - %X = load float* getelementptr ({ int, float, {double} }* %G, int 0, uint 1) - ret float %X +define float @storeinit() { + store float 1.000000e+00, float* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 1) + %X = load float* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 1) ; <float> [#uses=1] + ret float %X } -double %constantize() { - %X = load double* getelementptr ({ int, float, {double} }* %G, int 0, uint 2, uint 0) - ret double %X +define double @constantize() { + %X = load double* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 2, i32 0) ; <double> [#uses=1] + ret double %X } + diff --git a/test/Transforms/GlobalOpt/integer-bool.ll b/test/Transforms/GlobalOpt/integer-bool.ll index eef2f72..9fbbe35 100644 --- a/test/Transforms/GlobalOpt/integer-bool.ll +++ b/test/Transforms/GlobalOpt/integer-bool.ll @@ -1,23 +1,23 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt -instcombine | \ +; RUN: llvm-as < %s | opt -globalopt -instcombine | \ ; RUN: llvm-dis | grep {ret i1 true} ;; check that global opt turns integers that only hold 0 or 1 into bools. -%G = internal global int 0 ;; This only holds 0 or 1. +@G = internal global i32 0 ; <i32*> [#uses=3] -implementation - -void %set1() { - store int 0, int* %G - ret void +define void @set1() { + store i32 0, i32* @G + ret void } -void %set2() { - store int 1, int* %G - ret void + +define void @set2() { + store i32 1, i32* @G + ret void } -bool %get() { - %A = load int* %G - %C = setlt int %A, 2 ;; always true - ret bool %C +define i1 @get() { + %A = load i32* @G ; <i32> [#uses=1] + %C = icmp slt i32 %A, 2 ; <i1> [#uses=1] + ret i1 %C } + diff --git a/test/Transforms/GlobalOpt/iterate.llx b/test/Transforms/GlobalOpt/iterate.llx index e4e59c6..d764c5d 100644 --- a/test/Transforms/GlobalOpt/iterate.llx +++ b/test/Transforms/GlobalOpt/iterate.llx @@ -1,10 +1,11 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep %G +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep %G -%G = internal global int 0 -%H = internal global { int* } { int* %G } +@G = internal global i32 0 ; <i32*> [#uses=1] +@H = internal global { i32* } { i32* @G } ; <{ i32* }*> [#uses=1] -int %loadg() { - %G = load int** getelementptr ({int*}* %H, int 0, uint 0) - %GV = load int* %G - ret int %GV +define i32 @loadg() { + %G = load i32** getelementptr ({ i32* }* @H, i32 0, i32 0) ; <i32*> [#uses=1] + %GV = load i32* %G ; <i32> [#uses=1] + ret i32 %GV } + diff --git a/test/Transforms/GlobalOpt/load-store-global.llx b/test/Transforms/GlobalOpt/load-store-global.llx index bf5d3a2..d89d226 100644 --- a/test/Transforms/GlobalOpt/load-store-global.llx +++ b/test/Transforms/GlobalOpt/load-store-global.llx @@ -1,14 +1,15 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep G +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep G -%G = internal global int 17 +@G = internal global i32 17 ; <i32*> [#uses=3] -void %foo() { - %V = load int* %G - store int %V, int* %G ;; Doesn't change the value +define void @foo() { + %V = load i32* @G ; <i32> [#uses=1] + store i32 %V, i32* @G ret void } -int %bar() { - %X = load int* %G - ret int %X + +define i32 @bar() { + %X = load i32* @G ; <i32> [#uses=1] + ret i32 %X } diff --git a/test/Transforms/GlobalOpt/malloc-promote-1.llx b/test/Transforms/GlobalOpt/malloc-promote-1.llx index 068e96f..fea4dbd 100644 --- a/test/Transforms/GlobalOpt/malloc-promote-1.llx +++ b/test/Transforms/GlobalOpt/malloc-promote-1.llx @@ -1,18 +1,18 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep global +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global -%G = internal global int* null +@G = internal global i32* null ; <i32**> [#uses=3] -void %init() { - %P = malloc int - store int* %P, int** %G - - %GV = load int** %G - store int 0, int* %GV - ret void +define void @init() { + %P = malloc i32 ; <i32*> [#uses=1] + store i32* %P, i32** @G + %GV = load i32** @G ; <i32*> [#uses=1] + store i32 0, i32* %GV + ret void } -int %get() { - %GV = load int** %G - %V = load int* %GV - ret int %V +define i32 @get() { + %GV = load i32** @G ; <i32*> [#uses=1] + %V = load i32* %GV ; <i32> [#uses=1] + ret i32 %V } + diff --git a/test/Transforms/GlobalOpt/malloc-promote-2.llx b/test/Transforms/GlobalOpt/malloc-promote-2.llx index 12d4c6d..1b33632 100644 --- a/test/Transforms/GlobalOpt/malloc-promote-2.llx +++ b/test/Transforms/GlobalOpt/malloc-promote-2.llx @@ -1,20 +1,20 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep malloc +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep malloc -%G = internal global int* null +@G = internal global i32* null ; <i32**> [#uses=3] -void %init() { - %P = malloc int, uint 100 - store int* %P, int** %G - - %GV = load int** %G - %GVe = getelementptr int* %GV, int 40 - store int 20, int* %GVe - ret void +define void @init() { + %P = malloc i32, i32 100 ; <i32*> [#uses=1] + store i32* %P, i32** @G + %GV = load i32** @G ; <i32*> [#uses=1] + %GVe = getelementptr i32* %GV, i32 40 ; <i32*> [#uses=1] + store i32 20, i32* %GVe + ret void } -int %get() { - %GV = load int** %G - %GVe = getelementptr int* %GV, int 40 - %V = load int* %GVe - ret int %V +define i32 @get() { + %GV = load i32** @G ; <i32*> [#uses=1] + %GVe = getelementptr i32* %GV, i32 40 ; <i32*> [#uses=1] + %V = load i32* %GVe ; <i32> [#uses=1] + ret i32 %V } + diff --git a/test/Transforms/GlobalOpt/malloc-promote-3.llx b/test/Transforms/GlobalOpt/malloc-promote-3.llx index 85ce6bd..26ce8fd 100644 --- a/test/Transforms/GlobalOpt/malloc-promote-3.llx +++ b/test/Transforms/GlobalOpt/malloc-promote-3.llx @@ -1,26 +1,26 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep malloc +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep malloc -%G = internal global int* null +@G = internal global i32* null ; <i32**> [#uses=4] -void %init() { - %P = malloc int, uint 100 - store int* %P, int** %G - - %GV = load int** %G - %GVe = getelementptr int* %GV, int 40 - store int 20, int* %GVe - ret void +define void @init() { + %P = malloc i32, i32 100 ; <i32*> [#uses=1] + store i32* %P, i32** @G + %GV = load i32** @G ; <i32*> [#uses=1] + %GVe = getelementptr i32* %GV, i32 40 ; <i32*> [#uses=1] + store i32 20, i32* %GVe + ret void } -int %get() { - %GV = load int** %G - %GVe = getelementptr int* %GV, int 40 - %V = load int* %GVe - ret int %V +define i32 @get() { + %GV = load i32** @G ; <i32*> [#uses=1] + %GVe = getelementptr i32* %GV, i32 40 ; <i32*> [#uses=1] + %V = load i32* %GVe ; <i32> [#uses=1] + ret i32 %V } -bool %check() { ;; Return true if init has been called - %GV = load int** %G - %V = seteq int* %GV, null - ret bool %V +define i1 @check() { + %GV = load i32** @G ; <i32*> [#uses=1] + %V = icmp eq i32* %GV, null ; <i1> [#uses=1] + ret i1 %V } + diff --git a/test/Transforms/GlobalOpt/memcpy.ll b/test/Transforms/GlobalOpt/memcpy.ll index a110d40..b51aedb 100644 --- a/test/Transforms/GlobalOpt/memcpy.ll +++ b/test/Transforms/GlobalOpt/memcpy.ll @@ -1,17 +1,15 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | \ +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \ ; RUN: grep {G1 = internal constant} -%G1 = internal global [58 x sbyte] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00" +@G1 = internal global [58 x i8] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00" ; <[58 x i8]*> [#uses=1] -implementation +declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) -declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint, uint) - -void %foo() { - %Blah = alloca [58 x sbyte] ; <[58 x sbyte]*> [#uses=2] - %tmp.0 = getelementptr [58 x sbyte]* %Blah, int 0, int 0 ; <sbyte*> [#uses=1] - call void %llvm.memcpy.i32( sbyte* %tmp.0, sbyte* getelementptr ([58 x sbyte]* %G1, int 0, int 0), uint 58, uint 1 ) - ret void +define void @foo() { + %Blah = alloca [58 x i8] ; <[58 x i8]*> [#uses=1] + %tmp.0 = getelementptr [58 x i8]* %Blah, i32 0, i32 0 ; <i8*> [#uses=1] + call void @llvm.memcpy.i32( i8* %tmp.0, i8* getelementptr ([58 x i8]* @G1, i32 0, i32 0), i32 58, i32 1 ) + ret void } diff --git a/test/Transforms/GlobalOpt/memset.ll b/test/Transforms/GlobalOpt/memset.ll index 336a234..0ee851f 100644 --- a/test/Transforms/GlobalOpt/memset.ll +++ b/test/Transforms/GlobalOpt/memset.ll @@ -1,23 +1,21 @@ ; both globals are write only, delete them. -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | \ +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \ ; RUN: not grep internal -%G0 = internal global [58 x sbyte] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00" +@G0 = internal global [58 x i8] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00" ; <[58 x i8]*> [#uses=1] +@G1 = internal global [4 x i32] [ i32 1, i32 2, i32 3, i32 4 ] ; <[4 x i32]*> [#uses=1] -%G1 = internal global [4 x int] [ int 1, int 2, int 3, int 4] +declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) -implementation ; Functions: +declare void @llvm.memset.i32(i8*, i8, i32, i32) -declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint, uint) -declare void %llvm.memset.i32(sbyte*, ubyte, uint, uint) - -void %foo() { - %Blah = alloca [58 x sbyte] ; <[58 x sbyte]*> [#uses=2] - %tmp3 = cast [58 x sbyte]* %Blah to sbyte* - call void %llvm.memcpy.i32( sbyte* cast ([4 x int]* %G1 to sbyte*), sbyte* %tmp3, uint 16, uint 1) - call void %llvm.memset.i32( sbyte* getelementptr ([58 x sbyte]* %G0, int 0, int 0), ubyte 17, uint 58, uint 1) - ret void +define void @foo() { + %Blah = alloca [58 x i8] ; <[58 x i8]*> [#uses=1] + %tmp3 = bitcast [58 x i8]* %Blah to i8* ; <i8*> [#uses=1] + call void @llvm.memcpy.i32( i8* bitcast ([4 x i32]* @G1 to i8*), i8* %tmp3, i32 16, i32 1 ) + call void @llvm.memset.i32( i8* getelementptr ([58 x i8]* @G0, i32 0, i32 0), i8 17, i32 58, i32 1 ) + ret void } diff --git a/test/Transforms/GlobalOpt/phi-select.llx b/test/Transforms/GlobalOpt/phi-select.llx index 2389c0a..da1314f 100644 --- a/test/Transforms/GlobalOpt/phi-select.llx +++ b/test/Transforms/GlobalOpt/phi-select.llx @@ -1,26 +1,28 @@ ; Test that PHI nodes and select instructions do not necessarily make stuff ; non-constant. -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep global +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global -%X = internal global int 4 -%Y = internal global int 5 +@X = internal global i32 4 ; <i32*> [#uses=2] +@Y = internal global i32 5 ; <i32*> [#uses=2] -int %test1(bool %C) { - %P = select bool %C, int* %X, int* %Y - %V = load int* %P - ret int %V +define i32 @test1(i1 %C) { + %P = select i1 %C, i32* @X, i32* @Y ; <i32*> [#uses=1] + %V = load i32* %P ; <i32> [#uses=1] + ret i32 %V } +define i32 @test2(i1 %C) { +; <label>:0 + br i1 %C, label %T, label %Cont -int %test2(bool %C) { - br bool %C, label %T, label %Cont -T: - br label %Cont -Cont: - %P = phi int* [%X, %0], [%Y, %T] - %V = load int* %P - ret int %V +T: ; preds = %0 + br label %Cont + +Cont: ; preds = %T, %0 + %P = phi i32* [ @X, %0 ], [ @Y, %T ] ; <i32*> [#uses=1] + %V = load i32* %P ; <i32> [#uses=1] + ret i32 %V } diff --git a/test/Transforms/GlobalOpt/storepointer-compare.llx b/test/Transforms/GlobalOpt/storepointer-compare.llx index d85d97d..86eff51 100644 --- a/test/Transforms/GlobalOpt/storepointer-compare.llx +++ b/test/Transforms/GlobalOpt/storepointer-compare.llx @@ -1,29 +1,30 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | \ +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \ ; RUN: grep {call void @Actual} ; Check that a comparison does not prevent an indirect call from being made ; direct. The global will still remain, but indirect call elim is still good. -%G = internal global void ()* null +@G = internal global void ()* null ; <void ()**> [#uses=2] -implementation - -internal void %Actual() { - ret void +define internal void @Actual() { + ret void } -void %init() { - store void()* %Actual, void()** %G - ret void +define void @init() { + store void ()* @Actual, void ()** @G + ret void } -void %doit() { - %FP = load void()** %G - %CC = seteq void()* %FP, null - br bool %CC, label %isNull, label %DoCall -DoCall: - call void %FP() - ret void -isNull: - ret void +define void @doit() { + %FP = load void ()** @G ; <void ()*> [#uses=2] + %CC = icmp eq void ()* %FP, null ; <i1> [#uses=1] + br i1 %CC, label %isNull, label %DoCall + +DoCall: ; preds = %0 + call void %FP( ) + ret void + +isNull: ; preds = %0 + ret void } + diff --git a/test/Transforms/GlobalOpt/storepointer.llx b/test/Transforms/GlobalOpt/storepointer.llx index a424d25..d57a6ac 100644 --- a/test/Transforms/GlobalOpt/storepointer.llx +++ b/test/Transforms/GlobalOpt/storepointer.llx @@ -1,20 +1,19 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep global +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global -%G = internal global void ()* null +@G = internal global void ()* null ; <void ()**> [#uses=2] -implementation - -internal void %Actual() { - ret void +define internal void @Actual() { + ret void } -void %init() { - store void()* %Actual, void()** %G - ret void +define void @init() { + store void ()* @Actual, void ()** @G + ret void } -void %doit() { - %FP = load void()** %G - call void %FP() - ret void +define void @doit() { + %FP = load void ()** @G ; <void ()*> [#uses=1] + call void %FP( ) + ret void } + diff --git a/test/Transforms/GlobalOpt/trivialstore.llx b/test/Transforms/GlobalOpt/trivialstore.llx index 8b1f1ce..a662565 100644 --- a/test/Transforms/GlobalOpt/trivialstore.llx +++ b/test/Transforms/GlobalOpt/trivialstore.llx @@ -1,17 +1,19 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep G +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep G -%G = internal global int 17 +@G = internal global i32 17 ; <i32*> [#uses=3] -void %foo() { - store int 17, int* %G ;; Doesn't change the value - ret void +define void @foo() { + store i32 17, i32* @G + ret void } -int %bar() { - %X = load int* %G - ret int %X + +define i32 @bar() { + %X = load i32* @G ; <i32> [#uses=1] + ret i32 %X } -internal void %dead() { - store int 123, int* %G - ret void +define internal void @dead() { + store i32 123, i32* @G + ret void } + diff --git a/test/Transforms/GlobalOpt/undef-init.llx b/test/Transforms/GlobalOpt/undef-init.llx index 2f073c2..bb483fc 100644 --- a/test/Transforms/GlobalOpt/undef-init.llx +++ b/test/Transforms/GlobalOpt/undef-init.llx @@ -1,18 +1,17 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep store +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep store -%llvm.global_ctors = appending global [1 x { int, void ()* }] [ { int, void ()* } { int 65535, void ()* %_GLOBAL__I__Z3foov } ] ; <[1 x { int, void ()* }]*> [#uses=0] -%X.0 = internal global int undef ; <int*> [#uses=2] +@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__Z3foov } ] ; <[1 x { i32, void ()* }]*> [#uses=0] +@X.0 = internal global i32 undef ; <i32*> [#uses=2] -implementation ; Functions: - -int %_Z3foov() { +define i32 @_Z3foov() { entry: - %tmp.1 = load int* %X.0 ; <int> [#uses=1] - ret int %tmp.1 + %tmp.1 = load i32* @X.0 ; <i32> [#uses=1] + ret i32 %tmp.1 } -internal void %_GLOBAL__I__Z3foov() { +define internal void @_GLOBAL__I__Z3foov() { entry: - store int 1, int* %X.0 - ret void + store i32 1, i32* @X.0 + ret void } + |