patch applied (ghc): Major improvement to SpecConstr

Simon Peyton Jones simonpj at microsoft.com
Fri Feb 9 12:41:35 EST 2007


Fri Feb  9 09:36:45 PST 2007  simonpj at microsoft.com
  * Major improvement to SpecConstr
  
  This patch improves the SpecConstr pass, by 
    a) making it work with join points
    b) making it generate specialisations transitively
  
  As part of it, SpecConstr now carries a substitution with it, which
  runs over the whole program as it goes.  This turned out to be 
  a big win; simplified the implementation quite a bit.
  
  I have *disabled* the specialisation on lambdas; it's pretty fragile,
  and sometimes generates more and more specialisations. Something to
  come back to, perhaps.
  
  I rejigged the flag-handling a bit.  Now the specification of passes
  in DynFlags is a bit nicer; see
  	- optLevelFlags top-level data structure
  	- runWhen function
  	- CoreDoPasses constructor
  
  There are now command-line flags
  	-fspec-constr
  	-fliberate-case
  	-fspec-threshold=N
  which do the obvious thing.  -O2 switches on both spec-constr and liberate-case.
  You can use -fno-liberate-case, -fno-spec-constr after -O2 to switch them off again.
  
  The spec-threshold applies to both these transformations; default value 200 for now.
  
  
  
  
  

    M ./compiler/coreSyn/CoreSubst.lhs -3 +18
    M ./compiler/coreSyn/CoreUnfold.lhs -1
    M ./compiler/coreSyn/CoreUtils.lhs -1 +13
    M ./compiler/main/DynFlags.hs -75 +69
    M ./compiler/simplCore/LiberateCase.lhs -1 +1
    M ./compiler/simplCore/SimplCore.lhs +6
    M ./compiler/specialise/SpecConstr.lhs -224 +402



More information about the Cvs-ghc mailing list