X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcoreSyn%2FCoreUnfold.lhs;h=cf9107b0443b36dbf0f41e5f467e6f11d4d523b0;hb=980025a601d27a480f2b1072ac01ced1dfcbc430;hp=d86b86461b1e6213a0c5b6e92853015a1a725d1b;hpb=531d0d264fafd66aece5ca38d2bfcd266a8fd3e5;p=ghc-hetmet.git diff --git a/ghc/compiler/coreSyn/CoreUnfold.lhs b/ghc/compiler/coreSyn/CoreUnfold.lhs index d86b864..cf9107b 100644 --- a/ghc/compiler/coreSyn/CoreUnfold.lhs +++ b/ghc/compiler/coreSyn/CoreUnfold.lhs @@ -42,14 +42,14 @@ import CoreSyn import PprCore ( pprCoreExpr ) import OccurAnal ( occurAnalyseGlobalExpr ) import CoreUtils ( exprIsValue, exprIsCheap, exprIsTrivial ) -import Id ( Id, idType, idFlavour, isId, +import Id ( Id, idType, isId, idSpecialisation, idInlinePragma, idUnfolding, - isPrimOpId_maybe + isPrimOpId_maybe, globalIdDetails ) import VarSet import Literal ( isLitLitLit, litSize ) import PrimOp ( PrimOp(..), primOpIsDupable, primOpOutOfLine, ccallIsCasm ) -import IdInfo ( InlinePragInfo(..), OccInfo(..), IdFlavour(..), +import IdInfo ( InlinePragInfo(..), OccInfo(..), GlobalIdDetails(..), isNeverInlinePrag ) import Type ( isUnLiftedType ) @@ -288,7 +288,7 @@ sizeExpr bOMB_OUT_SIZE top_args expr | fun `hasKey` buildIdKey = buildSize | fun `hasKey` augmentIdKey = augmentSize | otherwise - = case idFlavour fun of + = case globalIdDetails fun of DataConId dc -> conSizeN (valArgCount args) PrimOpId op -> primOpSize op (valArgCount args) @@ -571,7 +571,9 @@ callSiteInline dflags black_listed inline_call occ id arg_infos interesting_cont -- Note: there used to be a '&& not top_level' in the guard above, -- but that stopped us inlining top-level functions used only once, -- which is stupid - = not in_lam || not (null arg_infos) || interesting_cont + = WARN( not in_lam, ppr id ) -- If (not in_lam) && one_br then PreInlineUnconditionally + -- should have caught it, shouldn't it? + not (null arg_infos) || interesting_cont | otherwise = case guidance of @@ -614,7 +616,6 @@ callSiteInline dflags black_listed inline_call occ id arg_infos interesting_cont arg_infos really_interesting_cont in -#ifdef DEBUG if dopt Opt_D_dump_inlinings dflags then pprTrace "Considering inlining" (ppr id <+> vcat [text "black listed:" <+> ppr black_listed, @@ -630,7 +631,6 @@ callSiteInline dflags black_listed inline_call occ id arg_infos interesting_cont else empty]) result else -#endif result }