diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2016-08-03 14:22:21 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2016-08-03 15:58:52 +0100 |
commit | 7a8ef01920731f0afa45f3589fcb4a89d5eb125c (patch) | |
tree | 05822c7510392f02fc552f077b17942a8953c73f | |
parent | 7a06b220447ecaf603e3c9d420ecb34b9d5609f1 (diff) | |
download | haskell-7a8ef01920731f0afa45f3589fcb4a89d5eb125c.tar.gz |
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
2ff2497dc374175b8ed81446258baf208d1f3e6e with the commit message.
{{{
commit 2ff2497dc374175b8ed81446258baf208d1f3e6e
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
-rw-r--r-- | compiler/basicTypes/Id.hs | 7 | ||||
-rw-r--r-- | compiler/basicTypes/IdInfo.hs | 7 | ||||
-rw-r--r-- | compiler/iface/TcIface.hs | 2 | ||||
-rw-r--r-- | compiler/vectorise/Vectorise.hs | 2 |
4 files changed, 4 insertions, 14 deletions
diff --git a/compiler/basicTypes/Id.hs b/compiler/basicTypes/Id.hs index 387de1ec83..4e8847beee 100644 --- a/compiler/basicTypes/Id.hs +++ b/compiler/basicTypes/Id.hs @@ -90,7 +90,6 @@ module Id ( idOccInfo, -- ** Writing 'IdInfo' fields - setIdUnfoldingLazily, setIdUnfolding, setIdArity, setIdCallArity, @@ -139,8 +138,7 @@ import Util import StaticFlags -- infixl so you can say (id `set` a `set` b) -infixl 1 `setIdUnfoldingLazily`, - `setIdUnfolding`, +infixl 1 `setIdUnfolding`, `setIdArity`, `setIdCallArity`, `setIdOccInfo`, @@ -606,9 +604,6 @@ realIdUnfolding :: Id -> Unfolding -- Expose the unfolding if there is one, including for loop breakers realIdUnfolding id = unfoldingInfo (idInfo id) -setIdUnfoldingLazily :: Id -> Unfolding -> Id -setIdUnfoldingLazily id unfolding = modifyIdInfo (`setUnfoldingInfoLazily` unfolding) id - setIdUnfolding :: Id -> Unfolding -> Id setIdUnfolding id unfolding = modifyIdInfo (`setUnfoldingInfo` unfolding) id diff --git a/compiler/basicTypes/IdInfo.hs b/compiler/basicTypes/IdInfo.hs index 0cd2e95c52..4d10f20069 100644 --- a/compiler/basicTypes/IdInfo.hs +++ b/compiler/basicTypes/IdInfo.hs @@ -38,7 +38,7 @@ module IdInfo ( demandInfo, setDemandInfo, pprStrictness, -- ** Unfolding Info - unfoldingInfo, setUnfoldingInfo, setUnfoldingInfoLazily, + unfoldingInfo, setUnfoldingInfo, -- ** The InlinePragInfo type InlinePragInfo, @@ -230,11 +230,6 @@ setOccInfo :: IdInfo -> OccInfo -> IdInfo setOccInfo info oc = oc `seq` info { occInfo = oc } -- 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 info uf = -- We don't seq the unfolding, as we generate intermediate diff --git a/compiler/iface/TcIface.hs b/compiler/iface/TcIface.hs index f8e9505f1c..56c5a5aaf0 100644 --- a/compiler/iface/TcIface.hs +++ b/compiler/iface/TcIface.hs @@ -1232,7 +1232,7 @@ tcIdInfo ignore_prags name ty info = do { unf <- tcUnfolding name ty info if_unf ; let info1 | lb = info `setOccInfo` strongLoopBreaker | otherwise = info - ; return (info1 `setUnfoldingInfoLazily` unf) } + ; return (info1 `setUnfoldingInfo` unf) } tcUnfolding :: Name -> Type -> IdInfo -> IfaceUnfolding -> IfL Unfolding tcUnfolding name _ info (IfCoreUnfold stable if_expr) diff --git a/compiler/vectorise/Vectorise.hs b/compiler/vectorise/Vectorise.hs index 77561ffcd8..b78db7c6da 100644 --- a/compiler/vectorise/Vectorise.hs +++ b/compiler/vectorise/Vectorise.hs @@ -315,7 +315,7 @@ vectTopBinder var inline expr (text "Inferred type" <+> ppr vdty) } -- 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 -- Add the mapping between the plain and vectorised name to the state. |