NCG: Handle loops in register allocator
authorwolfgang.thaller@gmx.net <unknown>
Sat, 25 Feb 2006 03:14:34 +0000 (03:14 +0000)
committerwolfgang.thaller@gmx.net <unknown>
Sat, 25 Feb 2006 03:14:34 +0000 (03:14 +0000)
commit34f992d36dbdd77fce2092b0363b30f878d22702
tree91f0ec7164882831c88c4ea89c4120c3d6903f0e
parentff16c7e0d3c31e7e14618c8fd59f7a7066135360
NCG: Handle loops in register allocator

Fill in the missing parts in the register allocator so that it can
handle loops.

*) The register allocator now runs in the UniqSuppy monad, as it needs
   to be able to generate unique labels for fixup code blocks.

*) A few functions have been added to RegAllocInfo:
mkRegRegMoveInstr -- generates a good old move instruction
mkBranchInstr     -- used to be MachCodeGen.genBranch
patchJump         -- Change the destination of a jump

*) The register allocator now makes sure that only one spill slot is used
   for each temporary, even if it is spilled and reloaded several times.
   This obviates the need for memory-to-memory moves in fixup code.

LIMITATIONS:

*) The case where the fixup code needs to cyclically permute a group of
   registers is currently unhandled. This will need more work once we come
   accross code where this actually happens.

*) Register allocation for code with loop is probably very inefficient
   (both at compile-time and at run-time).

*) We still cannot compile the RTS via NCG, for various other reasons.
ghc/compiler/nativeGen/AsmCodeGen.lhs
ghc/compiler/nativeGen/MachCodeGen.hs
ghc/compiler/nativeGen/RegAllocInfo.hs
ghc/compiler/nativeGen/RegisterAlloc.hs