diff options
| author | Bartosz Nitka <niteria@gmail.com> | 2017-12-26 12:54:27 +0000 |
|---|---|---|
| committer | Bartosz Nitka <niteria@gmail.com> | 2018-01-04 14:03:54 +0000 |
| commit | 6c34824434a67baa34e4ee2ddb753708eb61c5bc (patch) | |
| tree | ca8c84cae978b3cc61ff096f74016d7aebfd1707 /compiler/vectorise/Vectorise/Generic/PData.hs | |
| parent | 649e777211fe08432900093002547d7358f92d82 (diff) | |
| download | haskell-6c34824434a67baa34e4ee2ddb753708eb61c5bc.tar.gz | |
Cache the number of data cons in DataTyCon and SumTyCon
This is a follow-up after faf60e85 - Make tagForCon non-linear.
On the mailing list @simonpj suggested to solve the
linear behavior by caching the sizes.
Test Plan: ./validate
Reviewers: simonpj, simonmar, bgamari, austin
Reviewed By: simonpj
Subscribers: carter, goldfire, rwbarton, thomie, simonpj
Differential Revision: https://phabricator.haskell.org/D4131
Diffstat (limited to 'compiler/vectorise/Vectorise/Generic/PData.hs')
| -rw-r--r-- | compiler/vectorise/Vectorise/Generic/PData.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/vectorise/Vectorise/Generic/PData.hs b/compiler/vectorise/Vectorise/Generic/PData.hs index 4862ce204b..353d6963b6 100644 --- a/compiler/vectorise/Vectorise/Generic/PData.hs +++ b/compiler/vectorise/Vectorise/Generic/PData.hs @@ -68,7 +68,7 @@ buildDataFamInst name' fam_tc vect_tc rhs buildPDataTyConRhs :: Name -> TyCon -> TyCon -> SumRepr -> VM AlgTyConRhs buildPDataTyConRhs orig_name vect_tc repr_tc repr = do data_con <- buildPDataDataCon orig_name vect_tc repr_tc repr - return $ DataTyCon { data_cons = [data_con], is_enum = False } + return $ mkDataTyConRhs [data_con] buildPDataDataCon :: Name -> TyCon -> TyCon -> SumRepr -> VM DataCon @@ -113,7 +113,7 @@ buildPDatasTyCon orig_tc vect_tc repr buildPDatasTyConRhs :: Name -> TyCon -> TyCon -> SumRepr -> VM AlgTyConRhs buildPDatasTyConRhs orig_name vect_tc repr_tc repr = do data_con <- buildPDatasDataCon orig_name vect_tc repr_tc repr - return $ DataTyCon { data_cons = [data_con], is_enum = False } + return $ mkDataTyConRhs [data_con] buildPDatasDataCon :: Name -> TyCon -> TyCon -> SumRepr -> VM DataCon |
