[project @ 1999-07-14 14:40:20 by simonpj]
authorsimonpj <unknown>
Wed, 14 Jul 1999 14:41:04 +0000 (14:41 +0000)
committersimonpj <unknown>
Wed, 14 Jul 1999 14:41:04 +0000 (14:41 +0000)
commit4e7d56fde0f44d38bbb9a6fc72cf9c603264899d
tree87d8d436372429773d4012b527923cb9ab09f3e0
parent0b127ebe6beecf69e0e429b722c645d73d4755df
[project @ 1999-07-14 14:40:20 by simonpj]
Main things:

* Add splitProductType_maybe to DataCon.lhs, with type
  splitProductType_maybe
:: Type  -- A product type, perhaps
-> Maybe (TyCon,  -- The type constructor
  [Type], -- Type args of the tycon
  DataCon, -- The data constructor
  [Type]) -- Its *representation* arg types

  Then use it in many places (e.g. worker-wrapper places) instead
  of a pile of junk

* Clean up various uses of dataConArgTys, which were plain wrong because
  they weren't passed the existential type arguments.  Most of these calls
  are eliminated by using splitProductType_maybe above.  I hope I correctly
  squashed the others. This fixes a bug that Meurig's programs showed up.

    module FailGHC (killSustainer) where
    import Weak
    import IOExts

    data Sustainer = forall a . Sustainer (IORef (Maybe a)) (IO ())

    killSustainer :: Sustainer -> IO ()
    killSustainer (Sustainer _ act) = act

  The above program used to kill the compiler.

* A fairly concerted attack on the Dreaded Space Leak.
- Add Type.seqType, CoreSyn.seqExpr, CoreSyn.seqRules

- Add some seq'ing when building Ids and IdInfos
These reduce the space usage a lot

- Add CoreSyn.coreBindsSize, which is pretty strict in the program,
and call it when we have -dshow-passes.

- Do not put the inlining in an Id that is being plugged into
the result-expression of the simplifier.  This cures
a the 'wedge' in the space profile for reasons I don't understand fully

  Together, these things reduce the max space usage when compiling PrelNum from
  17M to about 7Mbytes.

  I think there are now *too many* seqs, and they waste work, but I don't have
  time to find which ones.

  Furthermore, we aren't done. For some reason, some of the stuff allocated by
  the simplifier makes it through all during code generation and I don't see why.
  There's a should-be-unnecessary call to coreBindsSize in Main.main which
  zaps some, but not all of this space.

  -dshow-passes reduces space usage a bit, but I don't think it should really.

  All the measurements were made on a compiler compiled with profiling by
  GHC 3.03.    I hope they carry over to other builds!

* One trivial thing: changed all variables 'label' to 'lbl', becuase the
  former is a keyword with -fglagow-exts in GHC 3.03 (which I was compiling with).
  Something similar in StringBuffer.
49 files changed:
ghc/compiler/absCSyn/AbsCUtils.lhs
ghc/compiler/absCSyn/PprAbsC.lhs
ghc/compiler/basicTypes/DataCon.lhs
ghc/compiler/basicTypes/Demand.lhs
ghc/compiler/basicTypes/Id.lhs
ghc/compiler/basicTypes/IdInfo.hi-boot
ghc/compiler/basicTypes/IdInfo.hi-boot-5
ghc/compiler/basicTypes/IdInfo.lhs
ghc/compiler/basicTypes/Var.lhs
ghc/compiler/basicTypes/VarSet.lhs
ghc/compiler/codeGen/CgClosure.lhs
ghc/compiler/coreSyn/CoreLint.lhs
ghc/compiler/coreSyn/CoreSyn.hi-boot
ghc/compiler/coreSyn/CoreSyn.hi-boot-5
ghc/compiler/coreSyn/CoreSyn.lhs
ghc/compiler/coreSyn/CoreUnfold.hi-boot
ghc/compiler/coreSyn/CoreUnfold.hi-boot-5
ghc/compiler/coreSyn/CoreUnfold.lhs
ghc/compiler/coreSyn/Subst.lhs
ghc/compiler/cprAnalysis/CprAnalyse.lhs
ghc/compiler/deSugar/DsCCall.lhs
ghc/compiler/deSugar/DsExpr.lhs
ghc/compiler/deSugar/DsForeign.lhs
ghc/compiler/deSugar/DsUtils.lhs
ghc/compiler/deSugar/Match.lhs
ghc/compiler/hsSyn/HsExpr.lhs
ghc/compiler/main/Main.lhs
ghc/compiler/main/MkIface.lhs
ghc/compiler/nativeGen/AbsCStixGen.lhs
ghc/compiler/nativeGen/AsmCodeGen.lhs
ghc/compiler/nativeGen/RegAllocInfo.lhs
ghc/compiler/rename/RnExpr.lhs
ghc/compiler/simplCore/SetLevels.lhs
ghc/compiler/simplCore/SimplMonad.lhs
ghc/compiler/simplCore/SimplUtils.lhs
ghc/compiler/simplCore/Simplify.lhs
ghc/compiler/simplStg/StgVarInfo.lhs
ghc/compiler/stgSyn/CoreToStg.lhs
ghc/compiler/stgSyn/StgLint.lhs
ghc/compiler/stranal/SaAbsInt.lhs
ghc/compiler/stranal/WwLib.lhs
ghc/compiler/typecheck/TcEnv.lhs
ghc/compiler/typecheck/TcExpr.lhs
ghc/compiler/typecheck/TcHsSyn.lhs
ghc/compiler/typecheck/TcInstDcls.lhs
ghc/compiler/types/TyCon.lhs
ghc/compiler/types/Type.lhs
ghc/compiler/utils/Digraph.lhs
ghc/compiler/utils/StringBuffer.lhs