- mk_method (name, build)
- = localV
- $ do
- body <- build vect_tc prepr_tc arr_tc repr
- var <- newLocalVar name (exprType body)
- return (var, mkInlineMe body)
-
--- The InlineMe note has gone away. Instead, you need to use
--- CoreUnfold.mkInlineRule to make an InlineRule for the thing, and
--- attach *that* as the unfolding for the dictionary binder
-mkInlineMe :: CoreExpr -> CoreExpr
-mkInlineMe expr = pprTrace "VectType: Roman, you need to use the new InlineRule story"
- (ppr expr) expr
-
-paMethods :: [(FastString, TyCon -> TyCon -> TyCon -> SumRepr -> VM CoreExpr)]
-paMethods = [(fsLit "dictPRepr", buildPRDict),
- (fsLit "toPRepr", buildToPRepr),
- (fsLit "fromPRepr", buildFromPRepr),
- (fsLit "toArrPRepr", buildToArrPRepr),
- (fsLit "fromArrPRepr", buildFromArrPRepr)]
-
--- | 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
--- information about the conversion status of external tycons:
---
--- * tycons which have converted versions are mapped to True
--- * tycons which are not changed by vectorisation are mapped to False
--- * tycons which can't be converted are not elements of the map
---
-classifyTyCons :: UniqFM Bool -> [TyConGroup] -> ([TyCon], [TyCon])
-classifyTyCons = classify [] []
- where
- classify conv keep _ [] = (conv, keep)
- classify conv keep cs ((tcs, ds) : rs)
- | can_convert && must_convert
- = classify (tcs ++ conv) keep (cs `addListToUFM` [(tc,True) | tc <- tcs]) rs
- | can_convert
- = classify conv (tcs ++ keep) (cs `addListToUFM` [(tc,False) | tc <- tcs]) rs
- | otherwise
- = classify conv keep cs rs
- where
- refs = ds `delListFromUniqSet` tcs
-
- can_convert = isNullUFM (refs `minusUFM` cs) && all convertable tcs
- must_convert = foldUFM (||) False (intersectUFM_C const cs refs)