diff options
author | Bartosz Nitka <niteria@gmail.com> | 2016-06-07 07:19:30 -0700 |
---|---|---|
committer | Bartosz Nitka <niteria@gmail.com> | 2016-06-07 08:23:37 -0700 |
commit | 5db93d2e567ecb7169b06097244361327ec1eb2a (patch) | |
tree | 5032e35eaf6895baf9a0bf5f6a43fe7a21a9120a /compiler/vectorise | |
parent | 3b698e8938ccfa3e0dbf192abf4984d6937a196e (diff) | |
download | haskell-5db93d2e567ecb7169b06097244361327ec1eb2a.tar.gz |
Make vectInfoParallelVars a DVarSet
We dump it in the interface file, so we need to do it in a
deterministic order. I haven't seen any problems with this
during my testing, but that's probably because it's unused.
Test Plan: ./validate
Reviewers: simonmar, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2313
GHC Trac Issues: #4012
Diffstat (limited to 'compiler/vectorise')
-rw-r--r-- | compiler/vectorise/Vectorise/Env.hs | 7 | ||||
-rw-r--r-- | compiler/vectorise/Vectorise/Exp.hs | 4 | ||||
-rw-r--r-- | compiler/vectorise/Vectorise/Monad.hs | 2 | ||||
-rw-r--r-- | compiler/vectorise/Vectorise/Monad/Global.hs | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/compiler/vectorise/Vectorise/Env.hs b/compiler/vectorise/Vectorise/Env.hs index c3b0ee1b02..e4ab79eed7 100644 --- a/compiler/vectorise/Vectorise/Env.hs +++ b/compiler/vectorise/Vectorise/Env.hs @@ -30,6 +30,7 @@ import NameSet import Name import NameEnv import FastString +import UniqDFM import Data.Maybe @@ -86,7 +87,7 @@ data GlobalEnv -- ^Mapping from global variables to their vectorised versions — aka the /vectorisation -- map/. - , global_parallel_vars :: VarSet + , global_parallel_vars :: DVarSet -- ^The domain of 'global_vars'. -- -- This information is not redundant as it is impossible to extract the domain from a @@ -208,8 +209,8 @@ modVectInfo env mg_ids mg_tyCons vectDecls info { vectInfoVar = mk_env ids (global_vars env) , vectInfoTyCon = mk_env tyCons (global_tycons env) , vectInfoDataCon = mk_env dataCons (global_datacons env) - , vectInfoParallelVars = (global_parallel_vars env `minusVarSet` vectInfoParallelVars info) - `intersectVarSet` (mkVarSet ids) + , vectInfoParallelVars = (global_parallel_vars env `minusDVarSet` vectInfoParallelVars info) + `udfmIntersectUFM` (mkVarSet ids) , vectInfoParallelTyCons = global_parallel_tycons env `minusNameSet` vectInfoParallelTyCons info } where diff --git a/compiler/vectorise/Vectorise/Exp.hs b/compiler/vectorise/Vectorise/Exp.hs index 368d99a1e3..770adb77de 100644 --- a/compiler/vectorise/Vectorise/Exp.hs +++ b/compiler/vectorise/Vectorise/Exp.hs @@ -1039,13 +1039,13 @@ vectAvoidInfo :: VarSet -> CoreExprWithFVs -> VM CoreExprWithVectInfo vectAvoidInfo pvs ce@(_, AnnVar v) = do { gpvs <- globalParallelVars - ; vi <- if v `elemVarSet` pvs || v `elemVarSet` gpvs + ; vi <- if v `elemVarSet` pvs || v `elemDVarSet` gpvs then return VIParr else vectAvoidInfoTypeOf ce ; viTrace ce vi [] ; when (vi == VIParr) $ traceVt " reason:" $ if v `elemVarSet` pvs then text "local" else - if v `elemVarSet` gpvs then text "global" else text "parallel type" + if v `elemDVarSet` gpvs then text "global" else text "parallel type" ; return ((fvs, vi), AnnVar v) } diff --git a/compiler/vectorise/Vectorise/Monad.hs b/compiler/vectorise/Vectorise/Monad.hs index 4e7ee168b7..7c04dfe0b1 100644 --- a/compiler/vectorise/Vectorise/Monad.hs +++ b/compiler/vectorise/Vectorise/Monad.hs @@ -185,7 +185,7 @@ dumpVar dflags var addGlobalParallelVar :: Var -> VM () addGlobalParallelVar var = do { traceVt "addGlobalParallelVar" (ppr var) - ; updGEnv $ \env -> env{global_parallel_vars = extendVarSet (global_parallel_vars env) var} + ; updGEnv $ \env -> env{global_parallel_vars = extendDVarSet (global_parallel_vars env) var} } -- |Mark the given type constructor as parallel — i.e., its values might embed parallel arrays. diff --git a/compiler/vectorise/Vectorise/Monad/Global.hs b/compiler/vectorise/Vectorise/Monad/Global.hs index 0d3e0c0c91..cd642f37b6 100644 --- a/compiler/vectorise/Vectorise/Monad/Global.hs +++ b/compiler/vectorise/Vectorise/Monad/Global.hs @@ -135,7 +135,7 @@ lookupVectDecl var -- |Get the set of global parallel variables. -- -globalParallelVars :: VM VarSet +globalParallelVars :: VM DVarSet globalParallelVars = readGEnv global_parallel_vars -- |Get the set of all parallel type constructors (those that may embed parallelism) including both |