#include "HsVersions.h"
import BinderInfo ( orBinderInfo, andBinderInfo, noBinderInfo, isOneOcc,
- okToInline, isOneFunOcc,
+ isOneFunOcc,
BinderInfo
)
import CmdLineOpts ( switchIsOn, intSwitchSet, opt_UnfoldingCreationThreshold,
)
import CoreSyn
import CoreUnfold ( mkFormSummary, couldBeSmallEnoughToInline, whnfOrBottom,
+ okToInline,
Unfolding(..), FormSummary(..),
calcUnfoldingGuidance )
import CoreUtils ( coreExprCc )
\begin{code}
-mkSimplUnfoldingGuidance chkr out_id rhs
- = calcUnfoldingGuidance (getInlinePragma out_id) opt_UnfoldingCreationThreshold rhs
-
extendEnvGivenUnfolding :: SimplEnv -> OutId -> BinderInfo -> Unfolding -> SimplEnv
extendEnvGivenUnfolding env@(SimplEnv chkr encl_cc ty_env (in_scope_ids, id_subst) con_apps)
out_id occ_info rhs_info
occ_info out_id rhs
= SimplEnv chkr encl_cc ty_env (new_in_scope_ids, id_subst) new_con_apps
where
- new_in_scope_ids | okToInline (whnfOrBottom form)
+ new_in_scope_ids | okToInline out_id
+ (whnfOrBottom form)
(couldBeSmallEnoughToInline out_id guidance)
occ_info
= env_with_unfolding
form = _scc_ "eegnr.form_sum"
mkFormSummary rhs
guidance = _scc_ "eegnr.guidance"
- mkSimplUnfoldingGuidance chkr out_id rhs
+ calcUnfoldingGuidance opt_UnfoldingCreationThreshold rhs
-- Attach a cost centre to the RHS if necessary
rhs_w_cc | currentOrSubsumedCosts encl_cc
|| not (noCostCentreAttached (coreExprCc rhs))
= rhs
| otherwise
- = SCC encl_cc rhs
+ = Note (SCC encl_cc) rhs
\end{code}