Improve the loop-breaking heuristics
authorsimonpj@microsoft.com <unknown>
Wed, 29 Nov 2006 21:24:40 +0000 (21:24 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 29 Nov 2006 21:24:40 +0000 (21:24 +0000)
commit1dca158769225e58ec90d95526f968515e325378
tree820e9747ac6804cf062276f78cc99382338e557b
parentbeade0a18125941847f87c97f81c1e0a49f01416
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.
compiler/simplCore/OccurAnal.lhs