[project @ 2001-03-01 17:10:06 by simonpj]
authorsimonpj <unknown>
Thu, 1 Mar 2001 17:10:07 +0000 (17:10 +0000)
committersimonpj <unknown>
Thu, 1 Mar 2001 17:10:07 +0000 (17:10 +0000)
commit09518039f8f793e6464c1703506089a107926d11
tree4657eff542f4367c060dc4569bf5863e7d49a2aa
parent75e81ca47e2efb85a560fa9a48f0a993d1474730
[project @ 2001-03-01 17:10:06 by simonpj]
Improve IdInfo substitution

To get rules to work nicely, we need to make rules for recursive functions
active in the RHS of the very recursive function itself.  This can be
done nicely: the change is to move the calls to simplIdInfo in Simplify
to an earlier place.

The second thing is that when doing simple expression substitution
in a rule (which we do during simplification for rules attached to an Id)
we were zapping the occurrence info carefully pinned on the rule binders
when the rule was put into the Id's rules.  This in turn meant that
the simplifer ran more iterations than necessary when rules were fired.
(Andrew Tolmach discovered this.)

So I tidied up the interface to Subst a little.  The relevant functions
that have changed are
simplBndr, simplBndrs, simplLetId, simplIdInfo,
substAndCloneId, substAndCloneIds, substAndCloneRecIds,

There are consequential changes in other modules, but it compiles
at least the whole standard libraries happily, and the codegen tests,
so I'm reasonably confident in it.  But watch out for new strange
happenings.
ghc/compiler/basicTypes/Id.lhs
ghc/compiler/basicTypes/IdInfo.lhs
ghc/compiler/coreSyn/Subst.lhs
ghc/compiler/simplCore/SetLevels.lhs
ghc/compiler/simplCore/SimplUtils.lhs
ghc/compiler/simplCore/Simplify.lhs
ghc/compiler/specialise/Specialise.lhs