diff options
author | Tanya Lattner <tonic@nondot.org> | 2008-03-18 04:14:37 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2008-03-18 04:14:37 +0000 |
commit | 683283763f3293eaa6d7034b23fac0d1620e13c7 (patch) | |
tree | c7465502866ccb75db5360e7809bc2e567672ec6 /test/Transforms/ScalarRepl/AggregatePromote.ll | |
parent | f04d8d1593d0eedf5b9deaab48462dd88fefab93 (diff) | |
download | external_llvm-683283763f3293eaa6d7034b23fac0d1620e13c7.zip external_llvm-683283763f3293eaa6d7034b23fac0d1620e13c7.tar.gz external_llvm-683283763f3293eaa6d7034b23fac0d1620e13c7.tar.bz2 |
Upgrade tests to not use llvm-upgrade.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48484 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/ScalarRepl/AggregatePromote.ll')
-rw-r--r-- | test/Transforms/ScalarRepl/AggregatePromote.ll | 85 |
1 files changed, 41 insertions, 44 deletions
diff --git a/test/Transforms/ScalarRepl/AggregatePromote.ll b/test/Transforms/ScalarRepl/AggregatePromote.ll index 67ccad0..104a0f9 100644 --- a/test/Transforms/ScalarRepl/AggregatePromote.ll +++ b/test/Transforms/ScalarRepl/AggregatePromote.ll @@ -1,54 +1,51 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | \ -; RUN: not grep alloca +; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \ +; RUN: not grep alloca -target endian = big -target pointersize = 32 +target datalayout = "E-p:32:32" target triple = "powerpc-apple-darwin8.0.0" -long %test1(long %X) { - %A = alloca long - store long %X, long* %A - %B = cast long* %A to int* - %C = cast int* %B to sbyte* - store sbyte 0, sbyte* %C - %Y = load long *%A - ret long %Y +define i64 @test1(i64 %X) { + %A = alloca i64 ; <i64*> [#uses=3] + store i64 %X, i64* %A + %B = bitcast i64* %A to i32* ; <i32*> [#uses=1] + %C = bitcast i32* %B to i8* ; <i8*> [#uses=1] + store i8 0, i8* %C + %Y = load i64* %A ; <i64> [#uses=1] + ret i64 %Y } - -sbyte %test2(long %X) { - %X_addr = alloca long ; <long*> [#uses=2] - store long %X, long* %X_addr - %tmp.0 = cast long* %X_addr to int* ; <int*> [#uses=1] - %tmp.1 = getelementptr int* %tmp.0, int 1 ; <int*> [#uses=1] - %tmp.2 = cast int* %tmp.1 to sbyte* - %tmp.3 = getelementptr sbyte* %tmp.2, int 3 - %tmp.2 = load sbyte* %tmp.3 ; <int> [#uses=1] - ret sbyte %tmp.2 +define i8 @test2(i64 %X) { + %X_addr = alloca i64 ; <i64*> [#uses=2] + store i64 %X, i64* %X_addr + %tmp.0 = bitcast i64* %X_addr to i32* ; <i32*> [#uses=1] + %tmp.1 = getelementptr i32* %tmp.0, i32 1 ; <i32*> [#uses=1] + %tmp.2 = bitcast i32* %tmp.1 to i8* ; <i8*> [#uses=1] + %tmp.3 = getelementptr i8* %tmp.2, i32 3 ; <i8*> [#uses=1] + %tmp.2.upgrd.1 = load i8* %tmp.3 ; <i8> [#uses=1] + ret i8 %tmp.2.upgrd.1 } -short %crafty(long %X) { - %a = alloca { long } - %tmp.0 = getelementptr { long }* %a, int 0, uint 0 ; <long*> [#uses=1] - store long %X, long* %tmp.0 - %tmp.3 = cast { long }* %a to [4 x short]* ; <[4 x short]*> [#uses=2] - %tmp.4 = getelementptr [4 x short]* %tmp.3, int 0, int 3 ; <short*> [#uses=1] - %tmp.5 = load short* %tmp.4 ; <short> [#uses=1] - %tmp.8 = getelementptr [4 x short]* %tmp.3, int 0, int 2 ; <short*> [#uses=1] - %tmp.9 = load short* %tmp.8 ; <short> [#uses=1] - %tmp.10 = or short %tmp.9, %tmp.5 ; <short> [#uses=1] - ret short %tmp.10 +define i16 @crafty(i64 %X) { + %a = alloca { i64 } ; <{ i64 }*> [#uses=2] + %tmp.0 = getelementptr { i64 }* %a, i32 0, i32 0 ; <i64*> [#uses=1] + store i64 %X, i64* %tmp.0 + %tmp.3 = bitcast { i64 }* %a to [4 x i16]* ; <[4 x i16]*> [#uses=2] + %tmp.4 = getelementptr [4 x i16]* %tmp.3, i32 0, i32 3 ; <i16*> [#uses=1] + %tmp.5 = load i16* %tmp.4 ; <i16> [#uses=1] + %tmp.8 = getelementptr [4 x i16]* %tmp.3, i32 0, i32 2 ; <i16*> [#uses=1] + %tmp.9 = load i16* %tmp.8 ; <i16> [#uses=1] + %tmp.10 = or i16 %tmp.9, %tmp.5 ; <i16> [#uses=1] + ret i16 %tmp.10 } -short %crafty2(long %X) { - %a = alloca long - store long %X, long* %a - %tmp.3 = cast long* %a to [4 x short]* ; <[4 x short]*> [#uses=2] - %tmp.4 = getelementptr [4 x short]* %tmp.3, int 0, int 3 ; <short*> [#uses=1] - %tmp.5 = load short* %tmp.4 ; <short> [#uses=1] - %tmp.8 = getelementptr [4 x short]* %tmp.3, int 0, int 2 ; <short*> [#uses=1] - %tmp.9 = load short* %tmp.8 ; <short> [#uses=1] - %tmp.10 = or short %tmp.9, %tmp.5 ; <short> [#uses=1] - ret short %tmp.10 +define i16 @crafty2(i64 %X) { + %a = alloca i64 ; <i64*> [#uses=2] + store i64 %X, i64* %a + %tmp.3 = bitcast i64* %a to [4 x i16]* ; <[4 x i16]*> [#uses=2] + %tmp.4 = getelementptr [4 x i16]* %tmp.3, i32 0, i32 3 ; <i16*> [#uses=1] + %tmp.5 = load i16* %tmp.4 ; <i16> [#uses=1] + %tmp.8 = getelementptr [4 x i16]* %tmp.3, i32 0, i32 2 ; <i16*> [#uses=1] + %tmp.9 = load i16* %tmp.8 ; <i16> [#uses=1] + %tmp.10 = or i16 %tmp.9, %tmp.5 ; <i16> [#uses=1] + ret i16 %tmp.10 } - |