[PATCH] [MachineSink+PGO] Teach MachineSink to use BlockFrequencyInfo

Quentin Colombet qcolombet at apple.com
Wed Sep 24 13:56:44 PDT 2014


Hi Bruno,

Thanks for the quick update.

LGTM.

One remark:
uint64_t LHSFreq = MBFI ? MBFI->getBlockFreq(L).getFrequency() : 0;

We could avoid the penalty of checking whether or not MBFI is available for each tested pair by setting different call backs (one that always returns 0, and one that returns the actual frequency). Those callbacks would be set once in the beginning of runOnMachineFunction, hence having MBFI tested only once. I do not think this will have a measurable impact for most cases. So, this is fine to leave that like this, moreover, if you plan to kill the option, this won’t be necessary anymore :).

Thanks,
-Quentin

http://reviews.llvm.org/D5447






More information about the llvm-commits mailing list