diff options
author | Dan Gohman <gohman@apple.com> | 2007-07-10 18:20:44 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2007-07-10 18:20:44 +0000 |
commit | 743d3a754820e64eb779335a2cb2688fd0dd58d5 (patch) | |
tree | 7bfdf74aa0f5ac0565070bba5540da63a82adac5 /test | |
parent | e314eb3255299a995088323384d317be52e743f9 (diff) | |
download | external_llvm-743d3a754820e64eb779335a2cb2688fd0dd58d5.zip external_llvm-743d3a754820e64eb779335a2cb2688fd0dd58d5.tar.gz external_llvm-743d3a754820e64eb779335a2cb2688fd0dd58d5.tar.bz2 |
Change the peep for EXTRACT_VECTOR_ELT of BUILD_PAIR to look for
the new CONCAT_VECTORS node type instead, as that's what legalize
uses now. And add a peep for EXTRACT_VECTOR_ELT of INSERT_VECTOR_ELT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38503 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/peep-vector-extract-concat.ll | 6 | ||||
-rw-r--r-- | test/CodeGen/X86/peep-vector-extract-insert.ll | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGen/X86/peep-vector-extract-concat.ll b/test/CodeGen/X86/peep-vector-extract-concat.ll new file mode 100644 index 0000000..6880fc3 --- /dev/null +++ b/test/CodeGen/X86/peep-vector-extract-concat.ll @@ -0,0 +1,6 @@ +; RUN: llvm-as < %s | llc -march=x86-64 | grep {shufps \$3, %xmm0, %xmm0} + +define float @foo(<8 x float> %a) { + %c = extractelement <8 x float> %a, i32 3 + ret float %c +} diff --git a/test/CodeGen/X86/peep-vector-extract-insert.ll b/test/CodeGen/X86/peep-vector-extract-insert.ll new file mode 100644 index 0000000..9aeb4f1 --- /dev/null +++ b/test/CodeGen/X86/peep-vector-extract-insert.ll @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | llc -march=x86-64 | grep {pxor %xmm0, %xmm0} | wc -l | grep 2 + +define float @foo(<4 x float> %a) { + %b = insertelement <4 x float> %a, float 0.0, i32 3 + %c = extractelement <4 x float> %b, i32 3 + ret float %c +} +define float @bar(float %a) { + %b = insertelement <4 x float> <float 3.4, float 4.5, float 0.0, float 9.2>, float %a, i32 3 + %c = extractelement <4 x float> %b, i32 2 + ret float %c +} |