[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
Loading
Please sign in to comment