summaryrefslogtreecommitdiff
path: root/compiler/utils/GraphColor.hs
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-07-01 04:58:39 -0700
committerBartosz Nitka <niteria@gmail.com>2016-07-01 05:44:27 -0700
commitcbfeff4b3caade8092c13f0f71371e6525ece9ac (patch)
tree300101b60cea80cfd2640e4db74efdaa489b7cd9 /compiler/utils/GraphColor.hs
parent6377757918c1e7f63638d6f258cad8d5f02bb6a7 (diff)
downloadhaskell-cbfeff4b3caade8092c13f0f71371e6525ece9ac.tar.gz
Remove uniqSetToList
This documents nondeterminism in code generation and removes the nondeterministic ufmToList function. In the future someone will have to use nonDetEltsUFM (with proper explanation) or pprUFM.
Diffstat (limited to 'compiler/utils/GraphColor.hs')
-rw-r--r--compiler/utils/GraphColor.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/utils/GraphColor.hs b/compiler/utils/GraphColor.hs
index 41b367692a..8a1cdd0952 100644
--- a/compiler/utils/GraphColor.hs
+++ b/compiler/utils/GraphColor.hs
@@ -309,8 +309,9 @@ selectColor colors graph u
Just nsConflicts
= sequence
$ map (lookupNode graph)
- $ uniqSetToList
+ $ nonDetEltsUFM
$ nodeConflicts node
+ -- See Note [Unique Determinism and code generation]
colors_conflict = mkUniqSet
$ catMaybes
@@ -355,7 +356,8 @@ selectColor colors graph u
-- it wasn't a preference, but it was still ok
| not $ isEmptyUniqSet colors_ok
- , c : _ <- uniqSetToList colors_ok
+ , c : _ <- nonDetEltsUFM colors_ok
+ -- See Note [Unique Determinism and code generation]
= Just c
-- no colors were available for us this time.