ghc-9.10.0.20240426: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.Driver.GenerateCgIPEStub

Synopsis

Documentation

lookupEstimatedTicks :: HscEnv -> Map CmmInfoTable (Maybe IpeSourceLocation) -> IPEStats -> CmmGroupSRTs -> IO (Map CmmInfoTable (Maybe IpeSourceLocation), IPEStats) Source #

Given: * an initial mapping from info tables to possible source locations, * initial IPEStats, * a CmmGroupSRTs,

map every info table listed in the CmmProcs of the group to their possible source locations and update IPEStats for skipped stack info tables (in case both -finfo-table-map and -fno-info-table-map-with-stack were given). See: Note [Stacktraces from Info Table Provenance Entries (IPE based stack unwinding)]

Note: While it would be cleaner if we could keep the recursion and accumulation internal to this function, this cannot be done without separately traversing stream of CmmGroupSRTs in Main. The initial implementation of this logic did such a thing, and code generation performance suffered considerably as a result (see #23103).