diff options
author | Bartosz Nitka <niteria@gmail.com> | 2016-07-05 06:23:54 -0700 |
---|---|---|
committer | Bartosz Nitka <niteria@gmail.com> | 2016-07-05 07:31:34 -0700 |
commit | 55e43a6f9ef64cf31faca350f8bf86f5f5acb36a (patch) | |
tree | e33ba94bd8c4085284c4f9da8e13b9d3a0aeb41c /compiler/main/TidyPgm.hs | |
parent | 1267048e1785eb4f05834ec56e30107cda4828bd (diff) | |
download | haskell-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/main/TidyPgm.hs')
-rw-r--r-- | compiler/main/TidyPgm.hs | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/compiler/main/TidyPgm.hs b/compiler/main/TidyPgm.hs index c02c786ed5..915cd12450 100644 --- a/compiler/main/TidyPgm.hs +++ b/compiler/main/TidyPgm.hs @@ -57,7 +57,7 @@ import Maybes import UniqSupply import ErrUtils (Severity(..)) import Outputable -import UniqFM +import UniqDFM import SrcLoc import qualified ErrUtils as Err @@ -484,17 +484,14 @@ tidyVectInfo (_, var_env) info@(VectInfo { vectInfoVar = vars where -- we only export mappings whose domain and co-domain is exported (otherwise, the iface is -- inconsistent) - tidy_vars = mkVarEnv [ (tidy_var, (tidy_var, tidy_var_v)) - | (var, var_v) <- nonDetEltsUFM vars - -- It's OK to use nonDetEltsUFM here because we - -- immediately forget the ordering by creating - -- a new env - , let tidy_var = lookup_var var - tidy_var_v = lookup_var var_v - , isExternalId tidy_var && isExportedId tidy_var - , isExternalId tidy_var_v && isExportedId tidy_var_v - , isDataConWorkId var || not (isImplicitId var) - ] + tidy_vars = mkDVarEnv [ (tidy_var, (tidy_var, tidy_var_v)) + | (var, var_v) <- eltsUDFM vars + , let tidy_var = lookup_var var + tidy_var_v = lookup_var var_v + , isExternalId tidy_var && isExportedId tidy_var + , isExternalId tidy_var_v && isExportedId tidy_var_v + , isDataConWorkId var || not (isImplicitId var) + ] tidy_parallelVars = mkDVarSet [ tidy_var @@ -625,7 +622,7 @@ chooseExternalIds :: HscEnv -> [CoreBind] -> [CoreBind] -> [CoreRule] - -> VarEnv (Var, Var) + -> DVarEnv (Var, Var) -> IO (UnfoldEnv, TidyOccEnv) -- Step 1 from the notes above @@ -662,9 +659,7 @@ chooseExternalIds hsc_env mod omit_prags expose_all binds implicit_binds imp_id_ isJust $ collectStaticPtrSatArgs e rule_rhs_vars = mapUnionVarSet ruleRhsFreeVars imp_id_rules - vect_var_vs = mkVarSet [var_v | (var, var_v) <- nonDetEltsUFM vect_vars, isGlobalId var] - -- It's OK to use nonDetEltsUFM here because we immediately forget the - -- ordering by creating a set + vect_var_vs = mkVarSet [var_v | (var, var_v) <- eltsUDFM vect_vars, isGlobalId var] flatten_binds = flattenBinds binds binders = map fst flatten_binds @@ -716,7 +711,7 @@ chooseExternalIds hsc_env mod omit_prags expose_all binds implicit_binds imp_id_ | otherwise = addExternal expose_all refined_id -- add vectorised version if any exists - new_ids' = new_ids ++ maybeToList (fmap snd $ lookupVarEnv vect_vars idocc) + new_ids' = new_ids ++ maybeToList (fmap snd $ lookupDVarEnv vect_vars idocc) -- 'idocc' is an *occurrence*, but we need to see the -- unfolding in the *definition*; so look up in binder_set |