diff options
Diffstat (limited to 'compiler/stranal')
| -rw-r--r-- | compiler/stranal/DmdAnal.lhs | 4 | ||||
| -rw-r--r-- | compiler/stranal/WorkWrap.lhs | 6 | ||||
| -rw-r--r-- | compiler/stranal/WwLib.lhs | 14 |
3 files changed, 16 insertions, 8 deletions
diff --git a/compiler/stranal/DmdAnal.lhs b/compiler/stranal/DmdAnal.lhs index 9955490c25..f52ab78180 100644 --- a/compiler/stranal/DmdAnal.lhs +++ b/compiler/stranal/DmdAnal.lhs @@ -166,8 +166,8 @@ dmdAnal env dmd (Cast e co) -- inside recursive products -- we might not reach -- a fixpoint. So revert to a vanilla Eval demand -dmdAnal env dmd (Note n e) - = (dmd_ty, Note n e') +dmdAnal env dmd (Tick t e) + = (dmd_ty, Tick t e') where (dmd_ty, e') = dmdAnal env dmd e diff --git a/compiler/stranal/WorkWrap.lhs b/compiler/stranal/WorkWrap.lhs index c1e9c48390..c947388d18 100644 --- a/compiler/stranal/WorkWrap.lhs +++ b/compiler/stranal/WorkWrap.lhs @@ -110,8 +110,8 @@ wwExpr (Lam binder expr) wwExpr (App f a) = App <$> wwExpr f <*> wwExpr a -wwExpr (Note note expr) - = Note note <$> wwExpr expr +wwExpr (Tick note expr) + = Tick note <$> wwExpr expr wwExpr (Cast expr co) = do new_expr <- wwExpr expr @@ -379,7 +379,7 @@ get_one_shots :: Expr Var -> [Bool] get_one_shots (Lam b e) | isId b = isOneShotLambda b : get_one_shots e | otherwise = get_one_shots e -get_one_shots (Note _ e) = get_one_shots e +get_one_shots (Tick _ e) = get_one_shots e get_one_shots _ = noOneShotInfo \end{code} diff --git a/compiler/stranal/WwLib.lhs b/compiler/stranal/WwLib.lhs index 223cb81e8c..b18ded3118 100644 --- a/compiler/stranal/WwLib.lhs +++ b/compiler/stranal/WwLib.lhs @@ -475,10 +475,18 @@ mkWWcpr body_ty _other -- No CPR info -- \ x -> case (_scc_ "foo" E) of I# x -> x) -- -- This transform doesn't move work or allocation --- from one cost centre to another +-- from one cost centre to another. +-- +-- Later [SDM]: presumably this is because we want the simplifier to +-- eliminate the case, and the scc would get in the way? I'm ok with +-- including the case itself in the cost centre, since it is morally +-- part of the function (post transformation) anyway. + workerCase :: Id -> CoreExpr -> [Id] -> DataCon -> CoreExpr -> CoreExpr -workerCase bndr (Note (SCC cc) e) args con body = Note (SCC cc) (mkUnpackCase bndr e args con body) -workerCase bndr e args con body = mkUnpackCase bndr e args con body +workerCase bndr (Tick tickish e) args con body + = Tick tickish (mkUnpackCase bndr e args con body) +workerCase bndr e args con body + = mkUnpackCase bndr e args con body \end{code} |
