diff options
author | Reid Barton <rwbarton@gmail.com> | 2017-05-01 11:17:47 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-05-01 11:17:48 -0400 |
commit | 5c602d2228d28530621cc6c94fbb736b13f474fb (patch) | |
tree | 89184ee1f1d1e77c5f8f719be6587768cd26a313 /compiler/main | |
parent | 068af0162a47b1fd7809d056ccc2d80e480d53f5 (diff) | |
download | haskell-5c602d2228d28530621cc6c94fbb736b13f474fb.tar.gz |
Avoid excessive space usage from unfoldings in CoreTidy
Test Plan: validate
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
GHC Trac Issues: #13564
Differential Revision: https://phabricator.haskell.org/D3516
Diffstat (limited to 'compiler/main')
-rw-r--r-- | compiler/main/TidyPgm.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/main/TidyPgm.hs b/compiler/main/TidyPgm.hs index 21d0208a07..4b9fbae599 100644 --- a/compiler/main/TidyPgm.hs +++ b/compiler/main/TidyPgm.hs @@ -22,6 +22,7 @@ import CoreMonad import CorePrep import CoreUtils (rhsIsStatic) import CoreStats (coreBindsStats, CoreStats(..)) +import CoreSeq (seqBinds) import CoreLint import Literal import Rules @@ -1134,7 +1135,9 @@ tidyTopBinds hsc_env this_mod unfold_env init_occ_env binds = do mkIntegerId <- lookupMkIntegerName dflags hsc_env integerSDataCon <- lookupIntegerSDataConName dflags hsc_env let cvt_integer = cvtLitInteger dflags mkIntegerId integerSDataCon - return $ tidy cvt_integer init_env binds + result = tidy cvt_integer init_env binds + seqBinds (snd result) `seq` return result + -- This seqBinds avoids a spike in space usage (see #13564) where dflags = hsc_dflags hsc_env |