summaryrefslogtreecommitdiff
path: root/compiler/utils/GraphOps.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-01-05 16:57:01 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2015-01-06 14:24:59 +0000
commit39337a6d97c853a88fa61d6b12a04eb8c2e5984f (patch)
tree0dd7051080041ee928429832122b9dd14add302c /compiler/utils/GraphOps.hs
parent32973bf3c2f6fe00e01b44a63ac1904080466938 (diff)
downloadhaskell-39337a6d97c853a88fa61d6b12a04eb8c2e5984f.tar.gz
Remove redundant constraints in the compiler itself, found by -fwarn-redundant-constraints
Diffstat (limited to 'compiler/utils/GraphOps.hs')
-rw-r--r--compiler/utils/GraphOps.hs24
1 files changed, 10 insertions, 14 deletions
diff --git a/compiler/utils/GraphOps.hs b/compiler/utils/GraphOps.hs
index 7bf3ecdffb..804153dad2 100644
--- a/compiler/utils/GraphOps.hs
+++ b/compiler/utils/GraphOps.hs
@@ -76,7 +76,7 @@ addNode k node graph
-- | Delete a node and all its edges from the graph.
-delNode :: (Uniquable k, Outputable k)
+delNode :: (Uniquable k)
=> k -> Graph k cls color -> Maybe (Graph k cls color)
delNode k graph
@@ -119,16 +119,14 @@ modNode f k graph
-- | Get the size of the graph, O(n)
-size :: Uniquable k
- => Graph k cls color -> Int
+size :: Graph k cls color -> Int
size graph
= sizeUFM $ graphMap graph
-- | Union two graphs together.
-union :: Uniquable k
- => Graph k cls color -> Graph k cls color -> Graph k cls color
+union :: Graph k cls color -> Graph k cls color -> Graph k cls color
union graph1 graph2
= Graph
@@ -333,7 +331,7 @@ coalesceGraph' aggressive triv graph kkPairsAcc
-- Nothing if either of the nodes weren't in the graph
coalesceNodes
- :: (Uniquable k, Ord k, Eq cls, Outputable k)
+ :: (Uniquable k, Ord k, Eq cls)
=> Bool -- ^ If True, coalesce nodes even if this might make the graph
-- less colorable (aggressive coalescing)
-> Triv k cls color
@@ -364,7 +362,7 @@ coalesceNodes aggressive triv graph (k1, k2)
= (graph, Nothing)
coalesceNodes_merge
- :: (Uniquable k, Ord k, Eq cls, Outputable k)
+ :: (Uniquable k, Eq cls)
=> Bool
-> Triv k cls color
-> Graph k cls color
@@ -410,7 +408,7 @@ coalesceNodes_merge aggressive triv graph kMin kMax nMin nMax
in coalesceNodes_check aggressive triv graph kMin kMax node
coalesceNodes_check
- :: (Uniquable k, Ord k, Eq cls, Outputable k)
+ :: Uniquable k
=> Bool
-> Triv k cls color
-> Graph k cls color
@@ -483,7 +481,7 @@ freezeNode k
-- right here, and add it to a worklist if known triv\/non-move nodes.
--
freezeOneInGraph
- :: (Uniquable k, Outputable k)
+ :: (Uniquable k)
=> Graph k cls color
-> ( Graph k cls color -- the new graph
, Bool ) -- whether we found a node to freeze
@@ -512,7 +510,7 @@ freezeOneInGraph graph
-- for debugging the iterative allocator.
--
freezeAllInGraph
- :: (Uniquable k, Outputable k)
+ :: (Uniquable k)
=> Graph k cls color
-> Graph k cls color
@@ -525,8 +523,7 @@ freezeAllInGraph graph
-- | Find all the nodes in the graph that meet some criteria
--
scanGraph
- :: Uniquable k
- => (Node k cls color -> Bool)
+ :: (Node k cls color -> Bool)
-> Graph k cls color
-> [Node k cls color]
@@ -611,8 +608,7 @@ checkNode graph node
-- | Slurp out a map of how many nodes had a certain number of conflict neighbours
slurpNodeConflictCount
- :: Uniquable k
- => Graph k cls color
+ :: Graph k cls color
-> UniqFM (Int, Int) -- ^ (conflict neighbours, num nodes with that many conflicts)
slurpNodeConflictCount graph