[commit: ghc] master: Remove `setUnfoldingInfoLazily` (7a8ef01)
git at git.haskell.org
git at git.haskell.org
Wed Aug 3 15:00:14 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/7a8ef01920731f0afa45f3589fcb4a89d5eb125c/ghc
>---------------------------------------------------------------
commit 7a8ef01920731f0afa45f3589fcb4a89d5eb125c
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date: Wed Aug 3 14:22:21 2016 +0100
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 at earth.li> Wed Oct 20 15:37:10 2010
Committer: Ian Lynagh <igloo at 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
>---------------------------------------------------------------
7a8ef01920731f0afa45f3589fcb4a89d5eb125c
compiler/basicTypes/Id.hs | 7 +------
compiler/basicTypes/IdInfo.hs | 7 +------
compiler/iface/TcIface.hs | 2 +-
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 387de1e..4e8847b 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 0cd2e95..4d10f20 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 f8e9505..56c5a5a 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 77561ff..b78db7c 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.
More information about the ghc-commits
mailing list