History log of /llvm-project/bolt/lib/Profile/YAMLProfileWriter.cpp (Results 1 – 25 of 31)
Revision Date Author Comments
# 06e08696 12-Nov-2024 Kazu Hirata <kazu@google.com>

[BOLT] Fix warnings

This patch fixes:

bolt/lib/Profile/StaleProfileMatching.cpp:694:24: error: unused
variable 'BinHash' [-Werror,-Wunused-variable]

bolt/lib/Profile/YAMLProfileWriter.cpp:20

[BOLT] Fix warnings

This patch fixes:

bolt/lib/Profile/StaleProfileMatching.cpp:694:24: error: unused
variable 'BinHash' [-Werror,-Wunused-variable]

bolt/lib/Profile/YAMLProfileWriter.cpp:206:61: error: missing field
'GUID' initializer [-Werror,-Wmissing-field-initializers]

bolt/lib/Profile/YAMLProfileReader.cpp:840:16: error: unused
variable 'MatchedWithPseudoProbes' [-Werror,-Wunused-variable]

show more ...


# cd774c87 13-Sep-2024 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Rename ProfilePseudoProbeDesc

Address build issues due to aliasing PseudoProbeDesc, e.g.
https://lab.llvm.org/buildbot/#/builders/113/builds/2743


# c00c62c1 13-Sep-2024 Amir Ayupov <aaupov@fb.com>

[BOLT] Add pseudo probe inline tree to YAML profile

Add probe inline tree information to YAML profile, at function level:
- function GUID,
- checksum,
- parent node id,
- call site in the parent.

T

[BOLT] Add pseudo probe inline tree to YAML profile

Add probe inline tree information to YAML profile, at function level:
- function GUID,
- checksum,
- parent node id,
- call site in the parent.

This information is used for pseudo probe block matching (#99891).

The encoding adds/changes probe information in multiple levels of
YAML profile:
- BinaryProfile: add pseudo_probe_desc with GUIDs and Hashes, which
permits deduplication of data:
- many GUIDs are duplicate as the same callee is commonly inlined
into multiple callers,
- hashes are also very repetitive, especially for functions with
low block counts.
- FunctionProfile: add inline tree (see above). Top-level function
is included as root of function inline tree, which makes guid and
pseudo_probe_desc_hash fields redundant.
- BlockProfile: densely-encoded block probe information:
- probes reference their containing inline tree node,
- separate lists for block, call, indirect call probes,
- block probe encoding is specialized: ids are encoded as bitset
in uint64_t. If only block probe with id=1 is present, it's
encoded as implicit entry (id=0, omitted).
- inline tree nodes with identical probes share probe description
where node indices are combined into a list.

On top of #107970, profile with new probe encoding has the following
characteristics (profile for a large binary):

- Profile without probe information: 33MB, 3.8MB compressed (baseline).
- Profile with inline tree information: 92MB, 14MB compressed.

Profile processing time (YAML parsing, inference, attaching steps):
- profile without pseudo probes: 5s,
- profile with pseudo probes, without pseudo probe matching: 11s,
- with pseudo probe matching: 12.5s.

Test Plan: updated pseudoprobe-decoding-inline.test

Reviewers: wlei-llvm, ayermolo, rafaelauler, dcci, maksfb

Reviewed By: wlei-llvm, rafaelauler

Pull Request: https://github.com/llvm/llvm-project/pull/107137

show more ...


# c820bd3e 11-Sep-2024 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Rename profile-use-pseudo-probes

The flag currently controls writing of probe information in YAML
profile. #99891 adds a separate flag to use probe information for stale
profile matching

[BOLT][NFC] Rename profile-use-pseudo-probes

The flag currently controls writing of probe information in YAML
profile. #99891 adds a separate flag to use probe information for stale
profile matching. Thus `profile-use-pseudo-probes` becomes a misnomer
and `profile-write-pseudo-probes` better captures the intent.

Reviewers: maksfb, WenleiHe, ayermolo, rafaelauler, dcci

Reviewed By: rafaelauler

Pull Request: https://github.com/llvm/llvm-project/pull/106364

show more ...


# ee09f7d1 26-Aug-2024 Amir Ayupov <aaupov@fb.com>

[MC][NFC] Reduce Address2ProbesMap size

Replace the map from addresses to list of probes with a flat vector
containing probe references sorted by their addresses.

Reduces pseudo probe parsing time

[MC][NFC] Reduce Address2ProbesMap size

Replace the map from addresses to list of probes with a flat vector
containing probe references sorted by their addresses.

Reduces pseudo probe parsing time from 9.56s to 8.59s and peak RSS from
9.66 GiB to 9.08 GiB as part of perf2bolt processing a large binary.

Test Plan:
```
bin/llvm-lit -sv test/tools/llvm-profgen
```

Reviewers: maksfb, rafaelauler, dcci, ayermolo, wlei-llvm

Reviewed By: wlei-llvm

Pull Request: https://github.com/llvm/llvm-project/pull/102904

show more ...


# 4d19676d 24-Jul-2024 Amir Ayupov <aaupov@fb.com>

[BOLT] Add profile-use-pseudo-probes option

Move pseudo probe profile generation under --profile-use-pseudo-probes
option. Note that updating pseudo probes is independent from this flag.

Test Plan:

[BOLT] Add profile-use-pseudo-probes option

Move pseudo probe profile generation under --profile-use-pseudo-probes
option. Note that updating pseudo probes is independent from this flag.

Test Plan: updated pseudoprobe-decoding-inline.test

Reviewers: maksfb, rafaelauler, ayermolo, dcci, WenleiHe

Reviewed By: WenleiHe

Pull Request: https://github.com/llvm/llvm-project/pull/100299

show more ...


# c905db67 19-Jul-2024 Amir Ayupov <aaupov@fb.com>

[BOLT] Attach pseudo probes to blocks in YAML profile

Read pseudo probes in regular and BAT YAML profile generation, and
attach them to YAML profile basic blocks. This exposes GUID, probe id,
and pr

[BOLT] Attach pseudo probes to blocks in YAML profile

Read pseudo probes in regular and BAT YAML profile generation, and
attach them to YAML profile basic blocks. This exposes GUID, probe id,
and probe type in profile for future use in stale profile matching.

Test Plan: updated pseudoprobe-decoding-inline.test

Reviewers: dcci, rafaelauler, ayermolo, maksfb

Reviewed By: rafaelauler

Pull Request: https://github.com/llvm/llvm-project/pull/99554

show more ...


# 9b007a19 19-Jul-2024 Amir Ayupov <aaupov@fb.com>

[BOLT] Expose pseudo probe function checksum and GUID (#99389)

Add a BinaryFunction field for pseudo probe function GUID.
Populate it during pseudo probe section parsing, and emit it in YAML
profi

[BOLT] Expose pseudo probe function checksum and GUID (#99389)

Add a BinaryFunction field for pseudo probe function GUID.
Populate it during pseudo probe section parsing, and emit it in YAML
profile (both regular and BAT), along with function checksum.

To be used for stale function matching.

Test Plan: update pseudoprobe-decoding-inline.test

show more ...


# 4be3083b 31-May-2024 shaw young <58664393+shawbyoung@users.noreply.github.com>

[BOLT] Remove mutable from BB::LayoutIndex (#93224)

Removed mutability from BB::LayoutIndex, subsequently removed const from
BB::SetLayout, and changed BF::dfs to track visited blocks with a set as

[BOLT] Remove mutable from BB::LayoutIndex (#93224)

Removed mutability from BB::LayoutIndex, subsequently removed const from
BB::SetLayout, and changed BF::dfs to track visited blocks with a set as
opposed to tracking and altering LayoutIndexes for more consistent code.

show more ...


# 97025bd9 22-May-2024 Amir Ayupov <aaupov@fb.com>

[BOLT] Use getLocationName in YAMLProfileWriter (#92493)

Disambiguate local functions using the containing file symbol in BAT
mode. Make local function naming consistent across BAT fdata and YAML

[BOLT] Use getLocationName in YAMLProfileWriter (#92493)

Disambiguate local functions using the containing file symbol in BAT
mode. Make local function naming consistent across BAT fdata and YAML
profiles.

Test Plan: updated register-fragments-bolt-symbols.s

show more ...


# 935b946b 22-May-2024 Amir Ayupov <aaupov@fb.com>

[BOLT] Process cross references between ignored functions in BAT mode (#92484)

To align YAML and fdata profiles produced in BAT mode, lift two
restrictions applied in non-relocation mode when BAT i

[BOLT] Process cross references between ignored functions in BAT mode (#92484)

To align YAML and fdata profiles produced in BAT mode, lift two
restrictions applied in non-relocation mode when BAT is present:
1) register secondary entry points from ignored functions,
2) treat functions with secondary entry points as simple.

This allows constructing CFG for non-simple functions in non-relocation
mode and emitting YAML profile for them, which can then be used for
optimizations in relocation mode.

Test Plan: added test ignored-interprocedural-reference.s

show more ...


# 2d3c827c 05-Apr-2024 Amir Ayupov <aaupov@fb.com>

[BOLT] Use BAT for YAML profile call target information

Provide a mechanism to resolve call target information for calls from non-BAT
functions to BAT functions (`YAMLProfileWriter::convert`). Make

[BOLT] Use BAT for YAML profile call target information

Provide a mechanism to resolve call target information for calls from non-BAT
functions to BAT functions (`YAMLProfileWriter::convert`). Make it generic for
future use in BAT-to-BAT calls.

Test Plan: Updated bolt/test/X86/bolt-address-translation-yaml.test

Reviewers: ayermolo, maksfb, rafaelauler, dcci

Reviewed By: maksfb

Pull Request: https://github.com/llvm/llvm-project/pull/86219

show more ...


# 385e3e26 27-Mar-2024 Amir Ayupov <aaupov@fb.com>

[BOLT] Set EntryDiscriminator in YAML profile for indirect calls

Indirect call handling missed setting an `EntryDiscriminator` while it's
set for direct calls and tail calls.

Improve YAML profile a

[BOLT] Set EntryDiscriminator in YAML profile for indirect calls

Indirect call handling missed setting an `EntryDiscriminator` while it's
set for direct calls and tail calls.

Improve YAML profile accuracy by unifying the destination setting
between direct and indirect calls into `setCSIDestination` method.

Depends on: https://github.com/llvm/llvm-project/pull/86848

Test Plan: Updated bolt/test/X86/yaml-secondary-entry-discriminator.s

Reviewers: ayermolo, maksfb, rafaelauler

Reviewed By: maksfb

Pull Request: https://github.com/llvm/llvm-project/pull/82128

show more ...


# de0abc09 20-Mar-2024 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Simplify YAMLProfileWriter::convert

Use `getAnnotationWithDefault` instead of testing if the annotation is
set. If the default value is used, and `CSI.Count` is set to zero, the
target i

[BOLT][NFC] Simplify YAMLProfileWriter::convert

Use `getAnnotationWithDefault` instead of testing if the annotation is
set. If the default value is used, and `CSI.Count` is set to zero, the
target is discarded by a check below.

Test Plan: NFC

Reviewers: maksfb, dcci, rafaelauler, ayermolo

Reviewed By: ayermolo

Pull Request: https://github.com/llvm/llvm-project/pull/82129

show more ...


# 061b4089 20-Mar-2024 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Expose YAMLProfileWriter::convert function

The function is to be used by YAML profile emission in BAT mode for
BinaryFunctions not covered by BAT tables (same as in original binary).

Te

[BOLT][NFC] Expose YAMLProfileWriter::convert function

The function is to be used by YAML profile emission in BAT mode for
BinaryFunctions not covered by BAT tables (same as in original binary).

Test Plan: NFC

Reviewers: rafaelauler, ayermolo, dcci, maksfb

Reviewed By: dcci

Pull Request: https://github.com/llvm/llvm-project/pull/76909

show more ...


# b039ccc6 11-Dec-2023 Amir Ayupov <aaupov@fb.com>

[BOLT] Provide backwards compatibility for YAML profile with std::hash (#74253)

Provide backwards compatibility for YAML profile that uses `std::hash`:
xxh3 hash is the default for newly produced p

[BOLT] Provide backwards compatibility for YAML profile with std::hash (#74253)

Provide backwards compatibility for YAML profile that uses `std::hash`:
xxh3 hash is the default for newly produced profile (sets `std-hash:
false`),
whereas the profile that doesn't specify `std-hash` will be treated as
`std-hash: true`, preserving old behavior.

show more ...


# 1e0d08e8 25-Jul-2023 Amir Ayupov <aaupov@fb.com>

[BOLT] Add blocks order kind to YAML profile header

Specify blocks order used in YAML profile. Needed to ensure profile backwards
compatibility with pre-D155514 DFS order by default.

Reviewed By: #

[BOLT] Add blocks order kind to YAML profile header

Specify blocks order used in YAML profile. Needed to ensure profile backwards
compatibility with pre-D155514 DFS order by default.

Reviewed By: #bolt, maksfb

Differential Revision: https://reviews.llvm.org/D156176

show more ...


# 69b7e257 18-Jul-2023 Amir Ayupov <aaupov@fb.com>

[BOLT] Switch to using layout order in YAML

Use layout order in YAML profile reading/writing. Preserve old behavior (DFS order)
under `-profile-use-dfs` option.

Reviewed By: spupyrev

Differential

[BOLT] Switch to using layout order in YAML

Use layout order in YAML profile reading/writing. Preserve old behavior (DFS order)
under `-profile-use-dfs` option.

Reviewed By: spupyrev

Differential Revision: https://reviews.llvm.org/D155514

show more ...


# 6c873155 20-Jun-2023 Amir Ayupov <aaupov@fb.com>

[BOLT] Sort CallSiteInfo targets by symbol name in YAMLWriter

Align YAML and fdata profiles by sorting CallSiteInfo targets by symbol name,
aligning it to fdata. By default, YAML CallSiteInfo is sor

[BOLT] Sort CallSiteInfo targets by symbol name in YAMLWriter

Align YAML and fdata profiles by sorting CallSiteInfo targets by symbol name,
aligning it to fdata. By default, YAML CallSiteInfo is sorted by function id,
which is the order of function in the binary.

Follow-up to D152731, aligning yaml vs fdata, and in turn all three between to
each other.

Reviewed By: #bolt, rafauler

Differential Revision: https://reviews.llvm.org/D152733

show more ...


# 3e3a926b 16-Feb-2023 spupyrev <spupyrev@fb.com>

[BOLT][NFC] Add hash computation for basic blocks

Extending yaml profile format with block hashes, which are used for stale
profile matching. To avoid duplication of the code, created a new class wi

[BOLT][NFC] Add hash computation for basic blocks

Extending yaml profile format with block hashes, which are used for stale
profile matching. To avoid duplication of the code, created a new class with a
collection of utilities for computing hashes.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D144306

show more ...


# e8f5743e 11-Dec-2022 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Use std::optional in BC


# 2563fd63 06-Dec-2022 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Use std::optional in MCPlusBuilder

Reviewed By: maksfb, #bolt

Differential Revision: https://reviews.llvm.org/D139260


# 34bcadc3 23-Nov-2022 Kazu Hirata <kazu@google.com>

Use std::nullopt_t instead of NoneType (NFC)

This patch replaces those occurrences of NoneType that would trigger
an error if the definition of NoneType were missing in None.h.

To keep this patch f

Use std::nullopt_t instead of NoneType (NFC)

This patch replaces those occurrences of NoneType that would trigger
an error if the definition of NoneType were missing in None.h.

To keep this patch focused, I am deliberately not replacing None with
std::nullopt in this patch or updating comments. They will be
addressed in subsequent patches.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

Differential Revision: https://reviews.llvm.org/D138539

show more ...


# ce3b687b 31-Jul-2022 Kazu Hirata <kazu@google.com>

[BOLT] Remove redundaunt string initialization (NFC)

Identified with readability-redundant-string-init.


# d2c87699 24-Jun-2022 Amir Ayupov <aaupov@fb.com>

[BOLT][NFC] Use range-based STL wrappers

Replace `std::` algorithms taking begin/end iterators with `llvm::` counterparts
accepting ranges.

Reviewed By: rafauler

Differential Revision: https://rev

[BOLT][NFC] Use range-based STL wrappers

Replace `std::` algorithms taking begin/end iterators with `llvm::` counterparts
accepting ranges.

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D128154

show more ...


12