diff options
| author | Tobias Dammers <tdammers@gmail.com> | 2018-04-20 16:38:34 -0400 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2018-04-20 18:04:19 -0400 |
| commit | 2a5bdd9adb1cb4afecd3303f0cfcc224be5ce745 (patch) | |
| tree | bc8b6294660537075f811d98f9ff804cc6a6d4fb /compiler | |
| parent | da7438526e4bfb1821aa77a22ff66a4a80baf8c6 (diff) | |
| download | haskell-2a5bdd9adb1cb4afecd3303f0cfcc224be5ce745.tar.gz | |
Remove unnecessary check in simplCast
The coercion optimizer will take care of it anyway, and the check is
prohibitively expensive.
See Trac #14737.
Reviewers: bgamari
Subscribers: simonpj, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4568
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/coreSyn/CoreOpt.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/coreSyn/CoreOpt.hs b/compiler/coreSyn/CoreOpt.hs index 372c2ea5aa..f1ff68d133 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 ) @@ -991,8 +993,10 @@ pushCoValArg :: CoercionR -> Maybe (Coercion, Maybe Coercion) -- If the second returned Coercion is actually Nothing, then no cast is necessary; -- the returned coercion would have been reflexive. pushCoValArg co - | tyL `eqType` tyR - = Just (mkRepReflCo arg, 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 (mkRepReflCo arg, Nothing) | isFunTy tyL , (co1, co2) <- decomposeFunCo Representational co |
