diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-03-16 16:51:42 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-03-16 16:51:42 +0000 |
commit | 707b6a1ae9660b13cf6f68c7c0ce74017f5981c5 (patch) | |
tree | 166a21d507612d60db40737333ddec5003fc81aa /backend/Coloringaux.ml | |
parent | e44df4563f1cb893ab25b2a8b25d5b83095205be (diff) | |
download | compcert-707b6a1ae9660b13cf6f68c7c0ce74017f5981c5.tar.gz compcert-707b6a1ae9660b13cf6f68c7c0ce74017f5981c5.zip |
Assorted changes to reduce stack and heap requirements when compiling very big functions.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2151 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'backend/Coloringaux.ml')
-rw-r--r-- | backend/Coloringaux.ml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/backend/Coloringaux.ml b/backend/Coloringaux.ml index ddd30944..09ffb8ee 100644 --- a/backend/Coloringaux.ml +++ b/backend/Coloringaux.ml @@ -91,7 +91,7 @@ let name_of_node n = | Some s -> s end | Some(S _), _ -> "fixed-slot" - | None, Some r -> Printf.sprintf "x%ld" (camlint_of_positive r) + | None, Some r -> Printf.sprintf "x%ld" (P.to_int32 r) | None, None -> "unknown-reg" *) @@ -602,12 +602,15 @@ let rec getAlias n = (* Combine two nodes *) let combine u v = - (*i Printf.printf "Combining %s and %s\n" (name_of_node u) (name_of_node v);*) + (*i Printf.printf "Combining %s and %s\n" (name_of_node u) (name_of_node v); *) if v.nstate = FreezeWorklist then DLinkNode.move v freezeWorklist coalescedNodes else DLinkNode.move v spillWorklist coalescedNodes; v.alias <- Some u; - u.movelist <- u.movelist @ v.movelist; + (* Precolored nodes often have big movelists, and if one of [u] and [v] + is precolored, it is []u. So, append [v.movelist] to [u.movelist] + instead of the other way around. *) + u.movelist <- List.rev_append v.movelist u.movelist; u.spillcost <- u.spillcost +. v.spillcost; iterAdjacent (combineEdge u) v; (*r original code using [decrementDegree] is buggy *) enableMoves v; (*r added as per Appel's book erratum *) |