Commit 7a8ef019 authored by Matthew Pickering's avatar Matthew Pickering

Remove `setUnfoldingInfoLazily`

The definition of `setUnfoldingInfoLazily` is exactly the same as
`setUnfoldingInfo` and is only used in one place, `TcIface`.

They were made equivalent in 2010 in
2ff2497d with the commit message.

{{{
commit 2ff2497d
Author: Ian Lynagh <igloo@earth.li>  Wed Oct 20 15:37:10 2010
Committer:      Ian Lynagh <igloo@earth.li>  Wed Oct 20 15:37:10 2010
Original File:  compiler/basicTypes/IdInfo.lhs

Don't seq unfoldings
We generate intermediate unfoldings which are just thrown away, so
evaluating them is a waste of time.
}}}

Closes #12453
parent 7a06b220
...@@ -90,7 +90,6 @@ module Id ( ...@@ -90,7 +90,6 @@ module Id (
idOccInfo, idOccInfo,
-- ** Writing 'IdInfo' fields -- ** Writing 'IdInfo' fields
setIdUnfoldingLazily,
setIdUnfolding, setIdUnfolding,
setIdArity, setIdArity,
setIdCallArity, setIdCallArity,
...@@ -139,8 +138,7 @@ import Util ...@@ -139,8 +138,7 @@ import Util
import StaticFlags import StaticFlags
-- infixl so you can say (id `set` a `set` b) -- infixl so you can say (id `set` a `set` b)
infixl 1 `setIdUnfoldingLazily`, infixl 1 `setIdUnfolding`,
`setIdUnfolding`,
`setIdArity`, `setIdArity`,
`setIdCallArity`, `setIdCallArity`,
`setIdOccInfo`, `setIdOccInfo`,
...@@ -606,9 +604,6 @@ realIdUnfolding :: Id -> Unfolding ...@@ -606,9 +604,6 @@ realIdUnfolding :: Id -> Unfolding
-- Expose the unfolding if there is one, including for loop breakers -- Expose the unfolding if there is one, including for loop breakers
realIdUnfolding id = unfoldingInfo (idInfo id) realIdUnfolding id = unfoldingInfo (idInfo id)
setIdUnfoldingLazily :: Id -> Unfolding -> Id
setIdUnfoldingLazily id unfolding = modifyIdInfo (`setUnfoldingInfoLazily` unfolding) id
setIdUnfolding :: Id -> Unfolding -> Id setIdUnfolding :: Id -> Unfolding -> Id
setIdUnfolding id unfolding = modifyIdInfo (`setUnfoldingInfo` unfolding) id setIdUnfolding id unfolding = modifyIdInfo (`setUnfoldingInfo` unfolding) id
......
...@@ -38,7 +38,7 @@ module IdInfo ( ...@@ -38,7 +38,7 @@ module IdInfo (
demandInfo, setDemandInfo, pprStrictness, demandInfo, setDemandInfo, pprStrictness,
-- ** Unfolding Info -- ** Unfolding Info
unfoldingInfo, setUnfoldingInfo, setUnfoldingInfoLazily, unfoldingInfo, setUnfoldingInfo,
-- ** The InlinePragInfo type -- ** The InlinePragInfo type
InlinePragInfo, InlinePragInfo,
...@@ -230,11 +230,6 @@ setOccInfo :: IdInfo -> OccInfo -> IdInfo ...@@ -230,11 +230,6 @@ setOccInfo :: IdInfo -> OccInfo -> IdInfo
setOccInfo info oc = oc `seq` info { occInfo = oc } setOccInfo info oc = oc `seq` info { occInfo = oc }
-- Try to avoid spack leaks by seq'ing -- Try to avoid spack leaks by seq'ing
setUnfoldingInfoLazily :: IdInfo -> Unfolding -> IdInfo
setUnfoldingInfoLazily info uf -- Lazy variant to avoid looking at the
= -- unfolding of an imported Id unless necessary
info { unfoldingInfo = uf } -- (In this case the demand-zapping is redundant.)
setUnfoldingInfo :: IdInfo -> Unfolding -> IdInfo setUnfoldingInfo :: IdInfo -> Unfolding -> IdInfo
setUnfoldingInfo info uf setUnfoldingInfo info uf
= -- We don't seq the unfolding, as we generate intermediate = -- We don't seq the unfolding, as we generate intermediate
......
...@@ -1232,7 +1232,7 @@ tcIdInfo ignore_prags name ty info ...@@ -1232,7 +1232,7 @@ tcIdInfo ignore_prags name ty info
= do { unf <- tcUnfolding name ty info if_unf = do { unf <- tcUnfolding name ty info if_unf
; let info1 | lb = info `setOccInfo` strongLoopBreaker ; let info1 | lb = info `setOccInfo` strongLoopBreaker
| otherwise = info | otherwise = info
; return (info1 `setUnfoldingInfoLazily` unf) } ; return (info1 `setUnfoldingInfo` unf) }
tcUnfolding :: Name -> Type -> IdInfo -> IfaceUnfolding -> IfL Unfolding tcUnfolding :: Name -> Type -> IdInfo -> IfaceUnfolding -> IfL Unfolding
tcUnfolding name _ info (IfCoreUnfold stable if_expr) tcUnfolding name _ info (IfCoreUnfold stable if_expr)
......
...@@ -315,7 +315,7 @@ vectTopBinder var inline expr ...@@ -315,7 +315,7 @@ vectTopBinder var inline expr
(text "Inferred type" <+> ppr vdty) (text "Inferred type" <+> ppr vdty)
} }
-- Make the vectorised version of binding's name, and set the unfolding used for inlining -- Make the vectorised version of binding's name, and set the unfolding used for inlining
; var' <- liftM (`setIdUnfoldingLazily` unfolding) ; var' <- liftM (`setIdUnfolding` unfolding)
$ mkVectId var vty $ mkVectId var vty
-- Add the mapping between the plain and vectorised name to the state. -- Add the mapping between the plain and vectorised name to the state.
......
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