summaryrefslogtreecommitdiff
path: root/compiler/vectorise
diff options
context:
space:
mode:
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>2013-02-18 17:48:43 +1100
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>2013-02-19 09:55:03 +1100
commit767663b583b185bdf375799d8d34b340dada930e (patch)
tree61b0fb485e25932dc7122397768dc905754d20d8 /compiler/vectorise
parentdca3a2895d9df67c6bd86d94c6a5c8f53644b106 (diff)
downloadhaskell-767663b583b185bdf375799d8d34b340dada930e.tar.gz
DPH: free top-level variables don't prevent encapsulation
Diffstat (limited to 'compiler/vectorise')
-rw-r--r--compiler/vectorise/Vectorise/Exp.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/vectorise/Vectorise/Exp.hs b/compiler/vectorise/Vectorise/Exp.hs
index 706fc85166..fb0c148610 100644
--- a/compiler/vectorise/Vectorise/Exp.hs
+++ b/compiler/vectorise/Vectorise/Exp.hs
@@ -1211,12 +1211,17 @@ maybeParrTy ty
maybeParrTy (ForAllTy _ ty) = maybeParrTy ty
maybeParrTy _ = return False
--- Are the types of all variables in the 'Scalar' class?
+-- Are the types of all variables in the 'Scalar' class or toplevel variables?
+--
+-- NB: 'liftSimple' does not abstract over toplevel variables.
--
allScalarVarType :: [Var] -> VM Bool
-allScalarVarType vs = and <$> mapM (isScalar . varType) vs
+allScalarVarType vs = and <$> mapM isScalarOrToplevel vs
+ where
+ isScalarOrToplevel v | isToplevel v = return True
+ | otherwise = isScalar (varType v)
--- Are the types of all variables in the set in the 'Scalar' class?
+-- Are the types of all variables in the set in the 'Scalar' class or toplevel variables?
--
allScalarVarTypeSet :: VarSet -> VM Bool
allScalarVarTypeSet = allScalarVarType . varSetElems