[GHC] #13999: Simple function not inlined within declaration marked NOINLINE

#13999: Simple function not inlined within declaration marked NOINLINE -------------------------------------+------------------------------------- Reporter: srb | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: Compiler | Version: 8.0.2 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): | Wiki Page: -------------------------------------+------------------------------------- This seems so shallow that I feel like I must be missing something, but if I implement a function like {{{#!hs eq :: Bool -> Bool -> Bool eq x y = x == y {-# NOINLINE eq #-} }}} the boolean equality operator is not inlined in eq, even at -O2. The generated core is instead {{{#!hs eq = $fEqBool_$c== }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13999 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13999: Simple function not inlined within declaration marked NOINLINE -------------------------------------+------------------------------------- Reporter: srb | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: Compiler | Version: 8.0.2 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): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): Without the `NOINLINE` pragma the optimised definition is the same. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13999#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13999: Simple function not inlined within declaration marked NOINLINE -------------------------------------+------------------------------------- Reporter: srb | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: Compiler | Version: 8.0.2 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): Wiki Page: | -------------------------------------+------------------------------------- Comment (by srb): Well yes, but without NOINLINE it is likely that eq will be inlined in its caller, so delaying the inlining of (==) is arguably justifiable as a means to avoid excessive bloat. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13999#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13999: Simple function not inlined within declaration marked NOINLINE -------------------------------------+------------------------------------- Reporter: srb | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: Compiler | Version: 8.0.2 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): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): What's the problem here? YOu get the same code whether or not `eq` is marked `NOINLINE`. GHC generally doesn't inline a function if the caller cannot benefit, which it can't here. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13999#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13999: Simple function not inlined within declaration marked NOINLINE -------------------------------------+------------------------------------- Reporter: srb | Owner: (none) Type: bug | Status: closed Priority: lowest | Milestone: Component: Compiler | Version: 8.0.2 Resolution: invalid | 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): Wiki Page: | -------------------------------------+------------------------------------- Changes (by srb): * status: new => closed * resolution: => invalid -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13999#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC