diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-01-06 09:35:37 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2017-01-06 10:51:19 +0000 |
commit | b4f2afe70ddbd0576b4eba3f82ba1ddc52e9b3bd (patch) | |
tree | 74b5534b1c427df695e2ca6b1f228ce40601c07b /testsuite/tests/perf | |
parent | 3540d1e1a23926ce0a8a6ae83a36f5f6b2497ccf (diff) | |
download | haskell-b4f2afe70ddbd0576b4eba3f82ba1ddc52e9b3bd.tar.gz |
Fix the implementation of the "push rules"
Richard pointed out (comment:12 of Trac #13025) that my
implementation of the coercion "push rules", newly added
in exprIsConAppMaybe by commit b4c3a66, wasn't quite right.
But in fact that means that the implementation of those same
rules in Simplify.simplCast was wrong too.
Hence this commit:
* Refactor the push rules so they are implemented in just
one place (CoreSubst.pushCoArgs, pushCoTyArg, pushCoValArg)
The code in Simplify gets simpler, which is nice.
* Fix the bug that Richard pointed out (to do with hetero-kinded
coercions)
Then compiler performance worsened, which led mt do discover
two performance bugs:
* The smart constructor Coercion.mkNthCo didn't have a case
for ForAllCos, which meant we stupidly build a complicated
coercion where a simple one would do
* In OptCoercion there was one place where we used CoherenceCo
(the data constructor) rather than mkCoherenceCo (the smart
constructor), which meant that the the stupid complicated
coercion wasn't optimised away
For reasons I don't fully understand, T5321Fun did 2% less compiler
allocation after all this, which is good.
Diffstat (limited to 'testsuite/tests/perf')
-rw-r--r-- | testsuite/tests/perf/compiler/all.T | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 87a6c8184d..c9ed905926 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -501,7 +501,7 @@ test('T5321Fun', # 2014-09-03: 299656164 (specialisation and inlining) # 10/12/2014: 206406188 # Improvements in constraint solver # 2016-04-06: 279922360 x86/Linux - (wordsize(64), 565883176, 10)]) + (wordsize(64), 497356688, 5)]) # prev: 585521080 # 29/08/2012: 713385808 # (increase due to new codegen) # 15/05/2013: 628341952 # (reason for decrease unknown) @@ -515,6 +515,9 @@ test('T5321Fun', # (undefined now takes an implicit parameter and GHC -O0 does # not recognize that the application is bottom) # 11/12/2015: 565883176 # TypeInType (see #11196) + # 06/01/2017: 497356688 # Small coercion optimisations + # The actual decrease was only 2%; earlier + # commits had drifted down ], compile,['']) |