diff options
author | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2011-11-25 22:57:40 +1100 |
---|---|---|
committer | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2011-11-25 23:03:01 +1100 |
commit | 18aae18503442276e14a47eabf4786bc7210662e (patch) | |
tree | dfc556a1b047c0031342db4b8e8d429b5f230613 /compiler/vectorise/Vectorise.hs | |
parent | 498467cf44e871a6abdb1e16714f6e91c7b10a80 (diff) | |
download | haskell-18aae18503442276e14a47eabf4786bc7210662e.tar.gz |
Fix newtype wrapper for 'PData[s] (Wrap a)' and fix VECTORISE type and instance pragmas
* Correct usage of new type wrappers from MkId
* 'VECTORISE [SCALAR] type T = S' didn't work correctly across module boundaries
* Clean up 'VECTORISE SCALAR instance'
Diffstat (limited to 'compiler/vectorise/Vectorise.hs')
-rw-r--r-- | compiler/vectorise/Vectorise.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/vectorise/Vectorise.hs b/compiler/vectorise/Vectorise.hs index dc467f5187..cd87868081 100644 --- a/compiler/vectorise/Vectorise.hs +++ b/compiler/vectorise/Vectorise.hs @@ -87,8 +87,8 @@ vectModule guts@(ModGuts { mg_tcs = tycons -- Vectorise all the top level bindings and VECTORISE declarations on imported identifiers -- NB: Need to vectorise the imported bindings first (local bindings may depend on them). - ; let impBinds = [imp_id | Vect imp_id _ <- vect_decls, isGlobalId imp_id] ++ - [imp_id | VectInst True imp_id <- vect_decls, isGlobalId imp_id] + ; let impBinds = [imp_id | Vect imp_id _ <- vect_decls, isGlobalId imp_id] ++ + [imp_id | VectInst imp_id <- vect_decls, isGlobalId imp_id] ; binds_imp <- mapM vectImpBind impBinds ; binds_top <- mapM vectTopBind binds @@ -150,7 +150,7 @@ vectTopBind b@(NonRec var expr) ; (inline, isScalar, expr') <- vectTopRhs [] var expr ; var' <- vectTopBinder var inline expr' ; when isScalar $ - addGlobalScalar var + addGlobalScalarVar var -- We replace the original top-level binding by a value projected from the vectorised -- closure and add any newly created hoisted top-level bindings. @@ -182,7 +182,7 @@ vectTopBind b@(Rec bs) ; if and areScalars then -- (1) Entire recursive group is scalar -- => add all variables to the global set of scalars - do { mapM_ addGlobalScalar vars + do { mapM_ addGlobalScalarVar vars ; return (vars', inlines, exprs', hs) } else -- (2) At least one binding is not scalar @@ -226,7 +226,7 @@ vectImpBind var ; (inline, isScalar, expr') <- vectTopRhs [] var (Var var) ; var' <- vectTopBinder var inline expr' ; when isScalar $ - addGlobalScalar var + addGlobalScalarVar var -- We add any newly created hoisted top-level bindings. ; hs <- takeHoisted @@ -340,7 +340,7 @@ vectTopRhs :: [Var] -- ^ Names of all functions in the rec block , CoreExpr) -- (3) the vectorised right-hand side vectTopRhs recFs var expr = closedV - $ do { globalScalar <- isGlobalScalar var + $ do { globalScalar <- isGlobalScalarVar var ; vectDecl <- lookupVectDecl var ; let isDFun = isDFunId var @@ -385,7 +385,7 @@ tryConvert :: Var -- ^ Name of the original binding (eg @foo@) -> CoreExpr -- ^ The original body of the binding. -> VM CoreExpr tryConvert var vect_var rhs - = do { globalScalar <- isGlobalScalar var + = do { globalScalar <- isGlobalScalarVar var ; if globalScalar then return rhs |