Skip to content
Snippets Groups Projects

Add flags that allow for optional inclusion of stack frame info tables and info tables with defaulted source locations in the info table map

Closed Finley McIlwaine requested to merge wip/t23702 into master

Fixes #23702 (closed)

Introduces -finfo-table-map-with-stack and -finfo-table-map-with-fallback flags, implied by -finfo-table-map. Respectively, these flags result in the inclusion of STACK info tables and info tables for which no provenance exists in the program source in the info table map. The negative versions of these flags (-fno-info-table-map-with-stack, -fno-info-table-map-with-fallback) are useful for reducing the size of build results with info table profiling information.

In testing on the Agda codebase, omitting STACK and fallback tables shrunk build results by about 10% (118M down to 105M). This was tested by running

cabal build Agda:exe:agda --ghc-options="-Wno-x-partial -Wno-deprecations -finfo-table-map

and then

du -hc dist-newstyle/build/aarch64-osx/ghc-9.9.20230720/Agda-2.6.4/build/**/*.o

then repeating with -fno-info-table-map-with-stack and -fno-info-table-map-with-fallback.

This MR also significantly refactors the construction of the info table map, and derives an Ord instance for CmmInfoTable so it could be used as a key in a Data.Map.Map.

Edited by Finley McIlwaine

Merge request reports

Merge request pipeline #82773 passed

Merge request pipeline passed for 119c1268

Approval is optional
Test summary results are being parsed

Closed by Marge BotMarge Bot 1 year ago (Aug 10, 2023 11:17pm UTC)

Merge details

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 [1 of 1] Compiling Control.Lens.Fold ( Fold.hs, Fold.o )
2
3 ==================== IPE Stats for module Control.Lens.Fold ====================
  • 635 instance Outputable IPEStats where
    636 ppr = pprIPEStats
    637
    638 pprIPEStats :: IPEStats -> SDoc
    639 pprIPEStats (IPEStats{..}) =
    640 vcat $ [ text "Tables with info:" <+> ppr ipe_total
    641 , text "Tables with fallback:" <+> ppr ipe_fallback
    642 , text "Tables skipped:" <+> ppr ipe_skipped
    643 ] ++ [ text "Info(" <> ppr k <> text "):" <+> ppr n | (k, n) <- I.assocs ipe_closure_types ]
    644
    610 645 -- | Convert source information collected about identifiers in 'GHC.STG.Debug'
    611 646 -- to entries suitable for placing into the info table provenance table.
    612 convertInfoProvMap :: [CmmInfoTable] -> Module -> InfoTableProvMap -> [InfoProvEnt]
    613 convertInfoProvMap defns this_mod (InfoTableProvMap (UniqMap dcenv) denv infoTableToSourceLocationMap) =
    614 map (\cmit ->
    647 convertInfoProvMap :: StgToCmmConfig -> Module -> InfoTableProvMap -> (IPEStats, [InfoProvEnt]) -> CmmInfoTable -> (IPEStats, [InfoProvEnt])
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading