aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-04-17 19:21:01 +0000
committerChris Lattner <sabre@nondot.org>2006-04-17 19:21:01 +0000
commit326870b40b7bdff2ff0046000b29737b3ca69f5b (patch)
tree9fdfb98faf28306563b24de1acdc3bf4a68bc92e /llvm/lib/CodeGen/MachineInstr.cpp
parente54133cfba3c6de494b92f61e738104c59a1eac2 (diff)
downloadllvm-326870b40b7bdff2ff0046000b29737b3ca69f5b.zip
llvm-326870b40b7bdff2ff0046000b29737b3ca69f5b.tar.gz
llvm-326870b40b7bdff2ff0046000b29737b3ca69f5b.tar.bz2
Codegen insertelement with constant insertion points as scalar_to_vector
and a shuffle. For this: void %test2(<4 x float>* %F, float %f) { %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2] %tmp3 = add <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1] %tmp2 = insertelement <4 x float> %tmp3, float %f, uint 2 ; <<4 x float>> [#uses=2] %tmp6 = add <4 x float> %tmp2, %tmp2 ; <<4 x float>> [#uses=1] store <4 x float> %tmp6, <4 x float>* %F ret void } we now get this on X86 (which will get better): _test2: movl 4(%esp), %eax movaps (%eax), %xmm0 addps %xmm0, %xmm0 movaps %xmm0, %xmm1 shufps $3, %xmm1, %xmm1 movaps %xmm0, %xmm2 shufps $1, %xmm2, %xmm2 unpcklps %xmm1, %xmm2 movss 8(%esp), %xmm1 unpcklps %xmm1, %xmm0 unpcklps %xmm2, %xmm0 addps %xmm0, %xmm0 movaps %xmm0, (%eax) ret instead of: _test2: subl $28, %esp movl 32(%esp), %eax movaps (%eax), %xmm0 addps %xmm0, %xmm0 movaps %xmm0, (%esp) movss 36(%esp), %xmm0 movss %xmm0, 8(%esp) movaps (%esp), %xmm0 addps %xmm0, %xmm0 movaps %xmm0, (%eax) addl $28, %esp ret llvm-svn: 27765
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
0 files changed, 0 insertions, 0 deletions