
#11158: Combine exprIsTrivial and cpe_ExprIsTrivial -------------------------------------+------------------------------------- Reporter: simonpj | Owner: scpmw Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by scpmw): From a quick scan through the Git history, that particular comment has been out of date for quite some time, starting with Simon M's tick overhaul in `7bb0447`, where {{{ Note [SCCs are trivial] ~~~~~~~~~~~~~~~~~~~~~~~ We used not to treat (_scc_ "foo" x) as trivial, because it really generates code, (and a heap object when it's a function arg) to capture the cost centre. However, the profiling system discounts the allocation costs for such "boxing thunks" whereas the extra costs of *not* inlining otherwise-trivial bindings can be high, and are hard to discount. }}} got replaced by {{{ Note [Tick trivial] ~~~~~~~~~~~~~~~~~~~ Ticks are not trivial. If we treat "tick<n> x" as trivial, it will be inlined inside lambdas and the entry count will be skewed, for example. Furthermore "scc<n> x" will turn into just "x" in mkTick. }}} Since then, `exprIsTrivial` has in fact been slightly more restrictive than `cpe_exprIsTrivial` concerning HPC ticks. When adding the exception for `SourceNote`s, I considered that an inconsistency. My vote would be to combine them - would have done it myself if I had spotted it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11158#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler