diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-03-11 19:14:11 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-03-25 22:42:02 -0400 |
commit | 0de03cd78729dc58a846c64b645e71057ec5d24e (patch) | |
tree | 4d893f44db3fa94094376cf4fcad9a1a832ee261 /compiler/GHC/Stg | |
parent | 262e42aa34c4d5705c8d011907c351497dd4e862 (diff) | |
download | haskell-0de03cd78729dc58a846c64b645e71057ec5d24e.tar.gz |
DynFlags refactoring III
Use Platform instead of DynFlags when possible:
* `tARGET_MIN_INT` et al. replaced with `platformMinInt` et al.
* no more DynFlags in PreRules: added a new `RuleOpts` datatype
* don't use `wORD_SIZE` in the compiler
* make `wordAlignment` use `Platform`
* make `dOUBLE_SIZE` a constant
Metric Decrease:
T13035
T1969
Diffstat (limited to 'compiler/GHC/Stg')
-rw-r--r-- | compiler/GHC/Stg/Lift/Analysis.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/GHC/Stg/Lift/Analysis.hs b/compiler/GHC/Stg/Lift/Analysis.hs index b85c460f10..cc477e0eaa 100644 --- a/compiler/GHC/Stg/Lift/Analysis.hs +++ b/compiler/GHC/Stg/Lift/Analysis.hs @@ -21,6 +21,7 @@ module GHC.Stg.Lift.Analysis ( ) where import GhcPrelude +import GHC.Platform import BasicTypes import Demand @@ -374,6 +375,7 @@ goodToLift dflags top_lvl rec_flag expander pairs scope = decide , ("args spill on stack", args_spill_on_stack) , ("increases allocation", inc_allocs) ] where + platform = targetPlatform dflags decide deciders | not (fancy_or deciders) = llTrace "stgLiftLams:lifting" @@ -475,7 +477,7 @@ goodToLift dflags top_lvl rec_flag expander pairs scope = decide . expander . flip dVarSetMinusVarSet bndrs_set $ freeVarsOfRhs rhs - clo_growth = closureGrowth expander (idClosureFootprint dflags) bndrs_set abs_ids scope + clo_growth = closureGrowth expander (idClosureFootprint platform) bndrs_set abs_ids scope rhsLambdaBndrs :: LlStgRhs -> [Id] rhsLambdaBndrs StgRhsCon{} = [] @@ -499,9 +501,9 @@ closureSize dflags ids = words + sTD_HDR_SIZE dflags -- Note that this can't handle unboxed tuples (which may still be present in -- let-no-escapes, even after Unarise), in which case -- @'GHC.StgToCmm.Closure.idPrimRep'@ will crash. -idClosureFootprint:: DynFlags -> Id -> WordOff -idClosureFootprint dflags - = StgToCmm.ArgRep.argRepSizeW dflags +idClosureFootprint:: Platform -> Id -> WordOff +idClosureFootprint platform + = StgToCmm.ArgRep.argRepSizeW platform . StgToCmm.ArgRep.idArgRep -- | @closureGrowth expander sizer f fvs@ computes the closure growth in words |