Commit 1bdb9062 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Avoid hanging on to old unfoldings; fixes #4367 (compiler space regression)

parent 25bff7fe
...@@ -721,7 +721,10 @@ simplUnfolding env top_lvl id _ _ ...@@ -721,7 +721,10 @@ simplUnfolding env top_lvl id _ _
is_top_lvl = isTopLevel top_lvl is_top_lvl = isTopLevel top_lvl
; case guide of ; case guide of
UnfIfGoodArgs{} -> UnfIfGoodArgs{} ->
return (mkUnfolding src' is_top_lvl (isBottomingId id) expr') -- We need to force bottoming, or the new unfolding holds
-- on to the old unfolding (which is part of the id).
let bottoming = isBottomingId id
in bottoming `seq` return (mkUnfolding src' is_top_lvl bottoming expr')
-- If the guidance is UnfIfGoodArgs, this is an INLINABLE -- If the guidance is UnfIfGoodArgs, this is an INLINABLE
-- unfolding, and we need to make sure the guidance is kept up -- unfolding, and we need to make sure the guidance is kept up
-- to date with respect to any changes in the unfolding. -- to date with respect to any changes in the unfolding.
...@@ -735,7 +738,10 @@ simplUnfolding env top_lvl id _ _ ...@@ -735,7 +738,10 @@ simplUnfolding env top_lvl id _ _
-- See Note [Simplifying inside InlineRules] in SimplUtils -- See Note [Simplifying inside InlineRules] in SimplUtils
simplUnfolding _ top_lvl id _occ_info new_rhs _ simplUnfolding _ top_lvl id _occ_info new_rhs _
= return (mkUnfolding InlineRhs (isTopLevel top_lvl) (isBottomingId id) new_rhs) = -- We need to force bottoming, or the new unfolding holds
-- on to the old unfolding (which is part of the id).
let bottoming = isBottomingId id
in bottoming `seq` return (mkUnfolding InlineRhs (isTopLevel top_lvl) bottoming new_rhs)
-- We make an unfolding *even for loop-breakers*. -- We make an unfolding *even for loop-breakers*.
-- Reason: (a) It might be useful to know that they are WHNF -- Reason: (a) It might be useful to know that they are WHNF
-- (b) In TidyPgm we currently assume that, if we want to -- (b) In TidyPgm we currently assume that, if we want to
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment