summaryrefslogtreecommitdiff
path: root/testsuite/tests/perf/compiler
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2014-11-03 10:37:59 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2014-11-04 10:38:07 +0000
commitce9d6f251f9764f769f5ebd8c6130809b6b0d159 (patch)
tree4c057fda19ba1db2e25d2ffcb1aa100e19958417 /testsuite/tests/perf/compiler
parentf02c915c1583e40d614dfd97047d5117a9b8a9a5 (diff)
downloadhaskell-ce9d6f251f9764f769f5ebd8c6130809b6b0d159.tar.gz
Compiler performance is much worse in for loopy givens
This is a deliberate choice, to simplify code, invariants, and I think performance in typical cases. The "loopy givens" case is situations like [G] a ~ TF (a, Int) where TF is a type function with TF (a,b) = (TF a, TF b). See Note [An alternative story for the inert substitution] in TcFlatten.
Diffstat (limited to 'testsuite/tests/perf/compiler')
-rw-r--r--testsuite/tests/perf/compiler/T5837.hs40
-rw-r--r--testsuite/tests/perf/compiler/all.T4
2 files changed, 38 insertions, 6 deletions
diff --git a/testsuite/tests/perf/compiler/T5837.hs b/testsuite/tests/perf/compiler/T5837.hs
index 1dc3c33cd9..6ebbd65bd5 100644
--- a/testsuite/tests/perf/compiler/T5837.hs
+++ b/testsuite/tests/perf/compiler/T5837.hs
@@ -10,14 +10,44 @@ t = undefined
{-
- [G] a ~ TF (a,Int)
+ [G] a ~ TF (a,Int) -- a = a_am1
-->
- TF (a,Int) ~ fsk
- fsk ~ a
+ [G] TF (a,Int) ~ fsk -- fsk = fsk_am8
+inert [G] fsk ~ a
+
--->
- fsk ~ (TF a, TF Int)
- fsk ~ a
+ [G] fsk ~ (TF a, TF Int)
+inert [G] fsk ~ a
+
--->
a ~ (TF a, TF Int)
+inert [G] fsk ~ a
+
+---> (attempting to flatten (TF a) so that it does not mention a
+ TF a ~ fsk2
+inert a ~ (fsk2, TF Int)
+inert fsk ~ (fsk2, TF Int)
+
+---> (substitute for a)
+ TF (fsk2, TF Int) ~ fsk2
+inert a ~ (fsk2, TF Int)
+inert fsk ~ (fsk2, TF Int)
+
+---> (top-level reduction, re-orient)
+ fsk2 ~ (TF fsk2, TF Int)
+inert a ~ (fsk2, TF Int)
+inert fsk ~ (fsk2, TF Int)
+
+---> (attempt to flatten (TF fsk2) to get rid of fsk2
+ TF fsk2 ~ fsk3
+ fsk2 ~ (fsk3, TF Int)
+inert a ~ (fsk2, TF Int)
+inert fsk ~ (fsk2, TF Int)
+
+--->
+ TF fsk2 ~ fsk3
+inert fsk2 ~ (fsk3, TF Int)
+inert a ~ ((fsk3, TF Int), TF Int)
+inert fsk ~ ((fsk3, TF Int), TF Int)
-} \ No newline at end of file
diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T
index 76aee352b1..6df8210dee 100644
--- a/testsuite/tests/perf/compiler/all.T
+++ b/testsuite/tests/perf/compiler/all.T
@@ -455,7 +455,7 @@ test('T5837',
# 40000000 (x86/Linux)
# 2013-11-13: 45520936 (x86/Windows, 64bit machine)
# 2041-09-03: 37096484 (Windows laptop, w/w for INLINABLE things
- (wordsize(64), 75765728, 10)])
+ (wordsize(64), 651924880, 10)])
# sample: 3926235424 (amd64/Linux, 15/2/2012)
# 2012-10-02 81879216
# 2012-09-20 87254264 amd64/Linux
@@ -464,6 +464,8 @@ test('T5837',
# for constraints solving
# 2014-08-29 73639840 amd64/Linux, w/w for INLINABLE things
# 2014-10-08 73639840 amd64/Linux, Burning Bridges and other small changes
+ # 2014-11-02 651924880 Linux, Accept big regression;
+ # See Note [An alternative story for the inert substitution] in TcFlatten
],
compile_fail,['-ftype-function-depth=50'])