diff options
author | Chris Lattner <sabre@nondot.org> | 2006-04-14 05:09:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-04-14 05:09:53 +0000 |
commit | b04d993d72e766bdc3589a953ccb227ba225bfe9 (patch) | |
tree | 10f5a5c5f2d4a40e93a44493cfd19043801c4126 /test/Transforms/GCSE | |
parent | b04f7060442dd6379b31a161df3808712fde43b3 (diff) | |
download | external_llvm-b04d993d72e766bdc3589a953ccb227ba225bfe9.zip external_llvm-b04d993d72e766bdc3589a953ccb227ba225bfe9.tar.gz external_llvm-b04d993d72e766bdc3589a953ccb227ba225bfe9.tar.bz2 |
new testcase, vector operations should be CSE'd
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27690 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GCSE')
-rw-r--r-- | test/Transforms/GCSE/vectorops.ll | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Transforms/GCSE/vectorops.ll b/test/Transforms/GCSE/vectorops.ll new file mode 100644 index 0000000..4178960 --- /dev/null +++ b/test/Transforms/GCSE/vectorops.ll @@ -0,0 +1,26 @@ +; RUN: llvm-as < %s | opt -gcse -instcombine -disable-output && +; RUN: llvm-as < %s | opt -gcse -instcombine | 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 +} + +<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 +} + +<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 +} + |