Simplifier infelicities
In my travels through the optimiser I discovered two small infelicities
-
In OccurAnal the function
occAnalApp
was failing to resetocc_encl
toOccVanilla
. This omission sometimes resulted in over-pessimistic occurrence information. -
In
Simplify.mkDupableAlts
we were building a new alternative likecase e of K a b c -> $j a c
but with no occ-info on a, c. As a result, if
e
turned out to beK e1 e2 e3
, we'd end up withlet a = e1; c = e3 in $j a c
which took another Simplifier iteration to turn into
$j e1 e3
. I found cases (in compiling GHC itself) where this added entirely-unnecessary Simplifier iterations, which has a bad effect on compiler perf.