Skip to content
  • Simon Marlow's avatar
    sizeExpr: fix a bug in the size calculation · 51a33924
    Simon Marlow authored
    There were two bugs here:
    
    * We weren't ignoring Cast in size_up_app
    * An application of a non-variable wasn't being charged correct
    
    The result was that some things looked too cheap.  In my case I had
    things like
    
        ((f x) `cast` ...) y
    
    which was given size 21 instead of 30, and this had knock-on effects
    elsewhere that caused some large code bloat.
    
    Test Plan:
    * nofib runs (todo)
    * validate
    
    Reviewers: simonpj, austin, bgamari, erikd
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1900
    
    GHC Trac Issues: #11564
    51a33924