X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fvectorise%2FVectCore.hs;h=c98c03c610a874fa6b24ed6e568c69ecd044db38;hb=b02c901169b35f21ba1f037a4bef8e4ce89abc15;hp=34ffdb7cae37a44bbd594b7f3a107df2293bb510;hpb=db0e973e613bdcf4805a75a42ab735bb205f0373;p=ghc-hetmet.git diff --git a/compiler/vectorise/VectCore.hs b/compiler/vectorise/VectCore.hs index 34ffdb7..c98c03c 100644 --- a/compiler/vectorise/VectCore.hs +++ b/compiler/vectorise/VectCore.hs @@ -4,22 +4,20 @@ module VectCore ( vectorised, lifted, mapVect, + vVarType, + vNonRec, vRec, vVar, vType, vNote, vLet, vLams, vLamsWithoutLC, vVarApps, - vCaseDEFAULT, vCaseProd + vCaseDEFAULT, vInlineMe ) where --- XXX This define is a bit of a hack, and should be done more nicely -#define FAST_STRING_NOT_NEEDED 1 #include "HsVersions.h" import CoreSyn -import CoreUtils ( exprType ) -import DataCon ( DataCon ) +import CoreUtils ( mkInlineMe ) import Type ( Type ) -import Id ( mkWildId ) import Var type Vect a = (a,a) @@ -39,6 +37,9 @@ mapVect f (x,y) = (f x, f y) zipWithVect :: (a -> b -> c) -> Vect a -> Vect b -> Vect c zipWithVect f (x1,y1) (x2,y2) = (f x1 x2, f y1 y2) +vVarType :: VVar -> Type +vVarType = varType . vectorised + vVar :: VVar -> VExpr vVar = mapVect Var @@ -82,13 +83,6 @@ vCaseDEFAULT (vscrut, lscrut) (vbndr, lbndr) vty lty (vbody, lbody) where mkDEFAULT e = [(DEFAULT, [], e)] -vCaseProd :: VExpr -> Type -> Type - -> DataCon -> DataCon -> [Var] -> [VVar] -> VExpr -> VExpr -vCaseProd (vscrut, lscrut) vty lty vdc ldc sh_bndrs bndrs - (vbody,lbody) - = (Case vscrut (mkWildId $ exprType vscrut) vty - [(DataAlt vdc, vbndrs, vbody)], - Case lscrut (mkWildId $ exprType lscrut) lty - [(DataAlt ldc, sh_bndrs ++ lbndrs, lbody)]) - where - (vbndrs, lbndrs) = unzip bndrs +vInlineMe :: VExpr -> VExpr +vInlineMe (vexpr, lexpr) = (mkInlineMe vexpr, mkInlineMe lexpr) +