From e97b2f8aa9efb3e6d4565a8864ee72c0fa34276c Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 7 Dec 2000 10:36:03 +0000 Subject: [PATCH] [project @ 2000-12-07 10:36:03 by simonpj] Dont drop inline-mes quite so easily. This was leading to substWorker warnings. --- ghc/compiler/coreSyn/CoreUtils.lhs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/coreSyn/CoreUtils.lhs b/ghc/compiler/coreSyn/CoreUtils.lhs index 729b54f..0031c6d 100644 --- a/ghc/compiler/coreSyn/CoreUtils.lhs +++ b/ghc/compiler/coreSyn/CoreUtils.lhs @@ -156,9 +156,16 @@ Drop trivial InlineMe's. This is somewhat important, because if we have an unfo that looks like (Note InlineMe (Var v)), the InlineMe doesn't go away because it may not be *applied* to anything. +We don't use exprIsTrivial here, though, because we sometimes generate worker/wrapper +bindings like + fw = ... + f = inline_me (coerce t fw) +As usual, the inline_me prevents the worker from getting inlined back into the wrapper. +We want the split, so that the coerces can cancel at the call site. + \begin{code} -mkInlineMe e | exprIsTrivial e = e - | otherwise = Note InlineMe e +mkInlineMe (Var v) = Var v +mkInlineMe e = Note InlineMe e \end{code} -- 1.7.10.4