[GHC] #12116: No easy way to add cost-centre to top-levels
#12116: No easy way to add cost-centre to top-levels -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- As far as I can see from the user manual (I also tried placing some `SCC`s), there's no way to easily add cost-centres to top-level definitions. We can do things like: {{{ f x y z = ... => f = {-# SCC f #-} \x y z -> ... }}} but it becomes too much work once we have "equations" style definitions like {{{ head [] = {-# SCC head #-} Nothing head (x : _) = {-# SCC head #-} Just x }}} Also, `where` clauses work differently after the transformations. Example: {{{ f x y z = ... where <can use x and y here> => f = {-# SCC f #-} \x y z -> ... where <can't use x and y here> }}} So it gets annoying real quick. It'd be really great if we could just add `{-# SCC ... #-}` just like `{-# INLINE ... #-}` pragmas. Any ideas/opinions? Looking at the code, it seems like `-fprof-auto` and similar flags are adding ticks to `FunBind.fun_tick`. We could do the same with this new `SCC` pragma. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12116> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12116: No easy way to add cost-centre to top-levels -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: feature request | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2407 Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * status: new => merge * differential: => Phab:D2407 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12116#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12116: No easy way to add cost-centre to top-levels -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: feature request | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2407 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): This was merged in b5ec09dff6b865550f3bd225f86028a304596c61. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12116#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12116: No easy way to add cost-centre to top-levels -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: feature request | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | profiling/should_run/toplevel_scc_1 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2407 Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * testcase: => profiling/should_run/toplevel_scc_1 * status: merge => closed * resolution: => fixed * milestone: => 8.2.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12116#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC