[commit: ghc] master: Vectoriser: depending set of a vectorised tycon need only be vectorised if also parallel (f8fb4a4)
Manuel Chakravarty
chak at cse.unsw.edu.au
Wed Feb 6 04:17:16 CET 2013
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/f8fb4a4ed8526679903ab58a058f8f1bcb32f458
>---------------------------------------------------------------
commit f8fb4a4ed8526679903ab58a058f8f1bcb32f458
Author: Manuel M T Chakravarty <chak at cse.unsw.edu.au>
Date: Sun Dec 16 14:04:02 2012 +1100
Vectoriser: depending set of a vectorised tycon need only be vectorised if also parallel
>---------------------------------------------------------------
compiler/vectorise/Vectorise/Type/Classify.hs | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/compiler/vectorise/Vectorise/Type/Classify.hs b/compiler/vectorise/Vectorise/Type/Classify.hs
index 1632589..6d7ed06 100644
--- a/compiler/vectorise/Vectorise/Type/Classify.hs
+++ b/compiler/vectorise/Vectorise/Type/Classify.hs
@@ -34,7 +34,11 @@ import Digraph
-- vectorised. The third result list are those type constructors that we cannot convert (either
-- because they use language extensions or because they dependent on type constructors for which
-- no vectorised version is available).
-
+--
+-- NB: In order to be able to vectorise a type constructor, we require members of the depending set
+-- (i.e., those type constructors that the current one depends on) to be vectorised only if they
+-- are also parallel (i.e., appear in the second argument to the function).
+--
-- The first argument determines the /conversion status/ of external type constructors as follows:
--
-- * tycons which have converted versions are mapped to 'True'
@@ -69,7 +73,8 @@ classifyTyCons convStatus parTyCons tcs = classify [] [] [] [] convStatus parTyC
pts' = pts `addListToNameSet` map tyConName tcs_par
- can_convert = (isNullUFM (refs `minusUFM` cs) && all convertable tcs)
+ can_convert = (isNullUFM (filterUniqSet ((`elemNameSet` pts) . tyConName) (refs `minusUFM` cs))
+ && all convertable tcs)
|| isShowClass tcs
must_convert = foldUFM (||) False (intersectUFM_C const cs refs)
&& (not . isShowClass $ tcs)
More information about the ghc-commits
mailing list