[Git][ghc/ghc][wip/T24978] Fix perf bug

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Tue Jul 16 22:45:48 UTC 2024



Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC


Commits:
6ecf1860 by Simon Peyton Jones at 2024-07-16T23:45:16+01:00
Fix perf bug

- - - - -


1 changed file:

- compiler/GHC/Core/Coercion.hs


Changes:

=====================================
compiler/GHC/Core/Coercion.hs
=====================================
@@ -2496,17 +2496,18 @@ coercion_lr_kind which orig_co
     go_app co              args = piResultTys (go co) args
 
     -------------
-    go_ax (BuiltInFamRewrite  bif) cos  = check_bif_res (bifrw_proves bif (map coercionKind cos))
-    go_ax (BuiltInFamInteract bif) [co] = check_bif_res (bifint_proves bif (coercionKind co))
-    go_ax (BuiltInFamInteract {})  _    = crash
-    go_ax (UnbranchedAxiom ax)     cos  = go_branch ax (coAxiomSingleBranch ax) cos
-    go_ax (BranchedAxiom ax i)     cos  = go_branch ax (coAxiomNthBranch ax i)  cos
+    go_ax axr@(BuiltInFamRewrite  bif) cos  = check_bif_res axr (bifrw_proves bif (map coercionKind cos))
+    go_ax axr@(BuiltInFamInteract bif) [co] = check_bif_res axr (bifint_proves bif (coercionKind co))
+    go_ax axr@(BuiltInFamInteract {})  _    = crash axr
+    go_ax     (UnbranchedAxiom ax)     cos  = go_branch ax (coAxiomSingleBranch ax) cos
+    go_ax     (BranchedAxiom ax i)     cos  = go_branch ax (coAxiomNthBranch ax i)  cos
 
     -------------
-    check_bif_res (Just (Pair lhs rhs)) = pickLR which (lhs,rhs)
-    check_bif_res Nothing               = crash
+    check_bif_res _   (Just (Pair lhs rhs)) = pickLR which (lhs,rhs)
+    check_bif_res axr Nothing               = crash axr
 
-    crash = pprPanic "coercionKind" (ppr orig_co)
+    crash :: CoAxiomRule -> Type
+    crash axr = pprPanic "coercionKind" (ppr axr)
 
     -------------
     go_branch :: CoAxiom br -> CoAxBranch -> [Coercion] -> Type



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6ecf186049f4bbdd04f72c21a8960fe903c646ca

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6ecf186049f4bbdd04f72c21a8960fe903c646ca
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240716/fef34bf6/attachment-0001.html>


More information about the ghc-commits mailing list