summaryrefslogtreecommitdiff
path: root/compiler/vectorise
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2013-02-27 09:57:09 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2013-02-27 09:57:09 +0000
commit47d226544fc3fb11d024740a162f8ae4e1d044c9 (patch)
tree8a024b97de71216f6b3606d3cda7bf16ae1f98a6 /compiler/vectorise
parent7b5e514d85c086be8dc6d938b526c97b6ced56eb (diff)
parent0ee31659afe7a6819f9eb5e233f98e5592f1b439 (diff)
downloadhaskell-tc-arrows.tar.gz
Merge remote-tracking branch 'origin/master' into tc-arrowstc-arrows
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