diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-12-20 10:39:51 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-12-20 10:39:51 +0000 |
commit | d4fe268a416d5b5be6d39a286e06638069390ac5 (patch) | |
tree | e145678da9a86a64e8c2f869236e56fcd0f6c652 | |
parent | 8ed2c113bbc9c43d0993d4e92878eb987c7f3a1c (diff) | |
download | compcert-d4fe268a416d5b5be6d39a286e06638069390ac5.tar.gz compcert-d4fe268a416d5b5be6d39a286e06638069390ac5.zip |
Separate interference graphs for ints and floats, i.e. don't record interference edges between nodes of different types: this is useless and falsifies the heuristics based on node degree.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2076 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
-rw-r--r-- | backend/Coloringaux.ml | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/backend/Coloringaux.ml b/backend/Coloringaux.ml index 1f4e20d5..2fce25e6 100644 --- a/backend/Coloringaux.ml +++ b/backend/Coloringaux.ml @@ -283,21 +283,24 @@ let interfere n1 n2 = let p = if i1 < i2 then (i1, i2) else (i2, i1) in IntPairSet.mem p !adjSet -(* Add an edge to the graph. Assume edge is not in graph already *) +(* Add an edge to the graph. Assume edge is not in graph already. + Do not add edges between nodes of different types. *) let addEdge n1 n2 = - (*i Printf.printf " %s -- %s;\n" (name_of_node n1) (name_of_node n2); *) - assert (n1 != n2 && not (interfere n1 n2)); - let i1 = n1.ident and i2 = n2.ident in - let p = if i1 < i2 then (i1, i2) else (i2, i1) in - adjSet := IntPairSet.add p !adjSet; - if n1.nstate <> Colored then begin - n1.adjlist <- n2 :: n1.adjlist; - n1.degree <- 1 + n1.degree - end; - if n2.nstate <> Colored then begin - n2.adjlist <- n1 :: n2.adjlist; - n2.degree <- 1 + n2.degree + if n1.typ = n2.typ then begin + (*i Printf.printf " %s -- %s;\n" (name_of_node n1) (name_of_node n2); *) + assert (n1 != n2 && not (interfere n1 n2)); + let i1 = n1.ident and i2 = n2.ident in + let p = if i1 < i2 then (i1, i2) else (i2, i1) in + adjSet := IntPairSet.add p !adjSet; + if n1.nstate <> Colored then begin + n1.adjlist <- n2 :: n1.adjlist; + n1.degree <- 1 + n1.degree + end; + if n2.nstate <> Colored then begin + n2.adjlist <- n1 :: n2.adjlist; + n2.degree <- 1 + n2.degree + end end (* Apply the given function to the relevant adjacent nodes of a node *) |