Deduplicate decision to count thunks in `-ticky`

Authored by sgraf on Nov 30 2018, 10:18 AM.

Description

Deduplicate decision to count thunks in -ticky

Summary:
Previously, the logic that checks whether a thunk has a counter or not
was duplicated in multiple functions.

This led to thunk enters being accounted to their enclosing functions in
StgCmmTicky.tickyEnterThunk, because the outer call to
withNewTickyCounterThunk didn't set the counter label for the thunk.
And rightly so! tickyEnterThunk should only account thunk enters to a
counter if -ticky-dyn-thunk is on.

This patch extracts the logic that was already present in its most
general form in withNewTickyCounterThunk into its own functions and
lets all other call sites checking for -ticky-dyn-thunk call this new
function named thunkHasCounter instead.

Reviewers: bgamari, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5392

Details

Committed
sgrafNov 30 2018, 10:18 AM
Reviewer
simonmar
Differential Revision
D5392: Deduplicate decision to count thunks in `-ticky`
Parents
rGHC47875bd4d79c: Add 'Lift' instances for 'NonEmpty' and 'Void'
Branches
Unknown
Tags
Unknown