Don't use a generic apply thunk for known calls

Authored by sgraf on Dec 6 2018, 9:40 AM.

Description

Don't use a generic apply thunk for known calls

Summary:
Currently, an AP thunk like sat = f a b c will not have its own entry
point and info pointer and will instead reuse a generic apply thunk
like stg_ap_4_upd.

That's great from a code size perspective, but if f is a known
function, a specialised entry point with a plain call can be much faster
than figuring out the arity and doing dynamic dispatch.

This looks at fs arity to figure out if it is a known function and if so, it
will not lower it to a generic apply function.

Benchmark results are encouraging: No changes to allocation, but 0.2% less
counted instructions.

Test Plan: Validates locally

Reviewers: simonmar, osa1, simonpj, bgamari

Reviewed By: simonpj

Subscribers: rwbarton, carter

GHC Trac Issues: Trac #16005

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

Details

Committed
sgrafDec 6 2018, 9:40 AM
Reviewer
simonpj
Differential Revision
D5414: Don't use a generic apply thunk for known calls
Parents
rGHC081f44bf3a2f: Remove a tcTrace
Branches
Unknown
Tags
Unknown