summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2020-10-05 15:24:39 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-10-17 22:02:13 -0400
commit7eb46a09e2188e64d226b75361b36ab732b5b372 (patch)
tree093f4cc2e362f9bd932e6e547786d7a1279f69f7 /testsuite
parent59d7c9f45b034809516703b57c84e3dac1834578 (diff)
downloadhaskell-7eb46a09e2188e64d226b75361b36ab732b5b372.tar.gz
Arity: Refactor fixed-point iteration in GHC.Core.Opt.Arity
Arity analysis used to propagate optimistic arity types during fixed-point interation through the `ArityEnv`'s `ae_cheap_fun` field, which is like `GHC.Core.Utils.exprIsCheap`, but also considers the current iteration's optimistic arity, for the binder in question only. In #18793, we have seen that this is a problematic design, because it doesn't allow us to look through PAP bindings of that binder. Hence this patch refactors to a more traditional form with an explicit signature environment, in which we record the optimistic `ArityType` of the binder in question (and at the moment is the *only* binder that is recorded in the arity environment).
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/simplCore/should_compile/T18231.stderr14
1 files changed, 7 insertions, 7 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T18231.stderr b/testsuite/tests/simplCore/should_compile/T18231.stderr
index 445192538b..ee5f474423 100644
--- a/testsuite/tests/simplCore/should_compile/T18231.stderr
+++ b/testsuite/tests/simplCore/should_compile/T18231.stderr
@@ -1,6 +1,6 @@
==================== Tidy Core ====================
-Result size of Tidy Core = {terms: 30, types: 22, coercions: 5, joins: 0/0}
+Result size of Tidy Core = {terms: 24, types: 20, coercions: 5, joins: 0/0}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
T18231.$trModule4 :: GHC.Prim.Addr#
@@ -23,14 +23,14 @@ T18231.$trModule :: GHC.Types.Module
T18231.$trModule = GHC.Types.Module T18231.$trModule3 T18231.$trModule1
Rec {
--- RHS size: {terms: 6, types: 1, coercions: 0, joins: 0/0}
-lvl :: GHC.Prim.Int# -> Data.Functor.Identity.Identity ((), Int)
-lvl = \ (x :: GHC.Prim.Int#) -> T18231.m1 (GHC.Types.I# (GHC.Prim.+# x 1#))
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+lvl :: Data.Functor.Identity.Identity ((), Int)
+lvl = lvl
+end Rec }
--- RHS size: {terms: 6, types: 3, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 5, types: 3, coercions: 0, joins: 0/0}
T18231.m1 :: Int -> Data.Functor.Identity.Identity ((), Int)
-T18231.m1 = \ (s1 :: Int) -> case s1 of { GHC.Types.I# x -> lvl x }
-end Rec }
+T18231.m1 = \ (eta2 :: Int) -> case eta2 of { GHC.Types.I# x -> lvl }
-- RHS size: {terms: 1, types: 0, coercions: 5, joins: 0/0}
m :: State Int ()