Inline partially-applied wrappers
authorDavid Feuer <david.feuer@gmail.com>
Tue, 10 Jan 2017 21:33:20 +0000 (16:33 -0500)
committerDavid Feuer <David.Feuer@gmail.com>
Tue, 10 Jan 2017 21:57:19 +0000 (16:57 -0500)
commit2be364ac8cf2f5cd3b50503e8b26f51eb46101e5
treee054b239f6574e0b2ccbef866e492e427169ef36
parent8b15fc42847b3ba4a161158995564b1986907776
Inline partially-applied wrappers

Suppose we have

```
data Node a = Node2 !Int a a | Node3 !Int a a a
instance Traversable Node where
  traverse f (Node2 s x y) = Node2 s <$> f x <*> f y
  ...

```

Since `Node2` is partially applied, we wouldn't inline its
wrapper.  The result was that we'd box up the `Int#` to put
the box in the closure passed to `fmap`. We now allow the wrapper
to inline when partially applied, so GHC stores the `Int#`
directly in the closure.

Reviewers: rwbarton, mpickering, simonpj, austin, bgamari

Reviewed By: simonpj, bgamari

Subscribers: mpickering, thomie

Differential Revision: https://phabricator.haskell.org/D2891

GHC Trac Issues: #12990
compiler/basicTypes/MkId.hs
testsuite/tests/deSugar/should_compile/T2431.stderr
testsuite/tests/perf/should_run/T12990.hs [new file with mode: 0644]
testsuite/tests/perf/should_run/all.T
testsuite/tests/simplCore/should_compile/T7360.stderr