X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcoreSyn%2FCoreUnfold.lhs;h=14413f4de66b2ddecd07174f19d3f547dc73cd97;hb=8100cd4395e46ae747be4298c181a4730d6206bc;hp=6bb778dc5546969a546aff96099b2a59fde60ac9;hpb=a35f75aa20bf0a329be0b782986c3e12155b4d49;p=ghc-hetmet.git diff --git a/compiler/coreSyn/CoreUnfold.lhs b/compiler/coreSyn/CoreUnfold.lhs index 6bb778d..14413f4 100644 --- a/compiler/coreSyn/CoreUnfold.lhs +++ b/compiler/coreSyn/CoreUnfold.lhs @@ -1,7 +1,9 @@ % +% (c) The University of Glasgow 2006 % (c) The AQUA Project, Glasgow University, 1994-1998 % -\section[CoreUnfold]{Core-syntax unfoldings} + +Core-syntax unfoldings Unfoldings (which can travel across module boundaries) are in Core syntax (namely @CoreExpr@s). @@ -30,31 +32,24 @@ module CoreUnfold ( #include "HsVersions.h" -import StaticFlags ( opt_UF_CreationThreshold, opt_UF_UseThreshold, - opt_UF_FunAppDiscount, opt_UF_KeenessFactor, - opt_UF_DearOp, - ) -import DynFlags ( DynFlags, DynFlag(..), dopt ) +import StaticFlags +import DynFlags import CoreSyn import PprCore () -- Instances -import OccurAnal ( occurAnalyseExpr ) -import CoreUtils ( exprIsHNF, exprIsCheap, exprIsTrivial ) -import Id ( Id, idType, isId, - idUnfolding, globalIdDetails - ) -import DataCon ( isUnboxedTupleCon ) -import Literal ( litSize ) -import PrimOp ( primOpIsDupable, primOpOutOfLine ) -import IdInfo ( OccInfo(..), GlobalIdDetails(..) ) -import Type ( isUnLiftedType ) -import PrelNames ( hasKey, buildIdKey, augmentIdKey ) +import OccurAnal +import CoreUtils +import Id +import DataCon +import Literal +import PrimOp +import IdInfo +import Type +import PrelNames import Bag import FastTypes import Outputable -#if __GLASGOW_HASKELL__ >= 404 -import GLAEXTS ( Int# ) -#endif +import GHC.Exts ( Int# ) \end{code} @@ -502,14 +497,13 @@ StrictAnal.addStrictnessInfoToTopId \begin{code} callSiteInline :: DynFlags -> Bool -- True <=> the Id can be inlined - -> OccInfo -> Id -- The Id -> [Bool] -- One for each value arg; True if it is interesting -> Bool -- True <=> continuation is interesting -> Maybe CoreExpr -- Unfolding, if any -callSiteInline dflags active_inline occ id arg_infos interesting_cont +callSiteInline dflags active_inline id arg_infos interesting_cont = case idUnfolding id of { NoUnfolding -> Nothing ; OtherCon cs -> Nothing ; @@ -531,11 +525,7 @@ callSiteInline dflags active_inline occ id arg_infos interesting_cont yes_or_no | not active_inline = False - | otherwise = case occ of - IAmDead -> pprTrace "callSiteInline: dead" (ppr id) False - IAmALoopBreaker False -> False -- Note [RulesOnly] in BasicTypes - --OneOcc in_lam _ _ -> (not in_lam || is_cheap) && consider_safe True - other -> is_cheap && consider_safe False + | otherwise = is_cheap && consider_safe False -- We consider even the once-in-one-branch -- occurrences, because they won't all have been -- caught by preInlineUnconditionally. In particular, @@ -596,7 +586,6 @@ callSiteInline dflags active_inline occ id arg_infos interesting_cont if dopt Opt_D_dump_inlinings dflags then pprTrace "Considering inlining" (ppr id <+> vcat [text "active:" <+> ppr active_inline, - text "occ info:" <+> ppr occ, text "arg infos" <+> ppr arg_infos, text "interesting continuation" <+> ppr interesting_cont, text "is value:" <+> ppr is_value,