[all-commits] [llvm/llvm-project] 5ce349: [Coro] Prebuild a module-level debug info set and ...

Artem Pianykh via All-commits all-commits at lists.llvm.org
Fri Jan 24 03:43:08 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5ce349589a4adcc18f5807551bf4b78091746aa8
      https://github.com/llvm/llvm-project/commit/5ce349589a4adcc18f5807551bf4b78091746aa8
  Author: Artem Pianykh <artem.pyanykh at gmail.com>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

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

  Log Message:
  -----------
  [Coro] Prebuild a module-level debug info set and share it between all coroutine clones (#118628)


Summary:
CoroCloner, by calling into CloneFunctionInto, does a lot of repeated
work priming DIFinder and building a list of common module-level debug
info metadata. For programs compiled with full debug info this can get
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 CommonDI (cur.) |
|-----------------|----------|----------------|--------------------------|
| CoroSplitPass   | 306ms    | 221ms          | 68ms                     |
| CoroCloner      | 101ms    | 72ms           | 0.5ms                    |
| CollectCommonDI | -        | -              | 63ms                     |
| Speed up        | 1x       | 1.4x           | 4.5x                     |

Note that CollectCommonDebugInfo 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.



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