Skip to content

Simplifier infelicities

In my travels through the optimiser I discovered two small infelicities

  1. In OccurAnal the function occAnalApp was failing to reset occ_encl to OccVanilla. This omission sometimes resulted in over-pessimistic occurrence information.

  2. In Simplify.mkDupableAlts we were building a new alternative like

     case 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 be K e1 e2 e3, we'd end up with

      let 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.

Edited by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information