summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/RegAlloc/Graph/ArchBase.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/nativeGen/RegAlloc/Graph/ArchBase.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/nativeGen/RegAlloc/Graph/ArchBase.hs')
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/ArchBase.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/nativeGen/RegAlloc/Graph/ArchBase.hs b/compiler/nativeGen/RegAlloc/Graph/ArchBase.hs
index 787b1d2f85..c3df743454 100644
--- a/compiler/nativeGen/RegAlloc/Graph/ArchBase.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/ArchBase.hs
@@ -22,6 +22,7 @@ module RegAlloc.Graph.ArchBase (
squeese
) where
import UniqSet
+import UniqFM
import Unique
@@ -88,7 +89,10 @@ worst :: (RegClass -> UniqSet Reg)
worst regsOfClass regAlias neighbors classN classC
= let regAliasS regs = unionManyUniqSets
$ map regAlias
- $ uniqSetToList regs
+ $ nonDetEltsUFM regs
+ -- This is non-deterministic but we do not
+ -- currently support deterministic code-generation.
+ -- See Note [Unique Determinism and code generation]
-- all the regs in classes N, C
regsN = regsOfClass classN
@@ -117,7 +121,8 @@ bound :: (RegClass -> UniqSet Reg)
bound regsOfClass regAlias classN classesC
= let regAliasS regs = unionManyUniqSets
$ map regAlias
- $ uniqSetToList regs
+ $ nonDetEltsUFM regs
+ -- See Note [Unique Determinism and code generation]
regsC_aliases
= unionManyUniqSets
@@ -150,5 +155,5 @@ powersetL = map concat . mapM (\x -> [[],[x]])
-- | powersetLS (list of sets)
powersetLS :: Uniquable a => UniqSet a -> [UniqSet a]
-powersetLS s = map mkUniqSet $ powersetL $ uniqSetToList s
-
+powersetLS s = map mkUniqSet $ powersetL $ nonDetEltsUFM s
+ -- See Note [Unique Determinism and code generation]