llvm-6502/lib/CodeGen
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
..
SelectionDAG Codegen insertelement with constant insertion points as scalar_to_vector 2006-04-17 19:21:01 +00:00
AsmPrinter.cpp Use "llvm.metadata" section for debug globals. Filter out these globals in the 2006-03-07 22:00:35 +00:00
BranchFolding.cpp Remove trailing whitespace 2005-04-21 22:36:52 +00:00
DwarfWriter.cpp Use existing information. 2006-04-10 23:09:19 +00:00
ELFWriter.cpp add these so I can be less naughty 2005-12-28 06:29:02 +00:00
IntrinsicLowering.cpp Handle new forms of llvm.dbg intrinsics. 2006-03-23 18:06:46 +00:00
LiveInterval.cpp Fix LiveInterval::getOverlapingRanges to take things in the right order 2005-10-21 06:41:30 +00:00
LiveIntervalAnalysis.cpp Add explicit #includes of <iostream> 2006-01-22 23:41:00 +00:00
LiveVariables.cpp Add a LiveVariables::VarInfo::dump method 2006-01-04 05:40:30 +00:00
MachineBasicBlock.cpp Remove trailing whitespace 2005-04-21 22:36:52 +00:00
MachineCodeEmitter.cpp mixed-STL programs are big and nasty :( 2005-12-28 02:44:35 +00:00
MachineDebugInfo.cpp Expand some code with temporary variables to rid ourselves of the warning 2006-04-13 18:29:58 +00:00
MachineFunction.cpp Remove unused method 2006-04-03 21:39:03 +00:00
MachineInstr.cpp Remove trailing whitespace 2005-04-21 22:36:52 +00:00
Makefile Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +00:00
Passes.cpp Alkis agrees that that iterative scan allocator isn't going to be worked on 2005-10-24 04:14:30 +00:00
PHIElimination.cpp Add support for targets (like Alpha) that have terminator instructions which 2006-01-04 07:12:21 +00:00
PhysRegTracker.h Improved PhysRegTracker interface. RegAlloc lazily allocates the register tracker using a std::auto_ptr 2004-02-23 06:10:13 +00:00
PrologEpilogInserter.cpp Foundation for call frame information. 2006-04-07 16:34:46 +00:00
RegAllocLinearScan.cpp Add some comments. 2006-03-25 23:00:56 +00:00
RegAllocLocal.cpp Add explicit #includes of <iostream> 2006-01-22 23:41:00 +00:00
RegAllocSimple.cpp Add explicit #includes of <iostream> 2006-01-22 23:41:00 +00:00
TwoAddressInstructionPass.cpp Add explicit #includes of <iostream> 2006-01-22 23:41:00 +00:00
UnreachableBlockElim.cpp Remove trailing whitespace 2005-04-21 22:36:52 +00:00
VirtRegMap.cpp Fix a bug that Evan exposed with some changes he's making, and that was 2006-02-25 02:17:31 +00:00
VirtRegMap.h Remove trailing whitespace 2005-04-21 22:36:52 +00:00