X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fvectorise%2FVectorise.hs;h=6fd6190265a4014486baa0cdf0914b03633184be;hp=d074092c0f7e53b926f057189b97e5ad1a320089;hb=ad94d40948668032189ad22a0ad741ac1f645f50;hpb=835609b97d5f392ece196cf2c4b069ffcc4b789f diff --git a/compiler/vectorise/Vectorise.hs b/compiler/vectorise/Vectorise.hs index d074092..6fd6190 100644 --- a/compiler/vectorise/Vectorise.hs +++ b/compiler/vectorise/Vectorise.hs @@ -1,3 +1,10 @@ +{-# OPTIONS -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/CodingStyle#Warnings +-- for details + module Vectorise( vectorise ) where @@ -45,19 +52,6 @@ import Outputable import FastString import Control.Monad ( liftM, liftM2, zipWithM, mapAndUnzipM ) -builtin_PAs :: [(Name, Module, FastString)] -builtin_PAs = [ - mk closureTyConName FSLIT("dPA_Clo") - , mk intTyConName FSLIT("dPA_Int") - ] - ++ tups - where - mk name fs = (name, nDP_INSTANCES, fs) - - tups = mk_tup 0 : map mk_tup [2..3] - mk_tup n = (getName $ tupleTyCon Boxed n, nDP_INSTANCES, - mkFastString $ "dPA_" ++ show n) - vectorise :: HscEnv -> UniqSupply -> RuleBase -> ModGuts -> IO (SimplCount, ModGuts) vectorise hsc_env _ _ guts @@ -74,7 +68,6 @@ vectorise hsc_env _ _ guts vectModule :: ModGuts -> VM ModGuts vectModule guts = do - defTyConBuiltinPAs builtin_PAs (types', fam_insts, tc_binds) <- vectTypeEnv (mg_types guts) let fam_inst_env' = extendFamInstEnvList (mg_fam_inst_env guts) fam_insts @@ -225,9 +218,13 @@ vectExpr e@(_, AnnApp _ arg) vectExpr (_, AnnApp fn arg) = do - fn' <- vectExpr fn - arg' <- vectExpr arg - mkClosureApp fn' arg' + arg_ty' <- vectType arg_ty + res_ty' <- vectType res_ty + fn' <- vectExpr fn + arg' <- vectExpr arg + mkClosureApp arg_ty' res_ty' fn' arg' + where + (arg_ty, res_ty) = splitFunTy . exprType $ deAnnotate fn vectExpr (_, AnnCase scrut bndr ty alts) | isAlgType scrut_ty