diff options
| author | Michael Gottesman <mgottesman@apple.com> | 2013-12-14 00:06:03 +0000 |
|---|---|---|
| committer | Michael Gottesman <mgottesman@apple.com> | 2013-12-14 00:06:03 +0000 |
| commit | fd5c4b2c096851205443479135a038bdc97c8cb2 (patch) | |
| tree | 9514741d23d767ae6c54cdd4d263c122f3a1cc33 /llvm | |
| parent | f11917614d61ab062f638741a5f1a9df492d8014 (diff) | |
| download | bcm5719-llvm-fd5c4b2c096851205443479135a038bdc97c8cb2.tar.gz bcm5719-llvm-fd5c4b2c096851205443479135a038bdc97c8cb2.zip | |
[block-freq] Add the equivalent methods to MachineBlockFrequencyInfo and BlockFrequencyInfo that were added to BlockFrequencyImpl in r197285 and r197284.
llvm-svn: 197287
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Analysis/BlockFrequencyInfo.h | 9 | ||||
| -rw-r--r-- | llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h | 12 | ||||
| -rw-r--r-- | llvm/lib/Analysis/BlockFrequencyInfo.cpp | 11 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp | 16 |
4 files changed, 48 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/BlockFrequencyInfo.h b/llvm/include/llvm/Analysis/BlockFrequencyInfo.h index a123d0b8c13..bd44ae34e5b 100644 --- a/llvm/include/llvm/Analysis/BlockFrequencyInfo.h +++ b/llvm/include/llvm/Analysis/BlockFrequencyInfo.h @@ -50,6 +50,15 @@ public: /// comparison to the other block frequencies. We do this to avoid using of /// floating points. BlockFrequency getBlockFreq(const BasicBlock *BB) const; + + // Print the block frequency Freq to OS using the current functions entry + // frequency to convert freq into a relative decimal form. + raw_ostream &printBlockFreq(raw_ostream &OS, const BlockFrequency Freq) const; + + // Convenience method that attempts to look up the frequency associated with + // BB and print it to OS. + raw_ostream &printBlockFreq(raw_ostream &OS, const BasicBlock *BB) const; + }; } diff --git a/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h b/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h index 2bd51e8a75d..761b59cb1d2 100644 --- a/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h +++ b/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h @@ -52,6 +52,18 @@ public: MachineFunction *getFunction() const; void view() const; + + // Print the block frequency Freq to OS using the current functions entry + // frequency to convert freq into a relative decimal form. + raw_ostream &printBlockFreq(raw_ostream &OS, const BlockFrequency Freq) const; + + // Convenience method that attempts to look up the frequency associated with + // BB and print it to OS. + raw_ostream &printBlockFreq(raw_ostream &OS, + const MachineBasicBlock *MBB) const; + + uint64_t getEntryFrequency() const; + }; } diff --git a/llvm/lib/Analysis/BlockFrequencyInfo.cpp b/llvm/lib/Analysis/BlockFrequencyInfo.cpp index 62f3ab16ca7..3c6f67811e6 100644 --- a/llvm/lib/Analysis/BlockFrequencyInfo.cpp +++ b/llvm/lib/Analysis/BlockFrequencyInfo.cpp @@ -159,3 +159,14 @@ void BlockFrequencyInfo::view() const { const Function *BlockFrequencyInfo::getFunction() const { return BFI->Fn; } + +raw_ostream &BlockFrequencyInfo:: +printBlockFreq(raw_ostream &OS, const BlockFrequency Freq) const { + return BFI->printBlockFreq(OS, Freq); +} + +raw_ostream & +BlockFrequencyInfo::printBlockFreq(raw_ostream &OS, + const BasicBlock *BB) const { + return BFI->printBlockFreq(OS, BB); +} diff --git a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp index 64e8ecdec9e..86d30949a32 100644 --- a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp +++ b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp @@ -168,3 +168,19 @@ getBlockFreq(const MachineBasicBlock *MBB) const { MachineFunction *MachineBlockFrequencyInfo::getFunction() const { return MBFI->Fn; } + +raw_ostream & +MachineBlockFrequencyInfo::printBlockFreq(raw_ostream &OS, + const BlockFrequency Freq) const { + return MBFI->printBlockFreq(OS, Freq); +} + +raw_ostream & +MachineBlockFrequencyInfo::printBlockFreq(raw_ostream &OS, + const MachineBasicBlock *MBB) const { + return MBFI->printBlockFreq(OS, MBB); +} + +uint64_t MachineBlockFrequencyInfo::getEntryFrequency() const { + return MBFI->getEntryFrequency(); +} |

