[Git][ghc/ghc][wip/arity-type-9.4] Attemp fix for core lint

Zubin (@wz1000) gitlab at gitlab.haskell.org
Fri Oct 28 12:56:07 UTC 2022



Zubin pushed to branch wip/arity-type-9.4 at Glasgow Haskell Compiler / GHC


Commits:
a02500a2 by Zubin Duggal at 2022-10-28T18:25:57+05:30
Attemp fix for core lint

- - - - -


2 changed files:

- compiler/GHC/Core/Opt/Arity.hs
- testsuite/tests/arityanal/should_compile/all.T


Changes:

=====================================
compiler/GHC/Core/Opt/Arity.hs
=====================================
@@ -1189,18 +1189,11 @@ arityType env (Let (Rec pairs) body)
   | ((j,_):_) <- pairs
   , isJoinId j
   = -- See Note [arityType for join bindings]
-    foldr (andArityType env . do_one) (arityType rec_env body) pairs
+    arityType rec_env body
   where
     rec_env = foldl add_bot env pairs
     add_bot env (j,_) = extendSigEnv env j botArityType
 
-    do_one :: (JoinId, CoreExpr) -> ArityType
-    do_one (j,rhs)
-      | Just arity <- isJoinId_maybe j
-      = arityType rec_env $ snd $ collectNBinders arity rhs
-      | otherwise
-      = pprPanic "arityType:joinrec" (ppr pairs)
-
 arityType env (Let (Rec prs) e)
   = floatIn (all is_cheap prs) (arityType env' e)
   where


=====================================
testsuite/tests/arityanal/should_compile/all.T
=====================================
@@ -16,6 +16,7 @@ test('Arity13', [ only_ways(['optasm']), grep_errmsg('Arity=') ], compile, ['-dn
 test('Arity14', [ only_ways(['optasm']), grep_errmsg('Arity=') ], compile, ['-dno-typeable-binds -ddump-simpl -dppr-cols=99999 -dsuppress-uniques'])
 test('Arity15', [ only_ways(['optasm']), grep_errmsg('Arity=') ], compile, ['-dno-typeable-binds -ddump-simpl -dppr-cols=99999 -dsuppress-uniques'])
 test('Arity16', [ only_ways(['optasm']), grep_errmsg('Arity=') ], compile, ['-dno-typeable-binds -ddump-simpl -dppr-cols=99999 -dsuppress-uniques'])
+test('Arity17', [ only_ways(['optasm']), grep_errmsg('Arity=') ], compile, ['-package ghc -dcore-lint -O2'])
 
 # Regression tests
 test('T18793', [ only_ways(['optasm']), grep_errmsg('Arity=') ], compile, ['-dno-typeable-binds -ddump-simpl -dppr-cols=99999 -dsuppress-uniques'])



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a02500a23c9748c2a76870b7ebcc851a0c47c252
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/20221028/dd9b8c6b/attachment-0001.html>


More information about the ghc-commits mailing list