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 | ec9a35a6f9143cfa325e0413cc297c48f627973a (patch) | |
tree | c1b0621415acc20f94152c51174d53fae3dbc8cc /test/Transforms/GCSE | |
parent | ab3b77834c9232e4c13acb29afe1920b97c5a20b (diff) | |
download | external_llvm-ec9a35a6f9143cfa325e0413cc297c48f627973a.zip external_llvm-ec9a35a6f9143cfa325e0413cc297c48f627973a.tar.gz external_llvm-ec9a35a6f9143cfa325e0413cc297c48f627973a.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/GCSE')
-rw-r--r-- | test/Transforms/GCSE/2002-05-14-OperandSwap.ll | 23 | ||||
-rw-r--r-- | test/Transforms/GCSE/2002-05-21-NoSharedDominator.ll | 15 | ||||
-rw-r--r-- | test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll | 10 | ||||
-rw-r--r-- | test/Transforms/GCSE/gcsetests.ll | 93 | ||||
-rw-r--r-- | test/Transforms/GCSE/vectorops.ll | 34 |
5 files changed, 81 insertions, 94 deletions
diff --git a/test/Transforms/GCSE/2002-05-14-OperandSwap.ll b/test/Transforms/GCSE/2002-05-14-OperandSwap.ll index 51183b8..ca4ac20 100644 --- a/test/Transforms/GCSE/2002-05-14-OperandSwap.ll +++ b/test/Transforms/GCSE/2002-05-14-OperandSwap.ll @@ -1,18 +1,17 @@ ; This entire chain of computation should be optimized away, but ; wasn't because the two multiplies were not detected as being identical. ; -; RUN: llvm-upgrade < %s | llvm-as | opt -gcse -instcombine -dce | \ +; RUN: llvm-as < %s | opt -gcse -instcombine -dce | \ ; RUN: llvm-dis | not grep sub -implementation ; Functions: - -uint "vnum_test4"(uint* %data) { - %idx1 = getelementptr uint* %data, uint 1 - %idx2 = getelementptr uint* %data, uint 3 - %reg1101 = load uint* %idx1 - %reg1111 = load uint* %idx2 - %reg109 = mul uint %reg1101, %reg1111 - %reg108 = mul uint %reg1111, %reg1101 - %reg121 = sub uint %reg108, %reg109 - ret uint %reg121 +define i32 @vnum_test4(i32* %data) { + %idx1 = getelementptr i32* %data, i64 1 ; <i32*> [#uses=1] + %idx2 = getelementptr i32* %data, i64 3 ; <i32*> [#uses=1] + %reg1101 = load i32* %idx1 ; <i32> [#uses=2] + %reg1111 = load i32* %idx2 ; <i32> [#uses=2] + %reg109 = mul i32 %reg1101, %reg1111 ; <i32> [#uses=1] + %reg108 = mul i32 %reg1111, %reg1101 ; <i32> [#uses=1] + %reg121 = sub i32 %reg108, %reg109 ; <i32> [#uses=1] + ret i32 %reg121 } + diff --git a/test/Transforms/GCSE/2002-05-21-NoSharedDominator.ll b/test/Transforms/GCSE/2002-05-21-NoSharedDominator.ll index 2c78695..cf288b8 100644 --- a/test/Transforms/GCSE/2002-05-21-NoSharedDominator.ll +++ b/test/Transforms/GCSE/2002-05-21-NoSharedDominator.ll @@ -1,13 +1,14 @@ ; This testcase shows a bug where an common subexpression exists, but there ; is no shared dominator block that the expression can be hoisted out to. ; -; RUN: llvm-upgrade < %s | llvm-as | opt -gcse | llvm-dis +; RUN: llvm-as < %s | opt -gcse | llvm-dis -int "test"(int %X, int %Y) { - %Z = add int %X, %Y - ret int %Z +define i32 @test(i32 %X, i32 %Y) { + %Z = add i32 %X, %Y ; <i32> [#uses=1] + ret i32 %Z -Unreachable: - %Q = add int %X, %Y - ret int %Q +Unreachable: ; No predecessors! + %Q = add i32 %X, %Y ; <i32> [#uses=1] + ret i32 %Q } + diff --git a/test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll b/test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll index 4ebb66c..d4bdc3f 100644 --- a/test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll +++ b/test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll @@ -1,11 +1,11 @@ ; This testcase shows a bug where an common subexpression exists, but there ; is no shared dominator block that the expression can be hoisted out to. ; -; RUN: llvm-upgrade < %s | llvm-as | opt -load-vn -gcse | llvm-dis | not grep load +; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | not grep load -int %test(int* %P) { - store int 5, int* %P - %Z = load int* %P - ret int %Z +define i32 @test(i32* %P) { + store i32 5, i32* %P + %Z = load i32* %P ; <i32> [#uses=1] + ret i32 %Z } diff --git a/test/Transforms/GCSE/gcsetests.ll b/test/Transforms/GCSE/gcsetests.ll index b866bb7..6fb3057 100644 --- a/test/Transforms/GCSE/gcsetests.ll +++ b/test/Transforms/GCSE/gcsetests.ll @@ -1,57 +1,46 @@ ; Various test cases to ensure basic functionality is working for GCSE -; RUN: llvm-upgrade < %s | llvm-as | opt -gcse - -implementation - -void "testinsts"(int %i, int %j, int* %p) -begin - %A = cast int %i to uint - %B = cast int %i to uint - - %C = shl int %i, ubyte 1 - %D = shl int %i, ubyte 1 - - %E = getelementptr int* %p, long 12 - %F = getelementptr int* %p, long 12 - %G = getelementptr int* %p, long 13 - ret void -end - +; RUN: llvm-as < %s | opt -gcse + +define void @testinsts(i32 %i, i32 %j, i32* %p) { + %A = bitcast i32 %i to i32 ; <i32> [#uses=0] + %B = bitcast i32 %i to i32 ; <i32> [#uses=0] + %C = shl i32 %i, 1 ; <i32> [#uses=0] + %D = shl i32 %i, 1 ; <i32> [#uses=0] + %E = getelementptr i32* %p, i64 12 ; <i32*> [#uses=0] + %F = getelementptr i32* %p, i64 12 ; <i32*> [#uses=0] + %G = getelementptr i32* %p, i64 13 ; <i32*> [#uses=0] + ret void +} ; Test different combinations of domination properties... -void "sameBBtest"(int %i, int %j) -begin - %A = add int %i, %j - %B = add int %i, %j - - %C = xor int %A, -1 - %D = xor int %B, -1 - %E = xor int %j, -1 - - ret void -end - -int "dominates"(int %i, int %j) -begin - %A = add int %i, %j - br label %BB2 - -BB2: - %B = add int %i, %j - ret int %B -end - -int "hascommondominator"(int %i, int %j) -begin - br bool true, label %BB1, label %BB2 - -BB1: - %A = add int %i, %j - ret int %A - -BB2: - %B = add int %i, %j - ret int %B -end +define void @sameBBtest(i32 %i, i32 %j) { + %A = add i32 %i, %j ; <i32> [#uses=1] + %B = add i32 %i, %j ; <i32> [#uses=1] + %C = xor i32 %A, -1 ; <i32> [#uses=0] + %D = xor i32 %B, -1 ; <i32> [#uses=0] + %E = xor i32 %j, -1 ; <i32> [#uses=0] + ret void +} + +define i32 @dominates(i32 %i, i32 %j) { + %A = add i32 %i, %j ; <i32> [#uses=0] + br label %BB2 + +BB2: ; preds = %0 + %B = add i32 %i, %j ; <i32> [#uses=1] + ret i32 %B +} + +define i32 @hascommondominator(i32 %i, i32 %j) { + br i1 true, label %BB1, label %BB2 + +BB1: ; preds = %0 + %A = add i32 %i, %j ; <i32> [#uses=1] + ret i32 %A + +BB2: ; preds = %0 + %B = add i32 %i, %j ; <i32> [#uses=1] + ret i32 %B +} diff --git a/test/Transforms/GCSE/vectorops.ll b/test/Transforms/GCSE/vectorops.ll index 694d9d5..f52688e 100644 --- a/test/Transforms/GCSE/vectorops.ll +++ b/test/Transforms/GCSE/vectorops.ll @@ -1,26 +1,24 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -gcse -instcombine | \ +; RUN: llvm-as < %s | opt -gcse -instcombine | \ ; RUN: llvm-dis | not grep sub -uint %test_extractelement(<4 x uint> %V) { - %R = extractelement <4 x uint> %V, uint 1 - %R2 = extractelement <4 x uint> %V, uint 1 - %V = sub uint %R, %R2 - ret uint %V +define i32 @test_extractelement(<4 x i32> %V) { + %R = extractelement <4 x i32> %V, i32 1 ; <i32> [#uses=1] + %R2 = extractelement <4 x i32> %V, i32 1 ; <i32> [#uses=1] + %V.upgrd.1 = sub i32 %R, %R2 ; <i32> [#uses=1] + ret i32 %V.upgrd.1 } -<4 x uint> %test_insertelement(<4 x uint> %V) { - %R = insertelement <4 x uint> %V, uint 0, uint 0 - %R2 = insertelement <4 x uint> %V, uint 0, uint 0 - %x = sub <4 x uint> %R, %R2 - ret <4 x uint> %x +define <4 x i32> @test_insertelement(<4 x i32> %V) { + %R = insertelement <4 x i32> %V, i32 0, i32 0 ; <<4 x i32>> [#uses=1] + %R2 = insertelement <4 x i32> %V, i32 0, i32 0 ; <<4 x i32>> [#uses=1] + %x = sub <4 x i32> %R, %R2 ; <<4 x i32>> [#uses=1] + ret <4 x i32> %x } -<4 x uint> %test_shufflevector(<4 x uint> %V) { - %R = shufflevector <4 x uint> %V, <4 x uint> %V, - <4 x uint> < uint 1, uint undef, uint 7, uint 2> - %R2 = shufflevector <4 x uint> %V, <4 x uint> %V, - <4 x uint> < uint 1, uint undef, uint 7, uint 2> - %x = sub <4 x uint> %R, %R2 - ret <4 x uint> %x +define <4 x i32> @test_shufflevector(<4 x i32> %V) { + %R = shufflevector <4 x i32> %V, <4 x i32> %V, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x i32>> [#uses=1] + %R2 = shufflevector <4 x i32> %V, <4 x i32> %V, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 > ; <<4 x i32>> [#uses=1] + %x = sub <4 x i32> %R, %R2 ; <<4 x i32>> [#uses=1] + ret <4 x i32> %x } |