diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2019-10-25 13:58:33 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2019-10-25 16:14:32 +0100 |
commit | 011ea5548464c3444d61cfc0c0486ebac1d47199 (patch) | |
tree | 2b3753cb51ae01438fb9e8c8d27bef089205dfa0 /compiler/simplCore/SimplMonad.hs | |
parent | 2d2cc76ffb781d01c800608cd8be05cca67ac4c0 (diff) | |
download | haskell-wip/T17294.tar.gz |
Better arity for join pointswip/T17294
A join point was getting too large an arity, leading to #17294.
I've tightened up the invariant: see
CoreSyn, Note [Invariants on join points], invariant 2b
Diffstat (limited to 'compiler/simplCore/SimplMonad.hs')
-rw-r--r-- | compiler/simplCore/SimplMonad.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/simplCore/SimplMonad.hs b/compiler/simplCore/SimplMonad.hs index 732805e9ee..32c277cc55 100644 --- a/compiler/simplCore/SimplMonad.hs +++ b/compiler/simplCore/SimplMonad.hs @@ -36,7 +36,8 @@ import Outputable import FastString import MonadUtils import ErrUtils as Err -import Panic (throwGhcExceptionIO, GhcException (..)) +import Util ( count ) +import Panic (throwGhcExceptionIO, GhcException (..)) import BasicTypes ( IntWithInf, treatZeroAsInf, mkIntWithInf ) import Control.Monad ( ap ) @@ -186,8 +187,8 @@ newJoinId bndrs body_ty = do { uniq <- getUniqueM ; let name = mkSystemVarName uniq (fsLit "$j") join_id_ty = mkLamTypes bndrs body_ty -- Note [Funky mkLamTypes] - -- Note [idArity for join points] in SimplUtils - arity = length (filter isId bndrs) + arity = count isId bndrs + -- arity: See Note [Invariants on join points] invariant 2b, in CoreSyn join_arity = length bndrs details = JoinId join_arity id_info = vanillaIdInfo `setArityInfo` arity |