[GHC] #12378: Not enough inlining happens with single-method type classes

#12378: Not enough inlining happens with single-method type classes -------------------------------------+------------------------------------- Reporter: akio | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Runtime Unknown/Multiple | performance bug Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- In the attached file, GHC produces code (with `-O2`) for `foo` that references a top-level definition of type `Small (Either () ())`, despite the fact that all bindings in the module are marked INLINE. If I use `-DOTHER_METHOD` to add another method to the class, this problem goes away. It looks like a ClassOp rule is helping here. I'm not sure if this is a bug, but it was a surprising behavior for me, so I'm reporting it. Please feel free to close this ticket if it's the correct behavior. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12378 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12378: Not enough inlining happens with single-method type classes -------------------------------------+------------------------------------- Reporter: akio | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by akio): * Attachment "test.hs" added. test case -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12378 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12378: Not enough inlining happens with single-method type classes -------------------------------------+------------------------------------- Reporter: akio | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): I've compiled your program with `-O2`, and both ghc 8.0 and HEAD, and cannot see a top-level definition of type `Small (Either () ())`. Can you compile with `-ddump-simpl`, attach the result, and point to the line number that concerns you? Thanks! Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12378#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12378: Not enough inlining happens with single-method type classes -------------------------------------+------------------------------------- Reporter: akio | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by akio): * status: new => closed * resolution: => invalid Comment: You are right, it looks like I used the wrong version of the compiler. With GHC 8.0 it works fine. I'm closing the ticket now. I'm sorry for wasting your time. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12378#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC