diff options
author | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2012-12-16 14:04:02 +1100 |
---|---|---|
committer | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2012-12-16 14:04:02 +1100 |
commit | f8fb4a4ed8526679903ab58a058f8f1bcb32f458 (patch) | |
tree | da725bce7306975d08e08c8e874f1ef0b191d6e8 /compiler/vectorise | |
parent | 551472b1877086a98c45a12b99ed6235efde6f45 (diff) | |
download | haskell-f8fb4a4ed8526679903ab58a058f8f1bcb32f458.tar.gz |
Vectoriser: depending set of a vectorised tycon need only be vectorised if also parallel
Diffstat (limited to 'compiler/vectorise')
-rw-r--r-- | 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 16325893bf..6d7ed06c00 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) |