sizeExpr: fix a bug in the size calculation

Authored by simonmar on Feb 10 2016, 3:19 AM.

Description

sizeExpr: fix a bug in the size calculation

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: Trac #11564