summaryrefslogtreecommitdiff
path: root/compiler/basicTypes/IdInfo.hs
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2017-03-28 16:19:16 -0400
committerJoachim Breitner <mail@joachim-breitner.de>2017-03-28 19:35:31 -0400
commite07211f752b9b98e2bd6957f126bd537d178041a (patch)
treeba6a057b95415def0fc421612f4f79557c85fd8d /compiler/basicTypes/IdInfo.hs
parentc77551abd42a346d03826d23df710ebf9eacb19f (diff)
downloadhaskell-e07211f752b9b98e2bd6957f126bd537d178041a.tar.gz
Zap Call Arity info in the simplifier
As #13479 shows, there are corner cases where the simplifier decides to not eta-expand a function as much as its call arity would suggest, but instead transforms the code that the call arity annotation becomes a lie. As the call arity information is only meant to be used by the immediatelly following simplifier run, it makes sense to simply zap the information there. Differential Revision: https://phabricator.haskell.org/D3390
Diffstat (limited to 'compiler/basicTypes/IdInfo.hs')
-rw-r--r--compiler/basicTypes/IdInfo.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/basicTypes/IdInfo.hs b/compiler/basicTypes/IdInfo.hs
index f29fba7db1..bd6ec8f293 100644
--- a/compiler/basicTypes/IdInfo.hs
+++ b/compiler/basicTypes/IdInfo.hs
@@ -29,7 +29,7 @@ module IdInfo (
-- ** Zapping various forms of Info
zapLamInfo, zapFragileInfo,
zapDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo,
- zapTailCallInfo,
+ zapTailCallInfo, zapCallArityInfo,
-- ** The ArityInfo type
ArityInfo,
@@ -553,6 +553,9 @@ zapTailCallInfo info
where
safe_occ = occ { occ_tail = NoTailCallInfo }
+zapCallArityInfo :: IdInfo -> IdInfo
+zapCallArityInfo info = setCallArityInfo info 0
+
{-
************************************************************************
* *