And use it in MachineOptimizationRemarkEmitter. A test will follow on top of
Justin's changes to enable MachineORE in AsmPrinter.
The approach is similar to the IR-level pass. It's a bit simpler because BPI
is immutable at the Machine level so we don't need to make that lazy.
Because of this a new function mapping is introduced (calculateBPI) at the
IR-agnostic LazyBlockFrequencyInfo class. This function calculates and
extracts BPI from the pass. For Machine-level, this is the identity function
It is quite confusing to read the code here regarding xxxInfo, xxxInfoPass and default parameters. It may be more readable to get rid of the last parameter, but instead do this:
class LazyBranchProbabilityInfoPass ... {
public:
};
class MachineBranchProbablityInfo ... {
public:
..
};
and then
template <...>
class LazyBlockFrequencyInfo {
};