[PATCH] D113872: [CGP] Handle select instructions relying on the same condition

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 24 02:05:11 PST 2021


lkail added a comment.

In D113872#3148705 <https://reviews.llvm.org/D113872#3148705>, @shchenz wrote:

> If we make the SimplifyCFG pass keep the statically calculated branch weights(if any) for the select instructions, will our case be optimized like expected in the CGP pass? If so, I think letting SimplifyCFG pass keep the branch weights for the select instructions should make more sense. I saw there are some functions like `setBranchWeights` in SimplifyCFG pass that will update the branch weights, but not sure why it does not work for our case.

Looks we can't avoid if we use static analysis result from BPI by default when profiling data is missing, but the static result can't reflect actual misprediction and cause degradation


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113872



More information about the llvm-commits mailing list