[commit: ghc] wip/tdammers/T14737-patch: Remove unnecessary check in simplCast (8044db8)
git at git.haskell.org
git at git.haskell.org
Thu Apr 5 09:37:06 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/tdammers/T14737-patch
Link : http://ghc.haskell.org/trac/ghc/changeset/8044db837a6678ab59b5a96a935678876d76cb6a/ghc
>---------------------------------------------------------------
commit 8044db837a6678ab59b5a96a935678876d76cb6a
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.
>---------------------------------------------------------------
8044db837a6678ab59b5a96a935678876d76cb6a
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