[commit: ghc] wip/nomeata-T2110: In CoreSubst, optimize Coercible values aggressively (84b9e03)

git at git.haskell.org git at git.haskell.org
Mon Jan 27 13:05:46 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nomeata-T2110
Link       : http://ghc.haskell.org/trac/ghc/changeset/84b9e031defe87a03f6ddbc0af662d857727bbb6/ghc

>---------------------------------------------------------------

commit 84b9e031defe87a03f6ddbc0af662d857727bbb6
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Fri Jan 24 13:34:50 2014 +0000

    In CoreSubst, optimize Coercible values aggressively
    
    just like boxed type equalities.


>---------------------------------------------------------------

84b9e031defe87a03f6ddbc0af662d857727bbb6
 compiler/coreSyn/CoreSubst.lhs                        |    4 ++--
 testsuite/tests/ghci.debugger/scripts/print018.stdout |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/compiler/coreSyn/CoreSubst.lhs b/compiler/coreSyn/CoreSubst.lhs
index 3b39320..3dedbc8 100644
--- a/compiler/coreSyn/CoreSubst.lhs
+++ b/compiler/coreSyn/CoreSubst.lhs
@@ -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
 
diff --git a/testsuite/tests/ghci.debugger/scripts/print018.stdout b/testsuite/tests/ghci.debugger/scripts/print018.stdout
index 2686130..d5b7d46 100644
--- a/testsuite/tests/ghci.debugger/scripts/print018.stdout
+++ b/testsuite/tests/ghci.debugger/scripts/print018.stdout
@@ -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



More information about the ghc-commits mailing list