
#15304: Huge increase of compile time and memory use from 8.0.2 to 8.2.2 or 8.4.2 -------------------------------------+------------------------------------- Reporter: NathanWaivio | Owner: tdammers Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.4.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by tdammers): OK, next experiment: compile with `-fno-specialise`, and diff `-ddump- simpl-stats` output (minus the PreInline and PostInline parts). Which gives us: {{{#!diff --- stats-8.0.2/Cl3.dump-simpl-stats 2018-07-12 16:25:23.219578828 +0200 +++ stats-8.4.3/Cl3.dump-simpl-stats 2018-07-12 16:42:41.644219237 +0200 @@ -1,74 +1,78 @@ ==================== FloatOut stats: ==================== -2018-07-12 13:46:13.85196043 UTC +2018-07-12 14:25:41.716397419 UTC -140 Lets floated to top level; 0 Lets floated elsewhere; from 35 Lambda groups +131 Lets floated to top level; 0 Lets floated elsewhere; from 22 Lambda groups ==================== FloatOut stats: ==================== -2018-07-12 13:46:17.767931325 UTC +2018-07-12 14:26:18.231633767 UTC -24 Lets floated to top level; 0 Lets floated elsewhere; from 42 Lambda groups +1 Lets floated to top level; 0 Lets floated elsewhere; from 25 Lambda groups ==================== Grand total simplifier statistics ==================== -2018-07-12 13:46:19.653844196 UTC +2018-07-12 14:26:39.421166819 UTC -Total ticks: 44196 +Total ticks: 91304 -6609 UnfoldingDone - 1681 GHC.Float.$fNumDouble_$c* +5077 UnfoldingDone 1681 GHC.Float.timesDouble - 729 GHC.Float.$fNumDouble_$c+ 729 GHC.Float.plusDouble - 415 GHC.Float.$fNumDouble_$c- 415 GHC.Float.minusDouble + 177 $j_s6gs + 177 $j_s6kx 137 Algebra.Geometric.Cl3.$WAPS + 132 $j_s6gn + 132 $j_s6gq + 132 $j_s6ks + 132 $j_s6kv + 121 $j_s6cS + 121 $j_s6gX + 110 $j_s6PQ + 110 $j_s71Q 102 GHC.Base.$ - 102 GHC.Float.$fNumDouble_$cnegate 102 GHC.Float.negateDouble - 62 $j_s5Li - 62 $j_s5LN + 44 $j_s6gm + 44 $j_s6gr + 44 $j_s6kr + 44 $j_s6kw + 25 Algebra.Geometric.Cl3.$WR + 22 $j_s6gi + 22 $j_s6go + 22 $j_s6kn + 22 $j_s6kt 19 Algebra.Geometric.Cl3.$WH 19 Algebra.Geometric.Cl3.$WODD - 17 Algebra.Geometric.Cl3.$WR 17 Algebra.Geometric.Cl3.$WBPV - 15 $c/_a1Af - 14 GHC.Float.$fFloatingDouble_$csqrt + 17 $j_s6cc 14 GHC.Float.sqrtDouble 14 Algebra.Geometric.Cl3.$WC - 12 $j_s5Le - 12 $j_s5Lg - 12 $j_s5LJ - 12 $j_s5LL 11 Algebra.Geometric.Cl3.$WPV 11 Algebra.Geometric.Cl3.$WTPV - 10 $j_s5Lf - 10 $j_s5LK - 9 $cfromInteger_a3eU - 8 $c*_a1He - 7 $c+_a1Az - 6 $clog1p_a1zz - 6 $s$clog_s614 - 5 $cnegate_a36c + 8 $c*_a2h6 + 8 GHC.Float.$fNumDouble_$cfromInteger + 7 $cfromInteger_a3OM + 7 $j_s6gp + 7 $j_s6ku + 6 $c/_a2ad + 6 $c+_a2at 5 Algebra.Geometric.Cl3.$WV3 5 Algebra.Geometric.Cl3.$WBV - 5 lvl_s5VO - 5 lvl_s5VP - 4 $c-_a1H7 - 4 GHC.Float.$fNumDouble_$cabs - 4 $j_s5Lb - 4 $j_s5Lc - 4 $j_s5Ld - 4 $j_s5Lh - 4 $j_s5LG - 4 $j_s5LH - 4 $j_s5LI - 4 $j_s5LM - 3 $c**_a1yF + 4 $clog1p_a29F + 4 $cnegate_a3G4 + 4 GHC.Float.fabsDouble + 4 $j_s6c8 + 4 $j_s6ca + 4 $j_s6gj + 4 $j_s6gk + 4 $j_s6ko + 4 $j_s6kp + 3 Algebra.Geometric.Cl3.projEigs 3 Algebra.Geometric.Cl3.$WI - 3 $j_s5J8 - 3 $j_s5Jo + 2 $c**_a28T + 2 $crecip_a2ak + 2 $c-_a2h1 2 GHC.Base.$! 2 GHC.Float.$dm** 2 GHC.Float.$dmexpm1 @@ -82,318 +86,359 @@ 2 GHC.Real.$dm/ 2 GHC.Real.$dmrecip 2 GHC.Num.$dm- + 2 Algebra.Geometric.Cl3.spectraldcmp 2 Algebra.Geometric.Cl3.reduce - 2 $dNum_s5Id - 2 $dNum_s5It - 2 lvl_s5VK - 1 $cabs_a36g - 1 GHC.Float.$fRealFloatDouble_$catan2 - 1 GHC.Float.$fNumDouble_$cfromInteger - 1 GHC.Float.$fFractionalDouble_$crecip - 1 GHC.Float.$fFloatingDouble_$ccos - 1 GHC.Float.$fFloatingDouble_$csin - 1 GHC.Float.$fFloatingDouble_$clog - 1 GHC.Float.$fFloatingDouble_$cexp - 1 GHC.Float.sinDouble - 1 GHC.Float.logDouble - 1 GHC.Float.expDouble + 2 $j_s6gl + 2 $j_s6kq + 1 $cabs_a3G8 1 GHC.Float.cosDouble - 1 Algebra.Geometric.Cl3.projEigs - 1 $s$dmlog1pexp_s5Ge - 1 lvl_s5I8 - 1 lvl_s5I9 - 1 $dFractional_s5Ib - 1 lvl_s5Ik - 1 lvl_s5Il - 1 lvl_s5Im - 1 lvl_s5In - 1 lvl_s5Io - 1 lvl_s5Ip - 1 $dFractional_s5Ir - 1 lvl_s5Iw - 1 lvl_s5W0 -3337 RuleFired - 1695 Class op * - 737 Class op + - 419 Class op - - 127 *## - 109 Class op negate + 1 GHC.Float.expDouble + 1 GHC.Float.logDouble + 1 GHC.Float.sinDouble + 1 GHC.Float.$fFractionalDouble_$crecip + 1 GHC.Float.$fRealFloatDouble_$catan2 + 1 lvl_s6br + 1 lvl_s6bs + 1 lvl_s6bu + 1 lvl_s6bv + 1 lvl_s6bx + 1 $j_s6c9 + 1 lvl_s7OD + 1 lvl_s7OE +3532 RuleFired + 1691 Class op * + 734 Class op + + 417 Class op - + 372 +## + 106 Class op negate 55 ^2/Integer - 26 +## - 25 Class op $p1Floating - 20 Class op $p1Fractional - 15 Class op / - 14 Class op exp - 14 Class op log + 44 *## + 16 Class op $p1Floating 14 Class op sqrt - 13 Class op fromInteger - 9 doubleFromInteger - 6 Class op log1p - 6 SC:$clog0 + 12 Class op $p1Fractional + 10 Class op exp + 10 Class op log + 8 Class op / + 8 Class op fromInteger + 7 doubleFromInteger 5 Class op abs - 4 Class op cos - 4 Class op fromRational - 4 Class op recip - 4 Class op sin - 3 Class op ** - 3 Class op cosh - 3 Class op sinh + 4 Class op log1p + 3 Class op cos + 3 Class op recip + 3 Class op sin + 2 Class op ** + 2 Class op cosh + 2 Class op fromRational + 2 Class op sinh 1 Class op atan2 1 Class op pi - 1 SC:$w$catan20 -25 LetFloatFromLet 25 -1 EtaReduction 1 x_a5bv -9652 BetaReduction - 1681 ds_a5IW - 1681 ds1_a5IX - 729 ds_a5IM - 729 ds1_a5IN - 415 ds_a5Jb - 415 ds1_a5Jc - 137 dt_a1fe - 137 dt_a1ff - 137 dt_a1fg - 137 dt_a1fh - 137 dt_a1fi - 137 dt_a1fj - 137 dt_a1fk - 137 dt_a1fl - 124 dt_d5iD - 124 dt_d5iE - 124 dt_d5iF - 124 dt_d5iG - 124 dt_d5iH - 124 dt_d5iI - 124 dt_d5iJ - 124 dt_d5iK - 102 a_12 - 102 b_13 - 102 r_1j - 102 tpl_B1 - 102 tpl_B2 - 102 ds_a5JB - 55 a_a5nS - 55 $dNum_a5nT - 55 $dIntegral_a5nU - 55 x_a5nV - 24 dt_d5iP - 24 dt_d5iQ - 24 dt_d5iR - 24 dt_d5iS - 24 dt_d5j1 - 24 dt_d5j2 - 24 dt_d5j3 - 24 dt_d5j4 - 20 dt_d5iT - 20 dt_d5iU - 20 dt_d5iV - 20 dt_d5iW - 20 dt_d5iX - 20 dt_d5iY - 19 dt_a1eq - 19 dt_a1er - 19 dt_a1es - 19 dt_a1et - 19 dt_a1eU - 19 dt_a1eV - 19 dt_a1eW - 19 dt_a1eX - 17 dt_a1dS - 17 dt_a1eG - 17 dt_a1eH - 17 dt_a1eI - 17 dt_a1eJ - 17 dt_a1eK - 17 dt_a1eL - 16 eta_a53E - 16 eta1_a53F - 14 dt_a1eA - 14 dt_a1eB - 14 ds_a5IH - 12 sc_s60u - 12 sc_s60v - 11 dt_a1eg - 11 dt_a1eh - 11 dt_a1ei - 11 dt_a1ej - 11 dt_a1f4 - 11 dt_a1f5 - 11 dt_a1f6 - 11 dt_a1f7 - 9 int_a1bM - 8 ds_d4ON - 8 ds_d4OO - 8 dt_d5iL - 8 dt_d5iM - 8 dt_d5iN - 8 dt_d5iO - 8 dt_d5j5 - 8 dt_d5j6 - 8 dt_d5j7 - 8 dt_d5j8 - 8 dt_d5ja - 8 dt_d5jb - 8 dt_d5jc - 8 dt_d5jd - 8 dt_d5je - 8 dt_d5jf - 7 eta_a53o - 7 ds_d4CK - 7 ds_d4CL - 6 y_X5Nf - 5 x_a1bN - 5 dt_a1dW - 5 dt_a1dX - 5 dt_a1dY - 5 dt_a1e4 - 5 dt_a1e5 - 5 dt_a1e6 - 5 x_a5bv - 5 y_a5bw - 4 eta_a53a - 4 eta1_a53b - 4 x_a5mY - 3 dt_a1ec - 2 cliffor_aIx - 2 r_aIz - 2 a_a533 - 2 $dFloating_a534 - 2 a_a538 - 2 $dFloating_a539 - 2 a_a53c - 2 $dFloating_a53d - 2 a_a53g - 2 $dFloating_a53h - 2 a_a53j - 2 $dFloating_a53k - 2 a_a53m - 2 $dFloating_a53n - 2 a_a53r - 2 $dFloating_a53s - 2 a_a53w - 2 $dFloating_a53x - 2 a_a53z - 2 $dFloating_a53A - 2 a_a53C - 2 $dFractional_a53D - 2 a_a53G - 2 $dFractional_a53H - 2 a_a5bt - 2 $dNum_a5bu - 2 a_a5mH - 2 b_a5mI - 2 f_a5mJ - 2 x_a5mK - 2 dt_d5et - 2 dt_d5eu - 1 eta_a535 - 1 eta_a53e - 1 eta1_a53f - 1 eta_a53i - 1 eta_a53l - 1 eta_a53t - 1 x_a53y - 1 eta_a53B - 1 eta_a53I - 1 i_a5mT - 1 x_a5oJ - 1 w_a5p8 - 1 w1_a5p9 - 1 ds_a5K6 - 1 ds_a5Kc - 1 ds_a5Kh - 1 ds_a5Kp - 1 sc_a5PU - 1 sc1_a5PV - 1 ds_d4AC - 1 ds_d4BO - 1 ds_d4CI - 1 ds_d50R - 1 ds_d52M - 1 w_s5RT -9 CaseOfCase - 2 wild_X9 - 2 wild_XV - 2 dt_X1dU - 2 wild1_a5J2 - 1 ww_s5RV -7664 KnownBranch - 1685 wild1_a5J2 - 1681 wild_a5IY - 729 wild_a5IO - 729 wild1_a5IS - 415 wild_a5Jd - 415 wild1_a5Jh - 248 wild_X9 - 137 dt_X1fn - 137 dt_X1fq - 137 dt_X1ft - 137 dt_X1fw - 137 dt_X1fz - 137 dt_X1fC - 137 dt_X1fF - 137 dt_X1fI - 102 wild_a5JC - 36 dt_X1eZ - 36 dt_X1f2 - 25 wild_XV - 21 dt_X1dU - 19 dt_X1ev - 19 dt_X1ey - 19 dt_X1eB - 19 dt_X1eE - 19 dt_X1f5 - 19 dt_X1f8 - 19 ww_s5RV - 17 dt_X1eN - 17 dt_X1eQ - 17 dt_X1eT - 17 dt_X1eW - 14 dt_X1eD - 14 dt_X1eG - 14 wild_a5II - 12 wild_Xf - 11 dt_X1el - 11 dt_X1eo - 11 dt_X1er - 11 dt_X1eu - 11 dt_X1f9 - 11 dt_X1fc - 11 dt_X1ff - 11 dt_X1fi - 9 wild_a5mU - 8 wild_Xg - 8 dt_X1ee - 6 wild_Xd - 5 wild_Xb - 5 wild_XW - 5 dt_X1e0 - 5 dt_X1e3 - 5 dt_X1e6 - 5 dt_X1e8 - 5 dt_X1eb - 4 wild_Xa +687 LetFloatFromLet 687 +2 EtaReduction + 1 eta_B2 + 1 x_a5TK +14750 BetaReduction + 1681 ds_a65p + 1681 ds1_a65q + 729 ds_a64o + 729 ds1_a64p + 415 ds_a65z + 415 ds1_a65A + 354 dt_d5SW + 354 dt_d5SX + 354 dt_d5SY + 354 dt_d5SZ + 354 dt_d5T0 + 354 dt_d5T1 + 354 dt_d5T2 + 354 dt_d5T3 + 264 dt_d5Po + 264 dt_d5Pp + 264 dt_d5Pq + 264 dt_d5Pr + 264 dt_d5Rw + 264 dt_d5Rx + 264 dt_d5Ry + 264 dt_d5Rz + 242 vx_a63F + 226 ds_d5kP + 137 dt_a1Gh + 137 dt_a1Gi + 137 dt_a1Gj + 137 dt_a1Gk + 137 dt_a1Gl + 137 dt_a1Gm + 137 dt_a1Gn + 137 dt_a1Go + 102 a_11 + 102 b_12 + 102 r_1i + 102 v_B1 + 102 v_B2 + 102 ds_a65W + 88 dt_d5OG + 88 dt_d5OH + 88 dt_d5OI + 88 dt_d5OJ + 88 dt_d5Se + 88 dt_d5Sf + 88 dt_d5Sg + 88 dt_d5Sh + 55 a_a64W + 55 $dNum_a64X + 55 $dIntegral_a64Y + 55 x_a64Z + 44 dt_d5LY + 44 dt_d5Q6 + 44 dt_d5Q7 + 25 dt_a1EV + 19 dt_a1Ft + 19 dt_a1Fu + 19 dt_a1Fv + 19 dt_a1Fw + 19 dt_a1FX + 19 dt_a1FY + 19 dt_a1FZ + 19 dt_a1G0 + 17 dt_a1FJ + 17 dt_a1FK + 17 dt_a1FL + 17 dt_a1FM + 17 dt_a1FN + 17 dt_a1FO + 17 dt_d5Uj + 17 dt_d5Uk + 17 dt_d5Ul + 17 dt_d5Um + 17 dt_d5Un + 17 dt_d5Uo + 17 dt_d5Up + 17 dt_d5Uq + 14 dt_a1FD + 14 dt_a1FE + 14 ds_a64j + 14 dt_d5QM + 14 dt_d5QN + 14 dt_d5QO + 14 dt_d5QP + 14 dt_d5QQ + 14 dt_d5QR + 11 dt_a1Fj + 11 dt_a1Fk + 11 dt_a1Fl + 11 dt_a1Fm + 11 dt_a1G7 + 11 dt_a1G8 + 11 dt_a1G9 + 11 dt_a1Ga + 8 i_a63N + 8 ds_d5wR + 8 ds_d5wS + 8 dt_d5MD + 8 dt_d5ME + 8 dt_d5MF + 8 dt_d5Nk + 8 dt_d5Nl + 8 dt_d5Nm + 7 int_a1BT + 6 ds_d5kO + 6 w_s6Mj + 6 w_s6Mk + 5 dt_a1EZ + 5 dt_a1F0 + 5 dt_a1F1 + 5 dt_a1F7 + 5 dt_a1F8 + 5 dt_a1F9 + 5 x_a5LB + 4 x_a1BU + 4 ds_a63S + 4 dt_d5O1 + 4 dt_d5TZ + 4 dt_d5U0 + 4 dt_d5U1 + 4 dt_d5U2 + 4 dt_d5Ub + 4 dt_d5Uc + 4 dt_d5Ud + 4 dt_d5Ue + 3 dt_a1Ff + 3 x_a5Li + 3 y_a5Lj + 3 x_a5LX + 3 w_s6Mz + 2 function_a1BV + 2 cliffor_a1BW + 2 r_a1C1 + 2 a_a5L7 + 2 $dFloating_a5L8 + 2 a_a5Le + 2 $dFloating_a5Lf + 2 a_a5Lk + 2 $dFloating_a5Ll + 2 a_a5Lp + 2 $dFloating_a5Lq + 2 a_a5Lt + 2 $dFloating_a5Lu + 2 a_a5Lx + 2 $dFloating_a5Ly + 2 a_a5LC + 2 $dFloating_a5LD + 2 a_a5LH + 2 $dFloating_a5LI + 2 a_a5LK + 2 $dFloating_a5LL + 2 a_a5LP + 2 $dFractional_a5LQ + 2 a_a5LU + 2 $dFractional_a5LV + 2 a_a5TI + 2 $dNum_a5TJ + 2 a_a63B + 2 b_a63C + 2 f_a63D + 2 x_a63E + 1 x_a5La + 1 x_a5Ln + 1 y_a5Lo + 1 x_a5Ls + 1 x_a5Lw + 1 x_a5LG + 1 x_a5LJ + 1 x_a5LO + 1 x_a5LS + 1 y_a5LT + 1 x_a5TK + 1 y_a5TL + 1 x_a66T + 1 ds_a67a + 1 ds_a67g + 1 ds_a67l + 1 ds_a67s + 1 w_a67O + 1 w1_a67P + 1 dt_d5TO + 1 dt_d5TP + 1 dt_d5TQ + 1 dt_d5TR + 1 dt_d5TS + 1 dt_d5TT + 1 dt_d5TV + 1 dt_d5TW + 1 dt_d5TX + 1 dt_d5TY + 1 dt_d5U5 + 1 dt_d5U6 + 1 dt_d5U7 + 1 dt_d5U8 + 1 dt_d5U9 + 1 dt_d5Ua + 1 dt_d5Uf + 1 dt_d5Ug + 1 dt_d5Uh + 1 dt_d5Ui + 1 dt_d5XU + 1 dt_d5XV + 1 w_s6M9 +7 CaseOfCase + 2 wild_X16 + 2 vx_a63F + 1 wild_X9 + 1 wild_X15 + 1 ww_s6Mb +13525 KnownBranch + 1681 wild_a65r + 1681 wild1_a65v + 1211 wild_Xo + 888 wild_Xf + 884 wild_Xg + 729 wild_a64q + 729 wild1_a64u + 565 wild_X9 + 444 wild_Xd + 415 wild_a65B + 415 wild1_a65F + 266 wild_Xa + 242 wild_X1i + 242 vx_a63F + 223 wild_Xb + 223 wild_X16 + 222 wild_Xj + 222 wild_Xn + 221 wild_Xc + 178 wild_Xe + 155 wild_Xk + 137 dt_X1Gq + 137 dt_X1Gt + 137 dt_X1Gw + 137 dt_X1Gz + 137 dt_X1GC + 137 dt_X1GF + 137 dt_X1GI + 137 dt_X1GL + 102 wild_a65X + 36 dt_X1G2 + 36 dt_X1G5 + 25 dt_X1EX + 19 dt_X1Fy + 19 dt_X1FB + 19 dt_X1FE + 19 dt_X1FH + 19 dt_X1G8 + 19 dt_X1Gb + 17 dt_X1FQ + 17 dt_X1FT + 17 dt_X1FW + 17 dt_X1FZ + 14 dt_X1FG + 14 dt_X1FJ + 14 wild_a64k + 12 wild_X15 + 11 dt_X1Fo + 11 dt_X1Fr + 11 dt_X1Fu + 11 dt_X1Fx + 11 dt_X1Gc + 11 dt_X1Gf + 11 dt_X1Gi + 11 dt_X1Gl + 11 ww_s6Mb + 8 dt_X1Fh + 7 wild_a63O + 5 dt_X1F3 + 5 dt_X1F6 + 5 dt_X1F9 + 5 dt_X1Fb + 5 dt_X1Fe + 4 wild_X2i + 4 wild_a63T + 1 wild_X2a + 1 wild_a66U + 1 wild_a67b + 1 wild_a67h + 1 wild_a67m + 1 wild_a67t + 1 ww_a67Q + 1 ds_d5JX + 1 ww_s6MB + 1 ww_s6MH + 1 ww_s6Ne +18 SimplifierDone 18 +76 AltMerge + 8 wild_X4B + 8 wild_X4C + 8 wild_X4E + 8 wild_X4F + 8 wild_X4G + 6 wild_X4D 4 wild_Xe - 4 wild_a5mZ - 3 wild_Xj - 3 wild_Xn + 4 wild_Xg + 4 wild_X4H + 3 wild_X4x + 3 wild_X4y + 3 wild_X4I + 2 wild_Xa 2 wild_Xc - 2 wild_Xk - 2 wild_Xo - 1 wild_X1C - 1 wild_X1M - 1 wild_X1O - 1 wild_a5oK - 1 ww_a5pa - 1 wild_a5K7 - 1 wild_a5Kd - 1 wild_a5Ki - 1 wild_a5Kq - 1 ds_d4AR - 1 ds_d4AS - 1 ds_d51T - 1 ww_s5Sj -2 CaseMerge 2 vx_a5mL -1 CaseIdentity 1 wild_X9 -21 SimplifierDone 21 + 2 wild_X4z + 2 wild_X4A + 1 wild_X4J }}} (Left / before / red: GHC 8.0.2; right / after / green: GHC 8.4.3). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15304#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler