summaryrefslogtreecommitdiff
path: root/compiler/utils/GraphOps.hs
diff options
context:
space:
mode:
authorBen.Lippmeier@anu.edu.au <unknown>2009-04-18 08:22:53 +0000
committerBen.Lippmeier@anu.edu.au <unknown>2009-04-18 08:22:53 +0000
commit2d4952d959b3056cff6de9d1663c621d2b4efc70 (patch)
treef25cd55c406207f49b1b763c7dc835f35e4e67ce /compiler/utils/GraphOps.hs
parent5581ce5202d9d84caada8e914ab7c848c6476a0f (diff)
downloadhaskell-2d4952d959b3056cff6de9d1663c621d2b4efc70.tar.gz
Fix #3170: Allow coalescing of the same node during register allocation.
The x86 code generator sometimes generates nop moves like movl %vI_a %vI_a, but we'll just ignore them for coalescing purposes instead of emitting an error. It shouldn't hurt anything.
Diffstat (limited to 'compiler/utils/GraphOps.hs')
-rw-r--r--compiler/utils/GraphOps.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/utils/GraphOps.hs b/compiler/utils/GraphOps.hs
index 8183e0b299..17c14d0925 100644
--- a/compiler/utils/GraphOps.hs
+++ b/compiler/utils/GraphOps.hs
@@ -335,6 +335,9 @@ coalesceNodes aggressive triv graph (k1, k2)
, not $ elementOfUniqSet kMin (nodeConflicts nMax)
, not $ elementOfUniqSet kMax (nodeConflicts nMin)
+ -- can't coalesce the same node
+ , nodeId nMin /= nodeId nMax
+
= coalesceNodes_merge aggressive triv graph kMin kMax nMin nMax
-- don't do the coalescing after all
@@ -350,9 +353,6 @@ coalesceNodes_merge aggressive triv graph kMin kMax nMin nMax
| not (isNothing (nodeColor nMin) && isNothing (nodeColor nMax))
= error "GraphOps.coalesceNodes: can't coalesce colored nodes."
- | nodeId nMin == nodeId nMax
- = error "GraphOps.coalesceNodes: can't coalesce the same node."
-
---
| otherwise
= let