[GHC] #12990: Partially applied constructors with unpacked fields simplified badly
GHC
ghc-devs at haskell.org
Tue Jan 10 22:09:56 UTC 2017
#12990: Partially applied constructors with unpacked fields simplified badly
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner:
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords: Inlining
Operating System: Unknown/Multiple | Architecture:
Type of failure: Runtime | Unknown/Multiple
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): D2891
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by David Feuer <David.Feuer@…>):
In [changeset:"2be364ac8cf2f5cd3b50503e8b26f51eb46101e5/ghc"
2be364ac/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="2be364ac8cf2f5cd3b50503e8b26f51eb46101e5"
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
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12990#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list