From: simonpj Date: Mon, 19 Mar 2001 16:24:37 +0000 (+0000) Subject: [project @ 2001-03-19 16:24:37 by simonpj] X-Git-Tag: Approximately_9120_patches~2373 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=33aac1f993ade9a0a8aee67eaad1584df8705d67;p=ghc-hetmet.git [project @ 2001-03-19 16:24:37 by simonpj] --------------------------------------------- Be more eager to inline for an applied coerce --------------------------------------------- Given this: (coerce T f) x y SimplUtils.interestingCallContext was returning False (uninteresting call context). This is wrong: it's a very intersting context. Darn those coerces! They are scheduled for destruction, but meanwhile, this makes matters a bit better. --- diff --git a/ghc/compiler/simplCore/SimplUtils.lhs b/ghc/compiler/simplCore/SimplUtils.lhs index f61b513..55e7fca 100644 --- a/ghc/compiler/simplCore/SimplUtils.lhs +++ b/ghc/compiler/simplCore/SimplUtils.lhs @@ -369,7 +369,10 @@ interestingCallContext some_args some_val_args cont where interesting (InlinePlease _) = True interesting (Select _ _ _ _ _) = some_args - interesting (ApplyTo _ _ _ _) = some_args -- Can happen if we have (coerce t (f x)) y + interesting (ApplyTo _ _ _ _) = True -- Can happen if we have (coerce t (f x)) y + -- Perhaps True is a bit over-keen, but I've + -- seen (coerce f) x, where f has an INLINE prag, + -- So we have to give some motivaiton for inlining it interesting (ArgOf _ _ _) = some_val_args interesting (Stop ty upd_in_place) = some_val_args && upd_in_place interesting (CoerceIt _ cont) = interesting cont