[GHC] #12116: No easy way to add cost-centre to top-levels
GHC
ghc-devs at haskell.org
Wed May 25 10:31:30 UTC 2016
#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
More information about the ghc-tickets
mailing list