summaryrefslogtreecommitdiff
path: root/compiler/vectorise
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-07-05 06:23:54 -0700
committerBartosz Nitka <niteria@gmail.com>2016-07-05 07:31:34 -0700
commit55e43a6f9ef64cf31faca350f8bf86f5f5acb36a (patch)
treee33ba94bd8c4085284c4f9da8e13b9d3a0aeb41c /compiler/vectorise
parent1267048e1785eb4f05834ec56e30107cda4828bd (diff)
downloadhaskell-55e43a6f9ef64cf31faca350f8bf86f5f5acb36a.tar.gz
Use DVarEnv for vectInfoVar
This makes sure that we don't introduce unnecessary nondeterminism from vectorization. Also updates dph submodule to reflect the change in types. GHC Trac: #4012
Diffstat (limited to 'compiler/vectorise')
-rw-r--r--compiler/vectorise/Vectorise/Env.hs16
1 files changed, 9 insertions, 7 deletions
diff --git a/compiler/vectorise/Vectorise/Env.hs b/compiler/vectorise/Vectorise/Env.hs
index e4ab79eed7..faaad69ba7 100644
--- a/compiler/vectorise/Vectorise/Env.hs
+++ b/compiler/vectorise/Vectorise/Env.hs
@@ -149,7 +149,7 @@ initGlobalEnv :: Bool
initGlobalEnv vectAvoid info vectDecls instEnvs famInstEnvs
= GlobalEnv
{ global_vect_avoid = vectAvoid
- , global_vars = mapVarEnv snd $ vectInfoVar info
+ , global_vars = mapVarEnv snd $ udfmToUfm $ vectInfoVar info
, global_vect_decls = mkVarEnv vects
, global_parallel_vars = vectInfoParallelVars info
, global_parallel_tycons = vectInfoParallelTyCons info
@@ -206,7 +206,7 @@ setPRFunsEnv ps genv = genv { global_pr_funs = mkNameEnv ps }
modVectInfo :: GlobalEnv -> [Id] -> [TyCon] -> [CoreVect]-> VectInfo -> VectInfo
modVectInfo env mg_ids mg_tyCons vectDecls info
= info
- { vectInfoVar = mk_env ids (global_vars env)
+ { vectInfoVar = mk_denv ids (global_vars env)
, vectInfoTyCon = mk_env tyCons (global_tycons env)
, vectInfoDataCon = mk_env dataCons (global_datacons env)
, vectInfoParallelVars = (global_parallel_vars env `minusDVarSet` vectInfoParallelVars info)
@@ -228,8 +228,10 @@ modVectInfo env mg_ids mg_tyCons vectDecls info
, cls <- maybeToList . tyConClass_maybe $ tycon]
-- Produce an entry for every declaration that is mentioned in the domain of the 'inspectedEnv'
- mk_env decls inspectedEnv
- = mkNameEnv [(name, (decl, to))
- | decl <- decls
- , let name = getName decl
- , Just to <- [lookupNameEnv inspectedEnv name]]
+ mk_env decls inspectedEnv = mkNameEnv $ mk_assoc_env decls inspectedEnv
+ mk_denv decls inspectedEnv = listToUDFM $ mk_assoc_env decls inspectedEnv
+ mk_assoc_env decls inspectedEnv
+ = [(name, (decl, to))
+ | decl <- decls
+ , let name = getName decl
+ , Just to <- [lookupNameEnv inspectedEnv name]]