summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/GraphOps.hs
Commit message (Collapse)AuthorAgeFilesLines
* move generic graph-colouring code into utilSimon Marlow2007-09-121-581/+0
| | | | | It is needed by cmm/StackColor, and hence is needed even when there is no native code generator.
* Don't try and coalesce nodes with themselvesBen.Lippmeier@anu.edu.au2007-09-111-18/+20
|
* Add iterative coalescing to graph coloring allocatorBen.Lippmeier@anu.edu.au2007-09-071-17/+125
| | | | | | | | | | | | | | | | | Iterative coalescing interleaves conservative coalesing with the regular simplify/scan passes. This increases the chance that nodes will be coalesced as they will have a lower degree than at the beginning of simplify. The end result is that more register to register moves will be eliminated in the output code, though the iterative nature of the algorithm makes it slower compared to non-iterative coloring. Use -fregs-iterative for graph coloring allocation with iterative coalescing -fregs-graph for non-iterative coalescing. The plan is for iterative coalescing to be enabled with -O2 and have a quicker, non-iterative algorithm otherwise. The time/benefit tradeoff between iterative and not is still being tuned - optimal graph coloring is NP-hard, afterall..
* Cure space leak in coloring register allocatorBen.Lippmeier@anu.edu.au2007-09-061-4/+3
| | | | | | | | We now do a deep seq on the graph after it is 'built', but before coloring. Without this, the colorer will just force bits of it and the heap will fill up with half evaluated pieces of graph from previous build/spill stages and zillions of apply thunks.
* Refactor MachRegs.trivColorable to do unboxed accumulationBen.Lippmeier@anu.edu.au2007-09-051-2/+2
| | | | | | | | | trivColorable was soaking up total 31% time, 41% alloc when compiling SHA1.lhs with -O2 -fregs-graph on x86. Refactoring to use unboxed accumulators and walk directly over the UniqFM holding the set of conflicts reduces this to 17% time, 6% alloc.
* warning policeBen.Lippmeier@anu.edu.au2007-09-051-10/+3
|
* Do conservative coalescing in register allocatorBen.Lippmeier@anu.edu.au2007-09-031-17/+30
| | | | | | | | | | | | | | | | | | | | Avoid coalescing nodes in the register conflict graph if the new node will not be trivially colorable. Also remove the front end aggressive coalescing pass. For typical Haskell code the graph coloring allocator now does about as well as the linear allocator. For code with a large amount of register pressure it does much better, but takes longer. For SHA1.lhs from darcs on x86 spills reloads reg-reg-moves inserted inserted left in code compile-time linear 1068 1311 229 7.69(s) graph 387 902 340 16.12(s)
* Fix CodingStyle#Warnings URLsIan Lynagh2007-09-041-1/+1
|
* Use OPTIONS rather than OPTIONS_GHC for pragmasIan Lynagh2007-09-031-2/+2
| | | | | | | Older GHCs can't parse OPTIONS_GHC. This also changes the URL referenced for the -w options from WorkingConventions#Warnings to CodingStyle#Warnings for the compiler modules.
* Do aggressive register coalescingBen.Lippmeier@anu.edu.au2007-09-031-16/+142
| | | | Conservative and iterative coalescing come next.
* Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modulesIan Lynagh2007-09-011-0/+8
|
* Add vreg-conflicts and vreg-conflict-lifetimes to drop-asm-statsBen.Lippmeier@anu.edu.au2007-08-201-1/+20
|
* Add graph coloring register allocator.Ben.Lippmeier@anu.edu.au2007-08-141-0/+313
Refactored linear allocator into separate liveness annotation and allocation stages. Added graph coloring allocator, use -fregs-graph to enable. New dump flags are -ddump-asm-native -- output of cmm -> native transform. -ddump-asm-liveness -- code annotated with register liveness info -ddump-asm-coalesce -- output of register move coalescing (this is a separate pass when using the coloring allocator) (this could change in the future) -ddump-asm-regalloc -- code after register allocation -ddump-asm-regalloc-stages -- blocks after each build/spill stage of coloring allocator -ddump-asm-conflicts -- a global register liveness graph in graphviz format The new register allocator will allocate some registers, but it's not quite ready for prime-time yet. The spill code generator needs some work...