diff options
author | Jakub Staszak <jstaszak@apple.com> | 2011-07-22 02:24:57 +0000 |
---|---|---|
committer | Jakub Staszak <jstaszak@apple.com> | 2011-07-22 02:24:57 +0000 |
commit | 23f34f1c22db8df6e767a29365d668ac9ede112c (patch) | |
tree | c4a340488f07e6af338281d856ec91c0d52c8751 /include/llvm/Analysis/BlockFrequencyImpl.h | |
parent | 558cc5a914118bba0e7843f1878f6137fea88d91 (diff) |
Allow getBlockFreq to return 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135742 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/BlockFrequencyImpl.h')
-rw-r--r-- | include/llvm/Analysis/BlockFrequencyImpl.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/llvm/Analysis/BlockFrequencyImpl.h b/include/llvm/Analysis/BlockFrequencyImpl.h index 6580fd1e4a..5a22b519f1 100644 --- a/include/llvm/Analysis/BlockFrequencyImpl.h +++ b/include/llvm/Analysis/BlockFrequencyImpl.h @@ -314,13 +314,12 @@ class BlockFrequencyImpl { } 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 { |