[commit: ghc] wip/tdammers/D4568: Remove unnecessary check in simplCast (d959087)

git at git.haskell.org git at git.haskell.org
Mon Apr 16 05:47:08 UTC 2018


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

On branch  : wip/tdammers/D4568
Link       : http://ghc.haskell.org/trac/ghc/changeset/d9590878863762a85a85c011247e4a3b2ffbddda/ghc

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

commit d9590878863762a85a85c011247e4a3b2ffbddda
Author: Tobias Dammers <tdammers at gmail.com>
Date:   Tue Apr 3 13:49:40 2018 +0200

    Remove unnecessary check in simplCast
    
    The coercion optimizer will take care of it anyway, and the check is
    prohibitively expensive.
    
    See Trac #14737.


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

d9590878863762a85a85c011247e4a3b2ffbddda
 compiler/coreSyn/CoreOpt.hs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/compiler/coreSyn/CoreOpt.hs b/compiler/coreSyn/CoreOpt.hs
index e1eae8b..4b305fa 100644
--- a/compiler/coreSyn/CoreOpt.hs
+++ b/compiler/coreSyn/CoreOpt.hs
@@ -958,8 +958,10 @@ pushCoTyArg :: CoercionR -> Type -> Maybe (Type, Maybe CoercionR)
 -- If the returned coercion is Nothing, then it would have been reflexive;
 -- it's faster not to compute it, though.
 pushCoTyArg co ty
-  | tyL `eqType` tyR
-  = Just (ty, Nothing)
+  -- The following is inefficient - don't do `eqType` here, the coercion
+  -- optimizer will take care of it. See Trac #14737.
+  -- | tyL `eqType` tyR
+  -- = Just (ty, Nothing)
 
   | isForAllTy tyL
   = ASSERT2( isForAllTy tyR, ppr co $$ ppr ty )



More information about the ghc-commits mailing list