llvm-6502/lib/CodeGen/SelectionDAG
Chris Lattner 8d5a894501 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27765 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-17 19:21:01 +00:00
..
DAGCombiner.cpp Canonicalize vvector_shuffle(x,x) -> vvector_shuffle(x,undef) to enable patterns 2006-04-08 05:34:25 +00:00
LegalizeDAG.cpp Codegen insertelement with constant insertion points as scalar_to_vector 2006-04-17 19:21:01 +00:00
Makefile Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +00:00
ScheduleDAG.cpp fix spello 2006-03-24 07:15:07 +00:00
ScheduleDAGList.cpp Don't advance the hazard recognizer when there are no hazards and no instructions 2006-03-12 09:01:41 +00:00
ScheduleDAGSimple.cpp Move simple-selector-specific types to the simple selector. 2006-03-10 07:51:18 +00:00
SelectionDAG.cpp Make these predicates return true for bit_convert(buildvector)'s as well as 2006-04-15 23:38:00 +00:00
SelectionDAGISel.cpp Implement support for the formal_arguments node. To get this, targets shouldcustom legalize it and remove their XXXTargetLowering::LowerArguments overload 2006-04-12 16:20:43 +00:00
SelectionDAGPrinter.cpp print arbitrary constant pool entries 2006-03-05 09:38:03 +00:00
TargetLowering.cpp relax assertion 2006-04-02 06:19:46 +00:00