[SampleFDO] Recompute BFI if the sample loader changes BPI
authorRong Xu <xur@google.com>
Mon, 22 Nov 2021 22:03:32 +0000 (14:03 -0800)
committerRong Xu <xur@google.com>
Tue, 23 Nov 2021 21:24:31 +0000 (13:24 -0800)
commitbf1138491a2ba12dce0c3ff2ad6a18f093428539
tree55eeb80d0c15d5a1f19eb57894ae7c5192d8c300
parent67a1c45def8a75061203461ab0060c75c864df1c
[SampleFDO] Recompute BFI if the sample loader changes BPI

The MIR sample loader changes the branch probability but not BFI.
Here we force a recompute of BFI if the branch probabilities are
changed.

Also register the MIR FSAFDO passes properly.

Differential Revision: https://reviews.llvm.org/D114400
llvm/lib/CodeGen/CodeGen.cpp
llvm/lib/CodeGen/MIRSampleProfile.cpp
llvm/test/CodeGen/X86/fsafdo_test3.ll [new file with mode: 0644]