diff options
author | Anton Bikineev <bikineev@chromium.org> | 2022-09-22 16:56:03 +0200 |
---|---|---|
committer | Anton Bikineev <bikineev@chromium.org> | 2022-10-08 23:49:27 +0200 |
commit | 7b85e765000df36fcc6a5191dec9a28f444245ba (patch) | |
tree | 76d2ccc2f7b7bff3f992e5bb3bbfb4fd3f53986f /llvm/lib/Support/StringRef.cpp | |
parent | 3a44435771270d90545df5a24f613f2dd4e3f433 (diff) | |
download | llvm-7b85e765000df36fcc6a5191dec9a28f444245ba.zip llvm-7b85e765000df36fcc6a5191dec9a28f444245ba.tar.gz llvm-7b85e765000df36fcc6a5191dec9a28f444245ba.tar.bz2 |
[PGO] Consider parent context when weighing branches with likelyhood.
Generally, with PGO enabled the C++20 likelyhood attributes shall be
dropped assuming the profile has a good coverage. However, currently
this is not the case for the following code:
if (always_false()) [[likely]] {
...
}
The patch fixes this and drops the attribute, if the parent context was
executed in the profile. The patch still preserves the attribute, if the
parent context was not executed, e.g. to support the cases when the
profile has insufficient coverage.
Differential Revision: https://reviews.llvm.org/D134456
Diffstat (limited to 'llvm/lib/Support/StringRef.cpp')
0 files changed, 0 insertions, 0 deletions