vectorised, lifted,
mapVect,
+ vVarType,
+
vNonRec, vRec,
vVar, vType, vNote, vLet,
vLams, vLamsWithoutLC, vVarApps,
- vCaseDEFAULT, vCaseProd
+ vCaseDEFAULT
) where
#include "HsVersions.h"
import CoreSyn
-import CoreUtils ( exprType )
-import DataCon ( DataCon )
import Type ( Type )
-import Id ( mkWildId )
import Var
type Vect a = (a,a)
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
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