
#12962: No automatic SCC annotations for functions marked INLINABLE -------------------------------------+------------------------------------- Reporter: MikolajKonarski | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Profiling | Version: 8.0.1 Resolution: | Keywords: Inlining Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12963 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by MikolajKonarski: @@ -19,0 +19,7 @@ + + Edit: `-fexpose-all-unfoldings` plus `-fspecialise-aggressively` is a + perfect workaround. I wish somebody told me earlier. Compared to 600 + `INLINABLE` and `-fexpose-all-unfoldings`, the compilation time is + unchanged (10min) and the program seems a bit faster (not a scientific + benchmark). Profiling works fine with this setup and I don't need to write + `INLINABLE` any more (nor add `SCC` by hand). New description: Judging from .prof files and the -xc and -prof callstacks, GHC adds no automatic SCC annotations for functions marked `INLINABLE`. The user's guide only mentions `INLINE`: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.ht..., not `INLINABLE`. Is it a bug in documentation or implementation? In my case I managed to work around by using `-fexpose-all-unfoldings` instead of the tons of `INLINABLE` I was using before, but in general case, adding all the SCC annotations by hand seems prohibitive. e.g., in code that needs a lot of `INLINABLE` to enable specialization. Since `-fexpose-all-unfoldings` does not inhibit profiling and compiling with no optimization doesn't help recover it, the culprit is probably not the actual inlining or specialization, but rather handling of the `INLINABLE` pragma itself. Edit: Ufortunately, the workaround by using `-fexpose-all-unfoldings` turns out to be not acceptable for me, see #12963. I'm also no longer sure about the last paragraph. Edit: `-fexpose-all-unfoldings` plus `-fspecialise-aggressively` is a perfect workaround. I wish somebody told me earlier. Compared to 600 `INLINABLE` and `-fexpose-all-unfoldings`, the compilation time is unchanged (10min) and the program seems a bit faster (not a scientific benchmark). Profiling works fine with this setup and I don't need to write `INLINABLE` any more (nor add `SCC` by hand). -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12962#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler