projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move control flow optimization to CmmCPS.
[ghc-hetmet.git]
/
compiler
/
hsSyn
/
HsDecls.lhs
diff --git
a/compiler/hsSyn/HsDecls.lhs
b/compiler/hsSyn/HsDecls.lhs
index
c05f26a
..
3712cbd
100644
(file)
--- a/
compiler/hsSyn/HsDecls.lhs
+++ b/
compiler/hsSyn/HsDecls.lhs
@@
-28,6
+28,7
@@
module HsDecls (
collectRuleBndrSigTys,
-- ** @VECTORISE@ declarations
VectDecl(..), LVectDecl,
collectRuleBndrSigTys,
-- ** @VECTORISE@ declarations
VectDecl(..), LVectDecl,
+ lvectDeclName,
-- ** @default@ declarations
DefaultDecl(..), LDefaultDecl,
-- ** Top-level template haskell splice
-- ** @default@ declarations
DefaultDecl(..), LDefaultDecl,
-- ** Top-level template haskell splice
@@
-1005,10
+1006,11
@@
instance OutputableBndr name => Outputable (RuleBndr name) where
%* *
%************************************************************************
%* *
%************************************************************************
-A vectorisation pragma
+A vectorisation pragma, one of
- {-# VECTORISE f = closure1 g (scalar_map g) #-} OR
+ {-# VECTORISE f = closure1 g (scalar_map g) #-}
{-# VECTORISE SCALAR f #-}
{-# VECTORISE SCALAR f #-}
+ {-# NOVECTORISE f #-}
Note [Typechecked vectorisation pragmas]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note [Typechecked vectorisation pragmas]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@
-1029,14
+1031,23
@@
data VectDecl name
= HsVect
(Located name)
(Maybe (LHsExpr name)) -- 'Nothing' => SCALAR declaration
= HsVect
(Located name)
(Maybe (LHsExpr name)) -- 'Nothing' => SCALAR declaration
+ | HsNoVect
+ (Located name)
deriving (Data, Typeable)
deriving (Data, Typeable)
-
+
+lvectDeclName :: LVectDecl name -> name
+lvectDeclName (L _ (HsVect (L _ name) _)) = name
+lvectDeclName (L _ (HsNoVect (L _ name))) = name
+
instance OutputableBndr name => Outputable (VectDecl name) where
instance OutputableBndr name => Outputable (VectDecl name) where
- ppr (HsVect v rhs)
+ ppr (HsVect v Nothing)
+ = sep [text "{-# VECTORISE SCALAR" <+> ppr v <+> text "#-}" ]
+ ppr (HsVect v (Just rhs))
= sep [text "{-# VECTORISE" <+> ppr v,
= sep [text "{-# VECTORISE" <+> ppr v,
- nest 4 (case rhs of
- Nothing -> text "SCALAR #-}"
- Just rhs -> pprExpr (unLoc rhs) <+> text "#-}") ]
+ nest 4 $
+ pprExpr (unLoc rhs) <+> text "#-}" ]
+ ppr (HsNoVect v)
+ = sep [text "{-# NOVECTORISE" <+> ppr v <+> text "#-}" ]
\end{code}
%************************************************************************
\end{code}
%************************************************************************