patch applied (ghc): Make recursion and RULES interact better

Simon Peyton Jones simonpj at microsoft.com
Tue Oct 3 11:37:37 EDT 2006


Tue Oct  3 08:30:57 PDT 2006  simonpj at microsoft.com
  * Make recursion and RULES interact better
  
  See Trac #683
  
  This patch improves the interaction of recursion and RULES; at least I
  hope it does.   The problem was that a RULE was being treated uniformly like
  an "extra RHS". This worked badly when you have a non-recursive definition
  that is made recursive only by RULE.
  
  This patch maeks the occurrence analyser know whether a binder is referred to
  only from RULES (the RulesOnly constructor in OccInfo).  Then we can ignore
  such edges when deciding on the order of bindings in a letrec, and when
  setting the LoopBreaker flag.
  
  The remaining potential problem is this:
  	rec{ f = ...g...
  	   ; g = ...f...
  	     RULE g True = ...
  	   }
  
  The RULE for g may not be visible in f's rhs.  This is fixable, but not
  today.
  
  

    M ./compiler/basicTypes/BasicTypes.lhs -2 +5
    M ./compiler/main/TidyPgm.lhs -2 +3
    M ./compiler/simplCore/OccurAnal.lhs -20 +36
    M ./compiler/simplCore/Simplify.lhs -1


More information about the Cvs-ghc mailing list