patch applied (ghc): Improve the loop-breaking heuristics

Simon Peyton Jones <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.all
Message-ID <20061130021718.GA2867__32762.6212886118$1164853062$gmane$org@cvs.haskell.org>
Wed Nov 29 13:24:40 PST 2006  [email protected]
  * Improve the loop-breaking heuristics
  
  The loop-breaking heuristics were making it a high priority to
  avoid choosing a variable as a loop breaker if its *type* was a 
  data type.  The reason is that it's very good to be able to "see"
  constructor applications.
  
  But it's only good if the constructor application is *visible*, 
  so that is what I test for now.  I found a case (when testing 
  SpecConstr) where I had a Rec like this:
  	rec { lvl = foo Nothing
  	      foo = ...
  	        RULE foo Nothing = ...
     	    }
  
  Even if lvl has a data type, it's much better to make lvl the loop
  breaker, not foo, so that foo's RULE is visible in lvl's RHS.
  

    M ./compiler/simplCore/OccurAnal.lhs -4 +7
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.