mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Allow getBlockFreq to return 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135742 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
558cc5a914
commit
23f34f1c22
@ -40,11 +40,11 @@ public:
|
|||||||
|
|
||||||
bool runOnFunction(Function &F);
|
bool runOnFunction(Function &F);
|
||||||
|
|
||||||
/// getblockFreq - Return block frequency. Never return 0, value must be
|
/// getblockFreq - Return block frequency. Return 0 if we don't have the
|
||||||
/// positive. Please note that initial frequency is equal to 1024. It means
|
/// 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
|
/// 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
|
/// the other block frequencies. We do this to avoid using of floating points.
|
||||||
/// points.
|
///
|
||||||
uint32_t getBlockFreq(BasicBlock *BB);
|
uint32_t getBlockFreq(BasicBlock *BB);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -314,13 +314,12 @@ class BlockFrequencyImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// getBlockFreq - Return block frequency. Never return 0, value must be
|
/// getBlockFreq - Return block frequency. Return 0 if we don't have it.
|
||||||
/// positive.
|
|
||||||
uint32_t getBlockFreq(BlockT *BB) const {
|
uint32_t getBlockFreq(BlockT *BB) const {
|
||||||
typename DenseMap<BlockT *, uint32_t>::const_iterator I = Freqs.find(BB);
|
typename DenseMap<BlockT *, uint32_t>::const_iterator I = Freqs.find(BB);
|
||||||
if (I != Freqs.end())
|
if (I != Freqs.end())
|
||||||
return I->second ? I->second : 1;
|
return I->second;
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void print(raw_ostream &OS) const {
|
void print(raw_ostream &OS) const {
|
||||||
|
@ -40,11 +40,11 @@ public:
|
|||||||
|
|
||||||
bool runOnMachineFunction(MachineFunction &F);
|
bool runOnMachineFunction(MachineFunction &F);
|
||||||
|
|
||||||
/// getblockFreq - Return block frequency. Never return 0, value must be
|
/// getblockFreq - Return block frequency. Return 0 if we don't have the
|
||||||
/// positive. Please note that initial frequency is equal to 1024. It means
|
/// 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
|
/// 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
|
/// the other block frequencies. We do this to avoid using of floating points.
|
||||||
/// points.
|
///
|
||||||
uint32_t getBlockFreq(MachineBasicBlock *MBB);
|
uint32_t getBlockFreq(MachineBasicBlock *MBB);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -49,10 +49,10 @@ bool BlockFrequency::runOnFunction(Function &F) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getblockFreq - Return block frequency. Never return 0, value must be
|
/// getblockFreq - Return block frequency. Return 0 if we don't have the
|
||||||
/// positive. Please note that initial frequency is equal to 1024. It means that
|
/// information. Please note that initial frequency is equal to 1024. It means
|
||||||
/// we should not rely on the value itself, but only on the comparison to the
|
/// that we should not rely on the value itself, but only on the comparison to
|
||||||
/// other block frequencies. We do this to avoid using of floating points.
|
/// the other block frequencies. We do this to avoid using of floating points.
|
||||||
///
|
///
|
||||||
uint32_t BlockFrequency::getBlockFreq(BasicBlock *BB) {
|
uint32_t BlockFrequency::getBlockFreq(BasicBlock *BB) {
|
||||||
return BFI->getBlockFreq(BB);
|
return BFI->getBlockFreq(BB);
|
||||||
|
@ -50,10 +50,10 @@ bool MachineBlockFrequency::runOnMachineFunction(MachineFunction &F) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getblockFreq - Return block frequency. Never return 0, value must be
|
/// getblockFreq - Return block frequency. Return 0 if we don't have the
|
||||||
/// positive. Please note that initial frequency is equal to 1024. It means that
|
/// information. Please note that initial frequency is equal to 1024. It means
|
||||||
/// we should not rely on the value itself, but only on the comparison to the
|
/// that we should not rely on the value itself, but only on the comparison to
|
||||||
/// other block frequencies. We do this to avoid using of floating points.
|
/// the other block frequencies. We do this to avoid using of floating points.
|
||||||
///
|
///
|
||||||
uint32_t MachineBlockFrequency::getBlockFreq(MachineBasicBlock *MBB) {
|
uint32_t MachineBlockFrequency::getBlockFreq(MachineBasicBlock *MBB) {
|
||||||
return MBFI->getBlockFreq(MBB);
|
return MBFI->getBlockFreq(MBB);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user