[PATCH] D98898: [SimplifyCFG] use profile metadata to refine merging branch conditions

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 21 12:18:58 PDT 2021


lebedev.ri added a comment.

In D98898#2640287 <https://reviews.llvm.org/D98898#2640287>, @spatel wrote:

> In D98898#2640239 <https://reviews.llvm.org/D98898#2640239>, @lebedev.ri wrote:
>
>> Can prof metadata and `MD_unpredictable` be mixed together?
>> What should we do here in presence of `MD_unpredictable`?
>
> They can be mixed, but I don't see any precedence for dealing with them simultaneously. So we get to decide here :) -- or in a follow-up standalone patch to make it more definitive
> In theory, either of these metadata could be attached manually by a programmer or from actual training data / profile-guided optimization (PGO). 
> I'm leaning towards having `unpredictable` be the winner in that case because branch weights are good, but they can't really tell us how a given target will behave since we can't model even basic branch history hardware here. So we have to defer to whoever/whatever said a branch was unpredictable as true/correct.

I also believe `unpredictable` should win.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98898/new/

https://reviews.llvm.org/D98898



More information about the llvm-commits mailing list