bool runOnFunction(Function &F);
- /// getblockFreq - Return block frequency. Never return 0, value must be
- /// positive. Please note that initial frequency is equal to 1024. It means
+ /// getblockFreq - Return block frequency. Return 0 if we don't have the
+ /// information. Please note that initial frequency is equal to 1024. It means
/// that we should not rely on the value itself, but only on the comparison to
- /// the other block frequencies. We do this to avoid using of the floating
- /// points.
+ /// the other block frequencies. We do this to avoid using of floating points.
+ ///
uint32_t getBlockFreq(BasicBlock *BB);
};
}
public:
- /// getBlockFreq - Return block frequency. Never return 0, value must be
- /// positive.
+ /// getBlockFreq - Return block frequency. Return 0 if we don't have it.
uint32_t getBlockFreq(BlockT *BB) const {
typename DenseMap<BlockT *, uint32_t>::const_iterator I = Freqs.find(BB);
if (I != Freqs.end())
- return I->second ? I->second : 1;
- return 1;
+ return I->second;
+ return 0;
}
void print(raw_ostream &OS) const {
bool runOnMachineFunction(MachineFunction &F);
- /// getblockFreq - Return block frequency. Never return 0, value must be
- /// positive. Please note that initial frequency is equal to 1024. It means
+ /// getblockFreq - Return block frequency. Return 0 if we don't have the
+ /// information. Please note that initial frequency is equal to 1024. It means
/// that we should not rely on the value itself, but only on the comparison to
- /// the other block frequencies. We do this to avoid using of the floating
- /// points.
+ /// the other block frequencies. We do this to avoid using of floating points.
+ ///
uint32_t getBlockFreq(MachineBasicBlock *MBB);
};
return false;
}
-/// getblockFreq - Return block frequency. Never return 0, value must be
-/// positive. Please note that initial frequency is equal to 1024. It means that
-/// we should not rely on the value itself, but only on the comparison to the
-/// other block frequencies. We do this to avoid using of floating points.
+/// getblockFreq - Return block frequency. Return 0 if we don't have the
+/// information. Please note that initial frequency is equal to 1024. It means
+/// that we should not rely on the value itself, but only on the comparison to
+/// the other block frequencies. We do this to avoid using of floating points.
///
uint32_t BlockFrequency::getBlockFreq(BasicBlock *BB) {
return BFI->getBlockFreq(BB);
return false;
}
-/// getblockFreq - Return block frequency. Never return 0, value must be
-/// positive. Please note that initial frequency is equal to 1024. It means that
-/// we should not rely on the value itself, but only on the comparison to the
-/// other block frequencies. We do this to avoid using of floating points.
+/// getblockFreq - Return block frequency. Return 0 if we don't have the
+/// information. Please note that initial frequency is equal to 1024. It means
+/// that we should not rely on the value itself, but only on the comparison to
+/// the other block frequencies. We do this to avoid using of floating points.
///
uint32_t MachineBlockFrequency::getBlockFreq(MachineBasicBlock *MBB) {
return MBFI->getBlockFreq(MBB);