Commit f4fb94f3 authored by Joachim Breitner's avatar Joachim Breitner
Browse files

In CoreSubst, optimize Coercible values aggressively

just like boxed type equalities.
parent b4715d67
......@@ -61,7 +61,7 @@ import Coercion hiding ( substTy, substCo, extendTvSubst, substTyVarBndr, substC
import TyCon ( tyConArity )
import DataCon
import PrelNames ( eqBoxDataConKey )
import PrelNames ( eqBoxDataConKey, coercibleDataConKey )
import OptCoercion ( optCoercion )
import PprCore ( pprCoreBindings, pprRules )
import Module ( Module )
......@@ -1039,7 +1039,7 @@ maybe_substitute subst b r
trivial | exprIsTrivial r = True
| (Var fun, args) <- collectArgs r
, Just dc <- isDataConWorkId_maybe fun
, dc `hasKey` eqBoxDataConKey
, dc `hasKey` eqBoxDataConKey || dc `hasKey` coercibleDataConKey
, all exprIsTrivial args = True -- See Note [Optimise coercion boxes agressively]
| otherwise = False
......
......@@ -3,9 +3,9 @@ Stopped at ../Test.hs:40:1-17
_result :: () = _
Stopped at ../Test.hs:40:10-17
_result :: () = _
x :: a = _
x = (_t1::a)
x :: a
x :: a17 = _
x = (_t1::a17)
x :: a17
()
x = Unary
x :: Unary
......
......@@ -222,13 +222,14 @@ test('T3064',
# 2012-10-30: 111189536 (x86/Windows)
# 2013-11-13: 146626504 (x86/Windows, 64bit machine)
# 2014-01-22: 162457940 (x86/Linux)
(wordsize(64), 329795912, 5)]),
(wordsize(64), 308422280, 5)]),
# (amd64/Linux) (28/06/2011): 73259544
# (amd64/Linux) (07/02/2013): 224798696
# (amd64/Linux) (02/08/2013): 236404384, increase from roles
# (amd64/Linux) (11/09/2013): 290165632, increase from AMP warnings
# (amd64/Linux) (22/11/2013): 308300448, GND via Coercible and counters for constraints solving
# (amd64/Linux) (02/12/2013): 329795912, Coercible refactor
# (amd64/Linux) (02/12/2013): 329795912, Coercible refactor
# (amd64/Linux) (11/02/2014): 308422280, optimize Coercions in simpleOptExpr
compiler_stats_num_field('max_bytes_used',
[(wordsize(32), 7218200 , 20),
......
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