llvm-project
f9c561b5 - [profcheck] Fix encoding of 0 loopEstimatedTrip count (#174896)

Commit
104 days ago
[profcheck] Fix encoding of 0 loopEstimatedTrip count (#174896) We currently encode an estimated trip count of 0 as the latch having branch probabilities 0-0. That's an invalid pair of weights. The probability of a branch is computed as a fraction of its corresponding weight and the sum of the weights. In fact, `BranchProbabilityInfo::calcMetadataWeights` will convert this to a 1-1, meaning 50% - 50%, which isn't quite what we want. To indicate the loop is never taken, we just need to initialize the exit probability to non-zero (hence, 1) Related: https://reviews.llvm.org/D67905 Issue #147390
Author
Parents
Loading