mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
blockfreq: Implement Pass::releaseMemory()
Implement Pass::releaseMemory() in BlockFrequencyInfo and MachineBlockFrequencyInfo. Just delete the private implementation when not in use. Switch to a std::unique_ptr to make the logic more clear. <rdar://problem/14292693> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204741 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -28,9 +28,9 @@ class BlockFrequencyImpl;
|
||||
/// MachineBlockFrequencyInfo pass uses BlockFrequencyImpl implementation to estimate
|
||||
/// machine basic block frequencies.
|
||||
class MachineBlockFrequencyInfo : public MachineFunctionPass {
|
||||
|
||||
BlockFrequencyImpl<MachineBasicBlock, MachineFunction,
|
||||
MachineBranchProbabilityInfo> *MBFI;
|
||||
typedef BlockFrequencyImpl<MachineBasicBlock, MachineFunction,
|
||||
MachineBranchProbabilityInfo> ImplType;
|
||||
std::unique_ptr<ImplType> MBFI;
|
||||
|
||||
public:
|
||||
static char ID;
|
||||
@@ -43,6 +43,8 @@ public:
|
||||
|
||||
bool runOnMachineFunction(MachineFunction &F) override;
|
||||
|
||||
void releaseMemory() override;
|
||||
|
||||
/// 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
|
||||
|
Reference in New Issue
Block a user