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:
63f16bf
)
Use the right dictionary when calling lengthPA
author
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Thu, 26 Jul 2007 03:12:47 +0000
(
03:12
+0000)
committer
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Thu, 26 Jul 2007 03:12:47 +0000
(
03:12
+0000)
compiler/vectorise/VectUtils.hs
patch
|
blob
|
history
diff --git
a/compiler/vectorise/VectUtils.hs
b/compiler/vectorise/VectUtils.hs
index
0d200a8
..
71ba7a3
100644
(file)
--- a/
compiler/vectorise/VectUtils.hs
+++ b/
compiler/vectorise/VectUtils.hs
@@
-43,7
+43,7
@@
isAnnTypeArg (_, AnnType t) = True
isAnnTypeArg _ = False
isClosureTyCon :: TyCon -> Bool
isAnnTypeArg _ = False
isClosureTyCon :: TyCon -> Bool
-isClosureTyCon tc = tyConUnique tc == closureTyConKey
+isClosureTyCon tc = tyConName tc == closureTyConName
splitClosureTy :: Type -> (Type, Type)
splitClosureTy ty
splitClosureTy :: Type -> (Type, Type)
splitClosureTy ty
@@
-53,6
+53,17
@@
splitClosureTy ty
| otherwise = pprPanic "splitClosureTy" (ppr ty)
| otherwise = pprPanic "splitClosureTy" (ppr ty)
+isPArrayTyCon :: TyCon -> Bool
+isPArrayTyCon tc = tyConName tc == parrayTyConName
+
+splitPArrayTy :: Type -> Type
+splitPArrayTy ty
+ | Just (tc, [arg_ty]) <- splitTyConApp_maybe ty
+ , isPArrayTyCon tc
+ = arg_ty
+
+ | otherwise = pprPanic "splitPArrayTy" (ppr ty)
+
mkPADictType :: Type -> VM Type
mkPADictType ty
= do
mkPADictType :: Type -> VM Type
mkPADictType ty
= do
@@
-118,7
+129,9
@@
paMethod method ty
return $ mkApps (Var fn) [Type ty, dict]
lengthPA :: CoreExpr -> VM CoreExpr
return $ mkApps (Var fn) [Type ty, dict]
lengthPA :: CoreExpr -> VM CoreExpr
-lengthPA x = liftM (`App` x) (paMethod lengthPAVar (exprType x))
+lengthPA x = liftM (`App` x) (paMethod lengthPAVar ty)
+ where
+ ty = splitPArrayTy (exprType x)
replicatePA :: CoreExpr -> CoreExpr -> VM CoreExpr
replicatePA len x = liftM (`mkApps` [len,x])
replicatePA :: CoreExpr -> CoreExpr -> VM CoreExpr
replicatePA len x = liftM (`mkApps` [len,x])