[all-commits] [llvm/llvm-project] 24860c: [Coro] Prebuild a global debug info set and share ...

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


  Branch: refs/heads/users/artempyanykh/fast-coro-upstream/9
  Home:   https://github.com/llvm/llvm-project
  Commit: 24860c10f322d25f5a520e15aa76cb0b2b14af61
      https://github.com/llvm/llvm-project/commit/24860c10f322d25f5a520e15aa76cb0b2b14af61
  Author: Artem Pianykh <arr at fb.com>
  Date:   2024-11-19 (Tue, 19 Nov 2024)

  Changed paths:
    M llvm/lib/Transforms/Coroutines/CoroCloner.h
    M llvm/lib/Transforms/Coroutines/CoroSplit.cpp

  Log Message:
  -----------
  [Coro] Prebuild a global debug info set and share it between all coroutine clones

Summary:
CoroCloner, by calling into CloneFunctionInto, does a lot of repeated work priming DIFinder and building
a list of global debug info metadata. For programs compiled with full debug info this gets very
expensive.

This diff builds the data once and shares it between all clones.

Anecdata for a sample cpp source file compiled with full debug info:

|                 | Baseline | IdentityMD set | Prebuilt GlobalDI (cur.) |
|-----------------+----------+----------------+--------------------------|
| CoroSplitPass   | 306ms    | 221ms          | 68ms                     |
| CoroCloner      | 101ms    | 72ms           | 0.5ms                    |
| CollectGlobalDI | -        | -              | 63ms                     |
|-----------------+----------+----------------+--------------------------|
| Speed up        | 1x       | 1.4x           | 4.5x                     |

Note that CollectGlobalDI happens once *per coroutine* rather than per clone.

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

Compiled a sample internal source file, checked time trace output for scope timings.

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



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