llvm-6502/lib/CodeGen
Chris Lattner 6656dd1a78 Handle physreg input/outputs. We now compile this:
int %test_cpuid(int %op) {
        %B = alloca int
        %C = alloca int
        %D = alloca int
        %A = call int asm "cpuid", "=eax,==ebx,==ecx,==edx,eax"(int* %B, int* %C, int* %D, int %op)
        %Bv = load int* %B
        %Cv = load int* %C
        %Dv = load int* %D
        %x = add int %A, %Bv
        %y = add int %x, %Cv
        %z = add int %y, %Dv
        ret int %z
}

to this:

_test_cpuid:
        sub %ESP, 16
        mov DWORD PTR [%ESP], %EBX
        mov %EAX, DWORD PTR [%ESP + 20]
        cpuid
        mov DWORD PTR [%ESP + 8], %ECX
        mov DWORD PTR [%ESP + 12], %EBX
        mov DWORD PTR [%ESP + 4], %EDX
        mov %ECX, DWORD PTR [%ESP + 12]
        add %EAX, %ECX
        mov %ECX, DWORD PTR [%ESP + 8]
        add %EAX, %ECX
        mov %ECX, DWORD PTR [%ESP + 4]
        add %EAX, %ECX
        mov %EBX, DWORD PTR [%ESP]
        add %ESP, 16
        ret

... note the proper register allocation.  :)

it is unclear to me why the loads aren't folded into the adds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25827 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-31 02:03:41 +00:00
..
SelectionDAG Handle physreg input/outputs. We now compile this: 2006-01-31 02:03:41 +00:00
AsmPrinter.cpp Print the most trivial inline asms. 2006-01-30 23:00:08 +00:00
BranchFolding.cpp Remove trailing whitespace 2005-04-21 22:36:52 +00:00
DwarfWriter.cpp Using bit size of integers instead of ambiguous "long" et all. 2006-01-27 20:31:25 +00:00
ELFWriter.cpp add these so I can be less naughty 2005-12-28 06:29:02 +00:00
IntrinsicLowering.cpp For PR411: 2006-01-16 21:12:35 +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 Fix build error that is apparently only a warning with some compilers. 2006-01-27 17:31:30 +00:00
MachineFunction.cpp Moving MachineDebugInfo to module level location. 2006-01-04 13:43:56 +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 Always compute max align. 2005-11-06 17:43:20 +00:00
RegAllocLinearScan.cpp Add explicit #includes of <iostream> 2006-01-22 23:41:00 +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 Add explicit #includes of <iostream> 2006-01-22 23:41:00 +00:00
VirtRegMap.h Remove trailing whitespace 2005-04-21 22:36:52 +00:00