From 0de03cd78729dc58a846c64b645e71057ec5d24e Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Wed, 11 Mar 2020 19:14:11 +0100 Subject: 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 --- compiler/GHC/Stg/Lift/Analysis.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'compiler/GHC/Stg') 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 -- cgit v1.2.1