[all-commits] [llvm/llvm-project] e80a2a: [Utils] Identity map global debug info on first us...
Artem Pianykh via All-commits
all-commits at lists.llvm.org
Fri Dec 6 04:44:21 PST 2024
Branch: refs/heads/users/artempyanykh/fast-coro-upstream/8
Home: https://github.com/llvm/llvm-project
Commit: e80a2a7f695152cf572c59ef22a7f9371c808fc7
https://github.com/llvm/llvm-project/commit/e80a2a7f695152cf572c59ef22a7f9371c808fc7
Author: Artem Pianykh <arr at fb.com>
Date: 2024-09-15 (Sun, 15 Sep 2024)
Changed paths:
M llvm/include/llvm/Transforms/Utils/Cloning.h
M llvm/include/llvm/Transforms/Utils/ValueMapper.h
M llvm/lib/Transforms/Utils/CloneFunction.cpp
M llvm/lib/Transforms/Utils/ValueMapper.cpp
Log Message:
-----------
[Utils] Identity map global debug info on first use in CloneFunction*
Summary:
To avoid cloning 'global' debug info, CloneFunction implementation used to eagerly identity map a known
subset of global debug into into ValueMap's MD map. In larger modules with meaningful volume of
debug info this gets very expensive.
By passing such global metadata via an IdentityMD set for the ValueMapper to map on first use, we
get several benefits:
1. Mapping metadata is not cheap, particularly because of tracking. When cloning a Function we
identity map lots of global module-level metadata to avoid cloning it, while only a fraction of it
is actually used by the function. Mapping on first use is a lot faster for modules with meaningful
amount of debug info.
2. Eagerly identity mapping metadata makes it harder to cache module-level data (e.g. a set of
metadata nodes in a \a DICompileUnit). With this patch we can cache certain module-level metadata
calculations to speed things up further.
Anecdata from compiling a sample cpp file with full debug info shows that this moderately speeds up
CoroSplitPass which is one of the heavier users of cloning:
| | Baseline | IdentityMD set |
|-----------------+----------+----------------|
| CoroSplitPass | 306ms | 221ms |
| CoroCloner | 101ms | 72ms |
|-----------------+----------+----------------|
| Speed up | 1x | 1.4x |
Test Plan:
ninja check-llvm-unit
ninja check-llvm
stack-info: PR: https://github.com/llvm/llvm-project/pull/118627, branch: users/artempyanykh/fast-coro-upstream/8
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