a mirror of the official ghc repository
Well, more a plain bug really, which led to SpecConstr missing some obvious opportunities for specialisation.
Thanks to Max Bolingbroke for spotting this.
Found-by: Valgrind. Thanks Julian!
The final straw was when I learned today that Happy broke.
There was a terrible typo in this patch; I wrote "env" instead of "env1".
Mon Jan 31 11:35:29 GMT 2011 email@example.com * Improve Simplifier and SpecConstr behaviour
Anyway, this fix is essential to make it work properly. Thanks to Max for spotting the problem (again).
Now we keep any partially-full blocks in the gc_thread structs after each GC, rather than moving them to the generation. This should give us slightly better locality (though I wasn't able to measure any difference).
Also in this patch: better sanity checking with THREADED.
Store the number of the destination generation in the Bdescr struct, so that in evacuate() we don't have to deref gen to get it. This is another improvement ported over from my GC branch.
This is an improvement from my GC branch, that helps performance for intensive message-passing communication between Capabilities.
Now that we use the per-capability mutable lists exclusively.
It is still (silently) accepted for backwards compatibility.
So we can now get these in ThreadScope:
19487000: cap 1: stopping thread 6 (blocked on black hole owned by thread 4)
Note: needs an update to ghc-events. Older ThreadScopes will just ignore the new information.
See Trac #4940. We had a message The lambda expression ` x -> x' has one argument one argument, repeating the "one argument" part. Easy fix.
This was originally to improve the case when SpecConstr generated a function with an unused argument (see Trac #4941), but I ended up giving up on that. But the refactoring is still an improvement.
In particular I got rid of BothOcc, which was unused.
This fixes Trac #4930. See Note [Bottom alternatives] in Simplify.lhs
Trac #4908 identified a case where SpecConstr wasn't "seeing" a specialisation it should easily get. The solution was simple: see Note [Add scrutinee to ValueEnv too] in SpecConstr.
Then it turned out that there was an exactly analogous infelicity in the mighty Simplifer too; see Note [Add unfolding for scrutinee] in Simplify. This fix is good for Simplify even in the absence of the SpecConstr change. (It arose when I moved the binder- swap stuff to OccAnall, not realising that it remains valuable to record info about the scrutinee of a case expression. The Note says why.
Together these two changes are unconditionally good. Better simplification, better specialisation. Thank you Max.