[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.
Showing
- ghc/compiler/absCSyn/AbsCUtils.lhs 3 additions, 3 deletionsghc/compiler/absCSyn/AbsCUtils.lhs
- ghc/compiler/absCSyn/PprAbsC.lhs 18 additions, 18 deletionsghc/compiler/absCSyn/PprAbsC.lhs
- ghc/compiler/basicTypes/DataCon.lhs 75 additions, 78 deletionsghc/compiler/basicTypes/DataCon.lhs
- ghc/compiler/basicTypes/Demand.lhs 9 additions, 1 deletionghc/compiler/basicTypes/Demand.lhs
- ghc/compiler/basicTypes/Id.lhs 4 additions, 4 deletionsghc/compiler/basicTypes/Id.lhs
- ghc/compiler/basicTypes/IdInfo.hi-boot 2 additions, 1 deletionghc/compiler/basicTypes/IdInfo.hi-boot
- ghc/compiler/basicTypes/IdInfo.hi-boot-5 3 additions, 1 deletionghc/compiler/basicTypes/IdInfo.hi-boot-5
- ghc/compiler/basicTypes/IdInfo.lhs 75 additions, 11 deletionsghc/compiler/basicTypes/IdInfo.lhs
- ghc/compiler/basicTypes/Var.lhs 15 additions, 7 deletionsghc/compiler/basicTypes/Var.lhs
- ghc/compiler/basicTypes/VarSet.lhs 8 additions, 1 deletionghc/compiler/basicTypes/VarSet.lhs
- ghc/compiler/codeGen/CgClosure.lhs 3 additions, 3 deletionsghc/compiler/codeGen/CgClosure.lhs
- ghc/compiler/coreSyn/CoreLint.lhs 9 additions, 2 deletionsghc/compiler/coreSyn/CoreLint.lhs
- ghc/compiler/coreSyn/CoreSyn.hi-boot 2 additions, 1 deletionghc/compiler/coreSyn/CoreSyn.hi-boot
- ghc/compiler/coreSyn/CoreSyn.hi-boot-5 2 additions, 1 deletionghc/compiler/coreSyn/CoreSyn.hi-boot-5
- ghc/compiler/coreSyn/CoreSyn.lhs 88 additions, 3 deletionsghc/compiler/coreSyn/CoreSyn.lhs
- ghc/compiler/coreSyn/CoreUnfold.hi-boot 2 additions, 1 deletionghc/compiler/coreSyn/CoreUnfold.hi-boot
- ghc/compiler/coreSyn/CoreUnfold.hi-boot-5 2 additions, 1 deletionghc/compiler/coreSyn/CoreUnfold.hi-boot-5
- ghc/compiler/coreSyn/CoreUnfold.lhs 10 additions, 2 deletionsghc/compiler/coreSyn/CoreUnfold.lhs
- ghc/compiler/coreSyn/Subst.lhs 38 additions, 11 deletionsghc/compiler/coreSyn/Subst.lhs
- ghc/compiler/cprAnalysis/CprAnalyse.lhs 20 additions, 36 deletionsghc/compiler/cprAnalysis/CprAnalyse.lhs
Loading
Please register or sign in to comment