[PATCH] D120230: [SelectOpti][1/4] Setup new select-optimize pass

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 13 20:22:58 PDT 2022


wenlei added subscribers: Amir, maksfb.
wenlei added a comment.

In D120230#3377783 <https://reviews.llvm.org/D120230#3377783>, @apostolakis wrote:

> In D120230#3374674 <https://reviews.llvm.org/D120230#3374674>, @wenlei wrote:
>
>> Thanks for the patches. We've noticed similar problems as you described in RFC which often leads to way too aggressive cmov (in general and in comparison to gcc). Is the current version of this stack complete and functional? If so, we'd be happy to give it a try to see how it handles the suboptimal cases we spotted.
>
> This stack is complete and functional for x86 instr-PGO.

Thanks. I'm trying this with IRPGO on a large internal workload now, should have results soon. Will also take a closer look at the patch set.

> It is not yet tuned for Sample-PGO and there are some Sample-PGO-specific improvements that are yet to be made, most notably leveraging LBR data to capture misprediction rates and incorporating them in the heuristics (as discussed with @modimo in the RFC).

While we can have branch miss reported by perf tools and feedback into compiler sample PGO, it would be challenging to accurately correlate the actual branch miss to the unoptimized IR at profile loading time (it is a general challenge to apply any low level PMU info for compiler PGO).

> So, if you are interested in Sample-PGO it is better to wait for the next patch series that will tailor this pass for that. At that point, we can iterate and refine to make sure that the pass addresses these suboptimal cases and avoids regressions for your workloads.

For sample PGO, we're going to experiment with deferring some compiler if-convert to PLO (BOLT in our case), where the correlation of branch miss won't be a problem, and also to avoid the problem of being stuck with cmov. cc @Amir @maksfb


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120230



More information about the llvm-commits mailing list