[all-commits] [llvm/llvm-project] 5d378d: [Coro] Use DebugInfoCache to speed up cloning in C...

Artem Pianykh via All-commits all-commits at lists.llvm.org
Fri Dec 6 06:04:29 PST 2024


  Branch: refs/heads/users/artempyanykh/fast-coro-upstream/11
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d378de3f19de46a5283d8697bc5f2b5013baaf9
      https://github.com/llvm/llvm-project/commit/5d378de3f19de46a5283d8697bc5f2b5013baaf9
  Author: Artem Pianykh <arr at fb.com>
  Date:   2024-12-06 (Fri, 06 Dec 2024)

  Changed paths:
    M llvm/include/llvm/Transforms/Coroutines/ABI.h
    M llvm/lib/Analysis/CGSCCPassManager.cpp
    M llvm/lib/Transforms/Coroutines/CoroSplit.cpp
    M llvm/test/Other/new-pass-manager.ll
    M llvm/test/Other/new-pm-defaults.ll
    M llvm/test/Other/new-pm-lto-defaults.ll
    M llvm/test/Other/new-pm-pgo-preinline.ll
    M llvm/test/Other/new-pm-thinlto-postlink-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-prelink-defaults.ll
    M llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll
    M llvm/unittests/Analysis/CGSCCPassManagerTest.cpp

  Log Message:
  -----------
  [Coro] Use DebugInfoCache to speed up cloning in CoroSplitPass

Summary:
We can use a DebugInfoFinder from DebugInfoCache which is already primed on a compile unit to speed
up collection of global debug info.

The pass could likely be another 2x+ faster if we avoid rebuilding the set of global debug
info. This needs further massaging of CloneFunction and ValueMapper, though, and can be done
incrementally on top of this.

Comparing performance of CoroSplitPass at various points in this stack, this is anecdata from a sample
cpp file compiled with full debug info:
|                 | Baseline | IdentityMD set | Prebuilt GlobalDI | Cached CU DIFinder (cur.) |
|-----------------+----------+----------------+-------------------+---------------------------|
| CoroSplitPass   | 306ms    | 221ms          | 68ms              | 17ms                      |
| CoroCloner      | 101ms    | 72ms           | 0.5ms             | 0.5ms                     |
| CollectGlobalDI | -        | -              | 63ms              | 13ms                      |
|-----------------+----------+----------------+-------------------+---------------------------|
| Speed up        | 1x       | 1.4x           | 4.5x              | 18x                       |

Test Plan:
ninja check-llvm-unit
ninja check-llvm

Compiled a sample cpp file with time trace to get the avg. duration of the pass and inner scopes.

stack-info: PR: https://github.com/llvm/llvm-project/pull/118630, branch: users/artempyanykh/fast-coro-upstream/11



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list