diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2021-05-09 23:20:44 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2021-05-09 23:20:44 +0100 |
commit | 504b07ae7dfa42135ec54ffb08ff6af8f881a6b8 (patch) | |
tree | ae61013bde363cc5edc1657cdfb6ddd4c5797d32 /compiler/GHC/Core/Opt | |
parent | 8e0f48bdd6e83279939d8fdd2ec1e5707725030d (diff) | |
download | haskell-wip/T19815.tar.gz |
Use isReflexiveCo when building an MCorecionwip/T19815
This patch just changes `isReflCo` to `isReflexiveCo` when we build an
MCoercion, in `mkMCo`. It turns out that this makes a gigantic
difference to test T18223.
I also changed the name from `coToMCo` to `mkMCo`, which is more
consistent with how we name smart constructors.
Diffstat (limited to 'compiler/GHC/Core/Opt')
-rw-r--r-- | compiler/GHC/Core/Opt/Arity.hs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/GHC/Core/Opt/Arity.hs b/compiler/GHC/Core/Opt/Arity.hs index 36a2535c09..aa0b936058 100644 --- a/compiler/GHC/Core/Opt/Arity.hs +++ b/compiler/GHC/Core/Opt/Arity.hs @@ -1672,11 +1672,9 @@ pushCoValArg co -- then co1 :: tyL1 ~ tyR1 -- co2 :: tyL2 ~ tyR2 = ASSERT2( isFunTy tyR, ppr co $$ ppr arg ) - Just (coToMCo (mkSymCo co1), coToMCo co2) - -- Critically, coToMCo to checks for ReflCo; the whole coercion may not - -- be reflexive, but either of its components might be - -- We could use isReflexiveCo, but it's not clear if the benefit - -- is worth the cost, and it makes no difference in #18223 + Just (mkMCo (mkSymCo co1), mkMCo co2) + -- Critically, mkMCo to checks for isReflexiveCo; the whole coercion + -- may not be reflexive, but either of its components might be | otherwise = Nothing |