Opened 2 years ago

Last modified 10 months ago

#14242 new bug

Ticks and join points don't play well

Reported by: bgamari Owned by:
Priority: normal Milestone: 8.10.1
Component: Compiler Version: 8.2.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Currently the presence of ticks appear to inhibit our ability to discover join points as described by this comment in OccurAnal.occAnal,

    usage_lam = markAllNonTailCalled (markAllInsideLam usage)
                  -- TODO There may be ways to make ticks and join points play
                  -- nicer together, but right now there are problems:
                  --   let j x = ... in tick<t> (j 1)
                  -- Making j a join point may cause the simplifier to drop t
                  -- (if the tick is put into the continuation). So we don't
                  -- count j 1 as a tail call.

This causes spurious warnings when compiling with a DEBUG compiler and -g or profiling enabled.

Change History (6)

comment:1 Changed 2 years ago by bgamari

Milestone: 8.4.1
Status: newpatch

The current logic is arguably far too conservative in the particular case of source notes, which generally shouldn't interfere with optimization. This case is addressed by Phab:D3978.

comment:2 Changed 2 years ago by Ben Gamari <ben@…>

In 12a92fed/ghc:

OccurAnal: Ensure SourceNotes don't interfere with join-point analysis

In general ticks are problematic for join point analysis as described
in #14242.  However, source notes are intended to be a best-effort
annotation which shouldn't interfere with optimization. Special-case
these to ensure that tail-call information is still correct, even in the
presence of source note

Test Plan: Validate

Reviewers: simonpj, austin

Reviewed By: simonpj

Subscribers: rwbarton, thomie

GHC Trac Issues: #14242

Differential Revision:

comment:3 Changed 21 months ago by bgamari


This ticket won't be resolved in 8.4; remilestoning for 8.6. Do holler if you are affected by this or would otherwise like to work on it.

comment:4 Changed 16 months ago by bgamari


These won't be addressed by GHC 8.6.

comment:5 Changed 15 months ago by monoidal

Status: patchnew

comment:6 Changed 10 months ago by osa1


Bumping milestones of low-priority tickets.

Note: See TracTickets for help on using tickets.