diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2020-04-09 13:25:17 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-26 03:04:04 -0400 |
commit | 6604906c8cfa37f5780a6d5c40506b751b1740db (patch) | |
tree | 7e8d49900a427b4a8b329e0b1664df3b365eaf76 /testsuite/tests/stranal/should_compile | |
parent | 53814a6424240ab50201fdde81a6e7832c1aad3d (diff) | |
download | haskell-6604906c8cfa37f5780a6d5c40506b751b1740db.tar.gz |
Make WorkWrap.Lib.isWorkerSmallEnough aware of the old arity
We should allow a wrapper with up to 82 parameters when the original
function had 82 parameters to begin with.
I verified that this made no difference on NoFib, but then again
it doesn't use huge records...
Fixes #18122.
Diffstat (limited to 'testsuite/tests/stranal/should_compile')
-rw-r--r-- | testsuite/tests/stranal/should_compile/T18122.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/stranal/should_compile/T18122.stderr | 83 | ||||
-rw-r--r-- | testsuite/tests/stranal/should_compile/all.T | 3 |
3 files changed, 92 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_compile/T18122.hs b/testsuite/tests/stranal/should_compile/T18122.hs new file mode 100644 index 0000000000..fee63f9bfe --- /dev/null +++ b/testsuite/tests/stranal/should_compile/T18122.hs @@ -0,0 +1,6 @@ +{-# OPTIONS_GHC -fforce-recomp -O2 -fmax-worker-args=1 #-} +module Lib where + +foo :: (Int, Int) -> Int -> Int +foo (x, y) z = x+z +{-# NOINLINE foo #-} diff --git a/testsuite/tests/stranal/should_compile/T18122.stderr b/testsuite/tests/stranal/should_compile/T18122.stderr new file mode 100644 index 0000000000..ff18350279 --- /dev/null +++ b/testsuite/tests/stranal/should_compile/T18122.stderr @@ -0,0 +1,83 @@ + +==================== Tidy Core ==================== +Result size of Tidy Core + = {terms: 35, types: 27, coercions: 0, joins: 0/0} + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Lib.$trModule4 :: GHC.Prim.Addr# +[GblId, + Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, + WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] +Lib.$trModule4 = "main"# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Lib.$trModule3 :: GHC.Types.TrName +[GblId, + Cpr=m1, + Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, + WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] +Lib.$trModule3 = GHC.Types.TrNameS Lib.$trModule4 + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Lib.$trModule2 :: GHC.Prim.Addr# +[GblId, + Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, + WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] +Lib.$trModule2 = "Lib"# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Lib.$trModule1 :: GHC.Types.TrName +[GblId, + Cpr=m1, + Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, + WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] +Lib.$trModule1 = GHC.Types.TrNameS Lib.$trModule2 + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +Lib.$trModule :: GHC.Types.Module +[GblId, + Cpr=m1, + Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, + WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}] +Lib.$trModule = GHC.Types.Module Lib.$trModule3 Lib.$trModule1 + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Lib.$wfoo [InlPrag=NOINLINE] + :: GHC.Prim.Int# -> GHC.Prim.Int# -> GHC.Prim.Int# +[GblId, Arity=2, Str=<L,U><L,U>, Unf=OtherCon []] +Lib.$wfoo = (GHC.Prim.+#) + +-- RHS size: {terms: 18, types: 14, coercions: 0, joins: 0/0} +foo [InlPrag=NOUSERINLINE[0]] :: (Int, Int) -> Int -> Int +[GblId, + Arity=2, + Str=<S(SL),1*U(1*U(U),A)><S,1*U(U)>, + Cpr=m1, + Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, + WorkFree=True, Expandable=True, + Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=False) + Tmpl= \ (w_sHs [Occ=Once!] :: (Int, Int)) + (w1_sHt [Occ=Once!] :: Int) -> + case w_sHs of { (ww1_sHw [Occ=Once!], _ [Occ=Dead]) -> + case ww1_sHw of { GHC.Types.I# ww4_sHz [Occ=Once] -> + case w1_sHt of { GHC.Types.I# ww6_sHF [Occ=Once] -> + case Lib.$wfoo ww4_sHz ww6_sHF of ww7_sHJ [Occ=Once] { __DEFAULT -> + GHC.Types.I# ww7_sHJ + } + } + } + }}] +foo + = \ (w_sHs :: (Int, Int)) (w1_sHt :: Int) -> + case w_sHs of { (ww1_sHw, ww2_sHB) -> + case ww1_sHw of { GHC.Types.I# ww4_sHz -> + case w1_sHt of { GHC.Types.I# ww6_sHF -> + case Lib.$wfoo ww4_sHz ww6_sHF of ww7_sHJ { __DEFAULT -> + GHC.Types.I# ww7_sHJ + } + } + } + } + + + diff --git a/testsuite/tests/stranal/should_compile/all.T b/testsuite/tests/stranal/should_compile/all.T index e807e4f9d8..bb3fcd2952 100644 --- a/testsuite/tests/stranal/should_compile/all.T +++ b/testsuite/tests/stranal/should_compile/all.T @@ -52,3 +52,6 @@ test('T17852', [ grep_errmsg(r'\\$wf ::') ], compile, ['-ddump-worker-wrapper - test('T16029', normal, makefile_test, []) test('T10069', [ grep_errmsg(r'(wc1).*Int#$') ], compile, ['-dppr-cols=200 -ddump-simpl']) test('T13380b', [ grep_errmsg('bigDeadAction') ], compile, ['-dppr-cols=200 -ddump-simpl']) + +# We just want to find the worker of foo in there: +test('T18122', [ grep_errmsg(r'wfoo =') ], compile, ['-ddump-simpl']) |