X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fvectorise%2FVectType.hs;h=405d6ab2b70300b1e0087a2ac3f38955860eb753;hb=054019538c6ac004d2dc5abd639cf953c8c485ef;hp=0e397ba45718f169aa04a46d6973308ac14aa32e;hpb=49dca6ac4a383c6dd699263f96c2f65959782128;p=ghc-hetmet.git diff --git a/compiler/vectorise/VectType.hs b/compiler/vectorise/VectType.hs index 0e397ba..405d6ab 100644 --- a/compiler/vectorise/VectType.hs +++ b/compiler/vectorise/VectType.hs @@ -263,10 +263,6 @@ mkSum reprs where arity = length reprs -reprProducts :: Repr -> [Repr] -reprProducts (SumRepr { sum_components = rs }) = rs -reprProducts repr = [repr] - reprType :: Repr -> Type reprType (ProdRepr { prod_tycon = tycon, prod_components = tys }) = mkTyConApp tycon tys @@ -276,15 +272,6 @@ reprType (SumRepr { sum_tycon = tycon, sum_components = reprs }) arrReprType :: Repr -> VM Type arrReprType = mkPArrayType . reprType -reprTys :: Repr -> [[Type]] -reprTys (SumRepr { sum_components = prods }) = map prodTys prods -reprTys prod = [prodTys prod] - -prodTys (ProdRepr { prod_components = tys }) = tys - -reprVars :: Repr -> VM [[Var]] -reprVars = mapM (mapM (newLocalVar FSLIT("r"))) . reprTys - arrShapeTys :: Repr -> VM [Type] arrShapeTys (SumRepr {}) = do @@ -297,6 +284,11 @@ arrShapeVars repr = mapM (newLocalVar FSLIT("sh")) =<< arrShapeTys repr replicateShape :: Repr -> CoreExpr -> CoreExpr -> VM [CoreExpr] replicateShape (ProdRepr {}) len _ = return [len] +replicateShape (SumRepr {}) len tag + = do + rep <- builtin replicatePAIntPrimVar + up <- builtin upToPAIntPrimVar + return [len, Var rep `mkApps` [len, tag], Var up `App` len] arrReprElemTys :: Repr -> [[Type]] arrReprElemTys (SumRepr { sum_components = prods })