[Git][ghc/ghc][wip/romes/egraphs-pmc-2] WIP.;

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Sat Oct 28 21:02:48 UTC 2023



Rodrigo Mesquita pushed to branch wip/romes/egraphs-pmc-2 at Glasgow Haskell Compiler / GHC


Commits:
21e38c31 by Rodrigo Mesquita at 2023-10-28T22:02:40+01:00
WIP.;

- - - - -


1 changed file:

- compiler/GHC/HsToCore/Pmc/Solver.hs


Changes:

=====================================
compiler/GHC/HsToCore/Pmc/Solver.hs
=====================================
@@ -849,7 +849,7 @@ addConCt nabla0 x alt tvs args = do
   mergeVarIds xid kid nabla3
 
 mergeConCt :: VarInfo -> PmAltConApp -> StateT TyState (MaybeT DsM) VarInfo
-mergeConCt vi@(VI _ pos neg _bot _) (PACA alt tvs _args) = StateT $ \tyst -> do
+mergeConCt vi@(VI _ pos neg _bot _) paca@(PACA alt tvs _args) = StateT $ \tyst -> do
   -- First try to refute with a negative fact
   guard (not (elemPmAltConSet alt neg))
   -- Then see if any of the other solutions (remember: each of them is an
@@ -870,8 +870,8 @@ mergeConCt vi@(VI _ pos neg _bot _) (PACA alt tvs _args) = StateT $ \tyst -> do
       tyst' <- MaybeT (tyOracle tyst (listToBag $ map (\case (PhiTyCt pred) -> pred; _ -> error "impossible") ty_cts))
       return (vi, tyst') -- All good, and we get no new information.
     Nothing -> do
-      -- No new information to merge, all done.
-      return (vi, tyst)
+      -- Add new con info
+      return (vi{vi_pos = paca:pos}, tyst)
 
 equateTys :: [Type] -> [Type] -> [PhiCt]
 equateTys ts us =



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/21e38c314c16ed82bb4460b7cf987ac64cafd998

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/21e38c314c16ed82bb4460b7cf987ac64cafd998
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/20231028/4fff09a3/attachment-0001.html>


More information about the ghc-commits mailing list