X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fvectorise%2FVectType.hs;h=972aca1b7b9cc4842bfed33a1025d80242bd9fa0;hb=a1706e166ef400bab3b15a8fd80145ede6655c62;hp=64de665f20ab9a71cff8e4b50c46ae6c6bf67921;hpb=91b99be06b80df38be9d099d8871e0a1ab1b3cd3;p=ghc-hetmet.git diff --git a/compiler/vectorise/VectType.hs b/compiler/vectorise/VectType.hs index 64de665..972aca1 100644 --- a/compiler/vectorise/VectType.hs +++ b/compiler/vectorise/VectType.hs @@ -39,7 +39,7 @@ import TysWiredIn import TysPrim ( intPrimTy ) import Unique -import UniqFM +import LazyUniqFM import UniqSet import Util ( singleton ) import Digraph ( SCC(..), stronglyConnComp ) @@ -366,8 +366,8 @@ arrShapeTys (EnumRepr {}) = sumShapeTys sumShapeTys :: VM [Type] sumShapeTys = do - int_arr <- builtin parrayIntPrimTyCon - return [intPrimTy, mkTyConApp int_arr [], mkTyConApp int_arr []] + int_arr <- builtin intPrimArrayTy + return [intPrimTy, int_arr, int_arr] arrShapeVars :: Repr -> VM [Var] @@ -431,7 +431,7 @@ arrReprVars repr mkRepr :: TyCon -> VM Repr mkRepr vect_tc | [tys] <- rep_tys = boxedProductRepr tys - | all null rep_tys = enumRepr + -- | all null rep_tys = enumRepr | otherwise = sumRepr =<< mapM unboxedProductRepr rep_tys where rep_tys = map dataConRepArgTys $ tyConDataCons vect_tc @@ -1022,7 +1022,7 @@ fromVect (FunTy arg_ty res_ty) expr vres_ty <- vectType res_ty apply <- builtin applyClosureVar body <- fromVect res_ty - $ Var apply `mkTyApps` [arg_ty, res_ty] `mkApps` [expr, Var arg] + $ Var apply `mkTyApps` [varg_ty, vres_ty] `mkApps` [expr, varg] return $ Lam arg body fromVect ty expr = identityConv ty >> return expr @@ -1042,6 +1042,7 @@ identityConvTyCon :: TyCon -> VM () identityConvTyCon tc | isBoxedTupleTyCon tc = return () | isUnLiftedTyCon tc = return () - | otherwise = maybeV (lookupTyCon tc) >> return () - + | otherwise = do + tc' <- maybeV (lookupTyCon tc) + if tc == tc' then return () else noV