The sample loader changes the branch probability but not BFI. Here we force a recompute of BFI if the branch probabilities are changed.
No performance changes with google benchmarks.
This patch also registers FSAFDO MIR passes probably.
Paths
| Differential D114400
[SampleFDO] Compute BFI if the sample loader changes BPI in FSAFDO ClosedPublic Authored by xur on Nov 22 2021, 2:32 PM.
Details Summary The sample loader changes the branch probability but not BFI. Here we force a recompute of BFI if the branch probabilities are changed. This patch also registers FSAFDO MIR passes probably.
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Nov 22 2021, 3:58 PM Closed by commit rGbf1138491a2b: [SampleFDO] Recompute BFI if the sample loader changes BPI (authored by xur). · Explain WhyNov 23 2021, 1:42 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 389311 llvm/lib/CodeGen/CodeGen.cpp
llvm/lib/CodeGen/MIRSampleProfile.cpp
llvm/test/CodeGen/X86/fsafdo_test3.ll
|
When profile loader leads to change, we should probably recalculate BFI. But should BFI calculation be done outside of sample loader given BFI is a separate analysis? The IR BFI is done outside of sample loader.
It feels to me that updating MBFI inside sample loader kind of breaks the componentization.