summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-07-05 09:42:44 -0700
committerBartosz Nitka <niteria@gmail.com>2016-07-05 09:44:06 -0700
commit27fc75b2fea014006964eafe53b3ae17e058d75b (patch)
treed02161a3aacb7495564553714a53c43c2aabc03a
parent6cedef01e00e95517a546a72592ba6ff07bac605 (diff)
downloadhaskell-27fc75b2fea014006964eafe53b3ae17e058d75b.tar.gz
Document codegen nondeterminism
We don't care about bit-for-bit reproducibility, so I'm just documenting this as a possible source. GHC Trac: #4012
-rw-r--r--compiler/stgSyn/CoreToStg.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/stgSyn/CoreToStg.hs b/compiler/stgSyn/CoreToStg.hs
index 273cbdb9c1..2d9ca8cb2a 100644
--- a/compiler/stgSyn/CoreToStg.hs
+++ b/compiler/stgSyn/CoreToStg.hs
@@ -43,6 +43,7 @@ import DynFlags
import ForeignCall
import Demand ( isUsedOnce )
import PrimOp ( PrimCall(..) )
+import UniqFM
import Data.Maybe (isJust)
import Control.Monad (liftM, ap)
@@ -1002,7 +1003,10 @@ lookupFVInfo fvs id
-- Non-top-level things only, both type variables and ids
getFVs :: FreeVarsInfo -> [Var]
-getFVs fvs = [id | (id, how_bound, _) <- varEnvElts fvs,
+getFVs fvs = [id | (id, how_bound, _) <- nonDetEltsUFM fvs,
+ -- It's OK to use nonDetEltsUFM here because we're not aiming for
+ -- bit-for-bit determinism.
+ -- See Note [Unique Determinism and code generation]
not (topLevelBound how_bound) ]
getFVSet :: FreeVarsInfo -> VarSet