projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a41bfc0
)
Treat some standard data cons specially during vectorisation
author
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Thu, 13 Dec 2007 03:48:55 +0000
(
03:48
+0000)
committer
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Thu, 13 Dec 2007 03:48:55 +0000
(
03:48
+0000)
This is a temporary hack which allows us to vectorise literals.
compiler/vectorise/Vectorise.hs
patch
|
blob
|
history
diff --git
a/compiler/vectorise/Vectorise.hs
b/compiler/vectorise/Vectorise.hs
index
1b7bca0
..
80c896c
100644
(file)
--- a/
compiler/vectorise/Vectorise.hs
+++ b/
compiler/vectorise/Vectorise.hs
@@
-243,6
+243,17
@@
vectExpr e@(_, AnnApp _ arg)
where
(fn, tys) = collectAnnTypeArgs e
+vectExpr (_, AnnApp (_, AnnVar v) (_, AnnLit lit))
+ | Just con <- isDataConId_maybe v
+ , is_special_con con
+ = do
+ let vexpr = App (Var v) (Lit lit)
+ lexpr <- liftPA vexpr
+ return (vexpr, lexpr)
+ where
+ is_special_con con = con `elem` [intDataCon, floatDataCon, doubleDataCon]
+
+
vectExpr (_, AnnApp fn arg)
= do
arg_ty' <- vectType arg_ty