Do not (ever) use substExprSC in the simplifier
authorsimonpj@microsoft.com <unknown>
Mon, 25 Oct 2010 15:26:22 +0000 (15:26 +0000)
committersimonpj@microsoft.com <unknown>
Mon, 25 Oct 2010 15:26:22 +0000 (15:26 +0000)
commit2cda6f9f6c68f5cfd202e9979fefaa40df26769e
tree33a4e938e80a94dce34b33f092b9c99e2bf4b868
parent98bef4db89b57b01c8f557a027dbeb8ae72407c9
Do not (ever) use substExprSC in the simplifier

"Short-cut" substitution means "do nothing if the substitution
is empty". We *never* want do to that in the simplifier because
even though the substitution is empty, the in-scope set has
useful information:

 * We get up-to-date unfoldings; and that in turn may
   reduce the number of iterations of the simplifier

 * We avoid space leaks, because failing to substitute may
   hang on to old Ids from a previous iteration

(This is what was causing the late inlining of foo in
Trac #4428.)
compiler/coreSyn/CoreSubst.lhs
compiler/simplCore/SimplEnv.lhs