In line 68, func getBlockFreqRelativeToEntryBlock assume getEntryFreq() is
non-zero, but the function could return 0, add assert to confirm it.
Reviewed By: HaohaiWen
Differential Revision: https://reviews.llvm.org/D148606
/// Compute the frequency of the block, relative to the entry block.
/// This API assumes getEntryFreq() is non-zero.
float getBlockFreqRelativeToEntryBlock(const MachineBasicBlock *MBB) const {
+ assert(getEntryFreq() != 0 && "getEntryFreq() should not return 0 here!");
return getBlockFreq(MBB).getFrequency() * (1.0f / getEntryFreq());
}