From: simonpj@microsoft.com Date: Mon, 14 Dec 2009 13:46:47 +0000 (+0000) Subject: Tidy up computation of result discounts in CoreUnfold X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=aff23274b14d6e8551e949c3290adaf265e31371;hp=aff23274b14d6e8551e949c3290adaf265e31371;p=ghc-hetmet.git Tidy up computation of result discounts in CoreUnfold Mostly this patch is a tidy-up, but it did reveal one inconsistency that I fixed. When computing result discounts for case expressions, we were *adding* result-discounts for cases on non-arguments, but *picking the one for the max-size branch* for arguments. I think you could argue the toss, but it seems neater (and the code is nicer) to be consistent (ie always add). See Note [addAltSize result discounts]. The nofib results seem fine Program Size Allocs Runtime Elapsed -------------------------------------------------------------------------------- boyer -0.8% -4.8% 0.06 0.07 sphere -0.7% -2.5% 0.15 0.16 -------------------------------------------------------------------------------- Min -0.8% -4.8% -19.1% -24.8% Max -0.5% +0.0% +3.4% +127.1% Geometric Mean -0.7% -0.1% -4.3% -1.3% The +127% elapsed is a timing error; I re-ran the same binary and it's unchanged from the baseline. ---