Commit ce9d6f25 authored by Simon Peyton Jones's avatar Simon Peyton Jones

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.
parent f02c915c
......@@ -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
......@@ -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'])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment