[PATCH] D12341: add llvm.unpredictable intrinsic and lower it to metadata

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 05:52:22 PDT 2015


kparzysz added a comment.

In http://reviews.llvm.org/D12341#234593, @kbsmith1 wrote:

> I am suggesting that you only have a single number that represents the percentage of time that the direction is mispredicted.


This is really the original idea if we assume that a change of direction causes a misprediction.  The problem with tracking "misprediction" rate is that it does depend on the specific hardware.  The implementation of the hardware branch prediction may change between subtargets of the same target, which is why I proposed tracking the behavior of the branch instead.  A subtarget could then use this information to estimate the misprediction rate, which may not be as accurate as tracking misprediction itself for that subtarget, but it would be portable.


http://reviews.llvm.org/D12341





More information about the llvm-commits mailing list