• simonpj's avatar
    [project @ 2000-09-14 13:46:39 by simonpj] · cae34044
    simonpj authored
    	Simon's tuning changes: early Sept 2000
    Library changes
    * Eta expand PrelShow.showLitChar.  It's impossible to compile this well,
      and it makes a big difference to some programs (e.g. gen_regexps)
    * Make PrelList.concat into a good producer (in the foldr/build sense)
    Flag changes
    * Add -ddump-hi-diffs to print out changes in interface files.  Useful
      when watching what the compiler is doing
    * Add -funfolding-update-in-place to enable the experimental optimisation
      that makes the inliner a bit keener to inline if it's in the RHS of
      a thunk that might be updated in place.  Sometimes this is a bad idea
      (one example is in spectral/sphere; see notes in nofib/Simon-nofib-notes)
    Tuning things
    * Fix a bug in SetLevels.lvlMFE.  (change ctxt_lvl to dest_level)
      I don't think this has any performance effect, but it saves making
      a redundant let-binding that is later eliminated.
    * Desugar.dsProgram and DsForeign
      Glom together all the bindings into a single Rec.  Previously the
      bindings generated by 'foreign' declarations were not glommed together, but
      this led to an infelicity (i.e. poorer code than necessary) in the modules
      that actually declare Float and Double (explained a bit more in Desugar.dsProgram)
    * OccurAnal.shortMeOut and IdInfo.shortableIdInfo
      Don't do the occurrence analyser's shorting out stuff for things which
      have rules.  Comments near IdInfo.shortableIdInfo.
      This is deeply boring, and mainly to do with making rules work well.
      Maybe rules should have phases attached too....
    * CprAnalyse.addIdCprInfo
      Be a bit more willing to add CPR information to thunks;
      in particular, if the strictness analyser has just discovered that this
      is a strict let, then the let-to-case transform will happen, and CPR is fine.
      This made a big difference to PrelBase.modInt, which had something like
    	modInt = \ x -> let r = ... -> I# v in
    			...body strict in r...
      r's RHS isn't a value yet; but modInt returns r in various branches, so
      if r doesn't have the CPR property then neither does modInt
    * MkId.mkDataConWrapId
      Arrange that vanilla constructors, like (:) and I#, get unfoldings that are
      just a simple variable $w:, $wI#.  This ensures they'll be inlined even into
      rules etc, which makes matching a bit more reliable.  The downside is that in
      situations like (map (:) xs), we'll end up with (map (\y ys. $w: y ys) xs.
      Which is tiresome but it doesn't happen much.
    * SaAbsInt.findStrictness
      Deal with the case where a thing with no arguments is bottom.  This is Good.
      E.g.   module M where { foo = error "help" }
      Suppose we have in another module
    	case M.foo of ...
      Then we'd like to do the case-of-error transform, without inlining foo.
    Tidying up things
    * Reorganised Simplify.completeBinding (again).
    * Removed the is_bot field in CoreUnfolding (is_cheap is true if is_bot is!)
      This is just a tidy up
    * HsDecls and others
      Remove the NewCon constructor from ConDecl.  It just added code, and nothing else.
      And it led to a bug in MkIface, which though that a newtype decl was always changing!
    * IdInfo and many others
      Remove all vestiges of UpdateInfo (hasn't been used for years)
RnIfaces.lhs 44.2 KB