Link with hpc even if GhcWithInterpreter is not set
[ghc-hetmet.git] / compiler / vectorise / VectType.hs
index aed3e2a..d2a9b06 100644 (file)
@@ -299,7 +299,7 @@ buildPADict (PAInstance {
       pa_dc <- builtin paDictDataCon
       let dict = mkConApp pa_dc (Type (mkTyConApp vect_tc arg_tys) : meth_exprs)
           body = Let (Rec meth_binds) dict
-      return [(instanceDFunId inst, abstract body)]
+      return [(instanceDFunId inst, mkInlineMe $ abstract body)]
   where
     tvs = tyConTyVars arr_tc
     arg_tys = mkTyVarTys tvs
@@ -370,12 +370,14 @@ buildReplicatePA vect_tc arr_tc
 
       shape <- replicatePA len (ctr_num val)
       reprs <- liftM concat $ mapM (mk_comp_arrs len val) vect_dcs
-      
+
       return . mkLams [len_var, val_var]
-             $ mkConApp arr_dc (map (Type . TyVarTy) (tyConTyVars arr_tc) ++ (shape : reprs))
+             . wrapFamInstBody arr_tc arg_tys
+             $ mkConApp arr_dc (map Type arg_tys ++ (shape : reprs))
   where
-    val_ty = mkTyConApp vect_tc . mkTyVarTys $ tyConTyVars arr_tc
-    wild   = mkWildId val_ty
+    arg_tys = mkTyVarTys (tyConTyVars arr_tc)
+    val_ty  = mkTyConApp vect_tc arg_tys
+    wild    = mkWildId val_ty
     vect_dcs = tyConDataCons vect_tc
     [arr_dc] = tyConDataCons arr_tc
 
@@ -398,7 +400,7 @@ buildReplicatePA vect_tc arr_tc
           arr_ty <- mkPArrayType ty
 
           return $ Case val wild arr_ty
-                     [(DataAlt dc, pre ++ (var : post), rep), (DEFAULT, [], empty)]
+                     [(DEFAULT, [], empty), (DataAlt dc, pre ++ (var : post), rep)]
 
 -- | Split the given tycons into two sets depending on whether they have to be
 -- converted (first list) or not (second list). The first argument contains