From: simonpj Date: Mon, 6 Jan 2003 15:17:57 +0000 (+0000) Subject: [project @ 2003-01-06 15:17:57 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~1303 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=aef84dceb73aae423df4fd28d9852a200f55b0ce;p=ghc-hetmet.git [project @ 2003-01-06 15:17:57 by simonpj] --------------------------------------------- Try slightly more aggressive rule application --------------------------------------------- Switch on AlwaysActive rules even in SimplGently. This should make some TH programs a little better, but it's not a big deal. --- diff --git a/ghc/compiler/simplCore/SimplMonad.lhs b/ghc/compiler/simplCore/SimplMonad.lhs index 5edfd2c..09c8916 100644 --- a/ghc/compiler/simplCore/SimplMonad.lhs +++ b/ghc/compiler/simplCore/SimplMonad.lhs @@ -899,22 +899,13 @@ postInlineUnconditionally env bndr occ_info rhs SimplGently -> isAlwaysActive prag SimplPhase n -> isActive n prag prag = idInlinePragma bndr -\end{code} - -blackListInline tells if we must not inline at a call site because the -Id's inline pragma says not to do so. -However, blackListInline is ignored for things with with Compulsory inlinings, -because they don't have bindings, so we must inline them no matter how -gentle we are being. - -\begin{code} activeInline :: SimplEnv -> OutId -> OccInfo -> Bool activeInline env id occ = case getMode env of - SimplGently -> isAlwaysActive prag && isOneOcc occ + SimplGently -> isOneOcc occ && isAlwaysActive prag -- No inlining at all when doing gentle stuff, - -- except for things that occur once + -- except for local things that occur once -- The reason is that too little clean-up happens if you -- don't inline use-once things. Also a bit of inlining is *good* for -- full laziness; it can expose constant sub-expressions. @@ -936,7 +927,12 @@ activeRule :: SimplEnv -> Maybe (Activation -> Bool) -- Nothing => No rules at all activeRule env = case getMode env of - SimplGently -> Nothing -- No rules in gentle mode + SimplGently -> Just isAlwaysActive + -- Used to be Nothing (no rules in gentle mode) + -- Main motivation for changing is that I wanted + -- lift String ===> ... + -- to work in Template Haskell when simplifying + -- splices, so we get simpler code for literal strings SimplPhase n -> Just (isActive n) \end{code}