X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fvectorise%2FVectCore.hs;h=d651526ddf33c50f9a1356db4b803d84980e5a50;hp=c78f8cad16fe56c46d661a5e3cc8e90ef827e5a4;hb=72462499b891d5779c19f3bda03f96e24f9554ae;hpb=7e8cba32c6f045dde3db8a9ddc9831ec8ab4ed43 diff --git a/compiler/vectorise/VectCore.hs b/compiler/vectorise/VectCore.hs index c78f8ca..d651526 100644 --- a/compiler/vectorise/VectCore.hs +++ b/compiler/vectorise/VectCore.hs @@ -4,21 +4,21 @@ module VectCore ( vectorised, lifted, mapVect, + vVarType, + vNonRec, vRec, vVar, vType, vNote, vLet, vLams, vLamsWithoutLC, vVarApps, - vCaseDEFAULT, vCaseProd + vCaseDEFAULT, vInlineMe ) where #include "HsVersions.h" import CoreSyn -import MkCore ( mkWildCase ) -import CoreUtils ( exprType ) -import DataCon ( DataCon ) import Type ( Type ) import Var +import Outputable type Vect a = (a,a) type VVar = Vect Var @@ -37,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 @@ -80,13 +83,8 @@ 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) - = (mkWildCase vscrut (exprType vscrut) vty - [(DataAlt vdc, vbndrs, vbody)], - mkWildCase lscrut (exprType lscrut) lty - [(DataAlt ldc, sh_bndrs ++ lbndrs, lbody)]) - where - (vbndrs, lbndrs) = unzip bndrs +vInlineMe :: VExpr -> VExpr +vInlineMe (vexpr, lexpr) = (mkInlineMe vexpr, mkInlineMe lexpr) + +mkInlineMe :: CoreExpr -> CoreExpr +mkInlineMe = pprTrace "VectCore.mkInlineMe" (text "Roman: need to replace mkInlineMe with an InlineRule somehow")