X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FsimplCore%2FSimplUtils.lhs;h=fa244c47e1abc2e0a5f5e037145858fa663261a2;hb=ac704fcac946590eef0ec91ae19f3b47d779a75f;hp=b9e98f7ead8d3de32faebde0353a9d2f0ff46151;hpb=734ae260b47cc71469cffe5774dce4de002ed1ee;p=ghc-hetmet.git diff --git a/compiler/simplCore/SimplUtils.lhs b/compiler/simplCore/SimplUtils.lhs index b9e98f7..fa244c4 100644 --- a/compiler/simplCore/SimplUtils.lhs +++ b/compiler/simplCore/SimplUtils.lhs @@ -44,7 +44,6 @@ import Id ( Id, idType, isDataConWorkId, idOccInfo, isDictId, ) import NewDemand ( isStrictDmd, isBotRes, splitStrictSig ) import SimplMonad -import Var ( tyVarKind, mkTyVar ) import Name ( mkSysTvName ) import Type ( Type, splitFunTys, dropForAlls, isStrictType, splitTyConApp_maybe, tyConAppArgs, mkTyVarTys ) @@ -721,7 +720,8 @@ postInlineUnconditionally -> Bool postInlineUnconditionally env top_lvl bndr occ_info rhs unfolding | not active = False - | isLoopBreaker occ_info = False + | isLoopBreaker occ_info = False -- If it's a loop-breaker of any kind, dont' inline + -- because it might be referred to "earlier" | isExportedId bndr = False | exprIsTrivial rhs = True | otherwise @@ -788,10 +788,10 @@ postInlineUnconditionally env top_lvl bndr occ_info rhs unfolding SimplPhase n -> isActive n prag prag = idInlinePragma bndr -activeInline :: SimplEnv -> OutId -> OccInfo -> Bool -activeInline env id occ +activeInline :: SimplEnv -> OutId -> Bool +activeInline env id = case getMode env of - SimplGently -> isOneOcc occ && isAlwaysActive prag + SimplGently -> False -- No inlining at all when doing gentle stuff, -- except for local things that occur once -- The reason is that too little clean-up happens if you