Rename BlockFrequency to BlockFrequencyInfo and MachineBlockFrequency to

MachineBlockFrequencyInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135937 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakub Staszak 2011-07-25 19:25:40 +00:00
parent 8c3fee5903
commit f55c1c8588
10 changed files with 44 additions and 43 deletions

View File

@ -29,8 +29,8 @@
namespace llvm {
class BlockFrequency;
class MachineBlockFrequency;
class BlockFrequencyInfo;
class MachineBlockFrequencyInfo;
/// BlockFrequencyImpl implements block frequency algorithm for IR and
/// Machine Instructions. Algorithm starts with value 1024 (START_FREQ)
@ -263,8 +263,8 @@ class BlockFrequencyImpl {
}
}
friend class BlockFrequency;
friend class MachineBlockFrequency;
friend class BlockFrequencyInfo;
friend class MachineBlockFrequencyInfo;
void doFunction(FunctionT *fn, BlockProbInfoT *bpi) {
Fn = fn;

View File

@ -1,4 +1,4 @@
//========-------- BlockFrequency.h - Block Frequency Analysis -------========//
//========-------- BlockFrequencyInfo.h - Block Frequency Analysis -------========//
//
// The LLVM Compiler Infrastructure
//
@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_ANALYSIS_BLOCKFREQUENCY_H
#define LLVM_ANALYSIS_BLOCKFREQUENCY_H
#ifndef LLVM_ANALYSIS_BLOCKFREQUENCYINFO_H
#define LLVM_ANALYSIS_BLOCKFREQUENCYINFO_H
#include "llvm/Pass.h"
#include <climits>
@ -23,18 +23,18 @@ class BranchProbabilityInfo;
template<class BlockT, class FunctionT, class BranchProbInfoT>
class BlockFrequencyImpl;
/// BlockFrequency pass uses BlockFrequencyImpl implementation to estimate
/// BlockFrequencyInfo pass uses BlockFrequencyImpl implementation to estimate
/// IR basic block frequencies.
class BlockFrequency : public FunctionPass {
class BlockFrequencyInfo : public FunctionPass {
BlockFrequencyImpl<BasicBlock, Function, BranchProbabilityInfo> *BFI;
public:
static char ID;
BlockFrequency();
BlockFrequencyInfo();
~BlockFrequency();
~BlockFrequencyInfo();
void getAnalysisUsage(AnalysisUsage &AU) const;

View File

@ -1,4 +1,4 @@
//====----- MachineBlockFrequency.h - MachineBlock Frequency Analysis ----====//
//====----- MachineBlockFrequencyInfo.h - MachineBlock Frequency Analysis ----====//
//
// The LLVM Compiler Infrastructure
//
@ -23,18 +23,18 @@ class MachineBranchProbabilityInfo;
template<class BlockT, class FunctionT, class BranchProbInfoT>
class BlockFrequencyImpl;
/// MachineBlockFrequency pass uses BlockFrequencyImpl implementation to estimate
/// MachineBlockFrequencyInfo pass uses BlockFrequencyImpl implementation to estimate
/// machine basic block frequencies.
class MachineBlockFrequency : public MachineFunctionPass {
class MachineBlockFrequencyInfo : public MachineFunctionPass {
BlockFrequencyImpl<MachineBasicBlock, MachineFunction, MachineBranchProbabilityInfo> *MBFI;
public:
static char ID;
MachineBlockFrequency();
MachineBlockFrequencyInfo();
~MachineBlockFrequency();
~MachineBlockFrequencyInfo();
void getAnalysisUsage(AnalysisUsage &AU) const;

View File

@ -65,7 +65,7 @@ void initializeArgPromotionPass(PassRegistry&);
void initializeBasicAliasAnalysisPass(PassRegistry&);
void initializeBasicCallGraphPass(PassRegistry&);
void initializeBlockExtractorPassPass(PassRegistry&);
void initializeBlockFrequencyPass(PassRegistry&);
void initializeBlockFrequencyInfoPass(PassRegistry&);
void initializeBlockPlacementPass(PassRegistry&);
void initializeBranchProbabilityInfoPass(PassRegistry&);
void initializeBreakCriticalEdgesPass(PassRegistry&);
@ -145,7 +145,7 @@ void initializeLowerIntrinsicsPass(PassRegistry&);
void initializeLowerInvokePass(PassRegistry&);
void initializeLowerSetJmpPass(PassRegistry&);
void initializeLowerSwitchPass(PassRegistry&);
void initializeMachineBlockFrequencyPass(PassRegistry&);
void initializeMachineBlockFrequencyInfoPass(PassRegistry&);
void initializeMachineBranchProbabilityInfoPass(PassRegistry&);
void initializeMachineCSEPass(PassRegistry&);
void initializeMachineDominatorTreePass(PassRegistry&);

View File

@ -23,7 +23,7 @@ void llvm::initializeAnalysis(PassRegistry &Registry) {
initializeAliasSetPrinterPass(Registry);
initializeNoAAPass(Registry);
initializeBasicAliasAnalysisPass(Registry);
initializeBlockFrequencyPass(Registry);
initializeBlockFrequencyInfoPass(Registry);
initializeBranchProbabilityInfoPass(Registry);
initializeCFGViewerPass(Registry);
initializeCFGPrinterPass(Registry);

View File

@ -1,4 +1,4 @@
//=======-------- BlockFrequency.cpp - Block Frequency Analysis -------=======//
//=======-------- BlockFrequencyInfo.cpp - Block Frequency Analysis -------=======//
//
// The LLVM Compiler Infrastructure
//
@ -13,37 +13,37 @@
#include "llvm/InitializePasses.h"
#include "llvm/Analysis/BlockFrequencyImpl.h"
#include "llvm/Analysis/BlockFrequency.h"
#include "llvm/Analysis/BlockFrequencyInfo.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
using namespace llvm;
INITIALIZE_PASS_BEGIN(BlockFrequency, "block-freq", "Block Frequency Analysis",
INITIALIZE_PASS_BEGIN(BlockFrequencyInfo, "block-freq", "Block Frequency Analysis",
true, true)
INITIALIZE_PASS_DEPENDENCY(BranchProbabilityInfo)
INITIALIZE_PASS_END(BlockFrequency, "block-freq", "Block Frequency Analysis",
INITIALIZE_PASS_END(BlockFrequencyInfo, "block-freq", "Block Frequency Analysis",
true, true)
char BlockFrequency::ID = 0;
char BlockFrequencyInfo::ID = 0;
BlockFrequency::BlockFrequency() : FunctionPass(ID) {
initializeBlockFrequencyPass(*PassRegistry::getPassRegistry());
BlockFrequencyInfo::BlockFrequencyInfo() : FunctionPass(ID) {
initializeBlockFrequencyInfoPass(*PassRegistry::getPassRegistry());
BFI = new BlockFrequencyImpl<BasicBlock, Function, BranchProbabilityInfo>();
}
BlockFrequency::~BlockFrequency() {
BlockFrequencyInfo::~BlockFrequencyInfo() {
delete BFI;
}
void BlockFrequency::getAnalysisUsage(AnalysisUsage &AU) const {
void BlockFrequencyInfo::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<BranchProbabilityInfo>();
AU.setPreservesAll();
}
bool BlockFrequency::runOnFunction(Function &F) {
bool BlockFrequencyInfo::runOnFunction(Function &F) {
BranchProbabilityInfo &BPI = getAnalysis<BranchProbabilityInfo>();
BFI->doFunction(&F, &BPI);
return false;
@ -54,6 +54,6 @@ bool BlockFrequency::runOnFunction(Function &F) {
/// 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) {
uint32_t BlockFrequencyInfo::getBlockFreq(BasicBlock *BB) {
return BFI->getBlockFreq(BB);
}

View File

@ -6,7 +6,7 @@ add_llvm_library(LLVMAnalysis
AliasSetTracker.cpp
Analysis.cpp
BasicAliasAnalysis.cpp
BlockFrequency.cpp
BlockFrequencyInfo.cpp
BranchProbabilityInfo.cpp
CFGPrinter.cpp
CaptureTracking.cpp

View File

@ -33,7 +33,7 @@ add_llvm_library(LLVMCodeGen
LocalStackSlotAllocation.cpp
LowerSubregs.cpp
MachineBasicBlock.cpp
MachineBlockFrequency.cpp
MachineBlockFrequencyInfo.cpp
MachineBranchProbabilityInfo.cpp
MachineCSE.cpp
MachineDominators.cpp

View File

@ -27,6 +27,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
initializeLiveIntervalsPass(Registry);
initializeLiveStacksPass(Registry);
initializeLiveVariablesPass(Registry);
initializeMachineBlockFrequencyInfoPass(Registry);
initializeMachineCSEPass(Registry);
initializeMachineDominatorTreePass(Registry);
initializeMachineLICMPass(Registry);

View File

@ -1,4 +1,4 @@
//====----- MachineBlockFrequency.cpp - Machine Block Frequency Analysis ----====//
//====----- MachineBlockFrequencyInfo.cpp - Machine Block Frequency Analysis ----====//
//
// The LLVM Compiler Infrastructure
//
@ -13,38 +13,38 @@
#include "llvm/InitializePasses.h"
#include "llvm/Analysis/BlockFrequencyImpl.h"
#include "llvm/CodeGen/MachineBlockFrequency.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
using namespace llvm;
INITIALIZE_PASS_BEGIN(MachineBlockFrequency, "machine-block-freq",
INITIALIZE_PASS_BEGIN(MachineBlockFrequencyInfo, "machine-block-freq",
"Machine Block Frequency Analysis", true, true)
INITIALIZE_PASS_DEPENDENCY(MachineBranchProbabilityInfo)
INITIALIZE_PASS_END(MachineBlockFrequency, "machine-block-freq",
INITIALIZE_PASS_END(MachineBlockFrequencyInfo, "machine-block-freq",
"Machine Block Frequency Analysis", true, true)
char MachineBlockFrequency::ID = 0;
char MachineBlockFrequencyInfo::ID = 0;
MachineBlockFrequency::MachineBlockFrequency() : MachineFunctionPass(ID) {
initializeMachineBlockFrequencyPass(*PassRegistry::getPassRegistry());
MachineBlockFrequencyInfo::MachineBlockFrequencyInfo() : MachineFunctionPass(ID) {
initializeMachineBlockFrequencyInfoPass(*PassRegistry::getPassRegistry());
MBFI = new BlockFrequencyImpl<MachineBasicBlock, MachineFunction,
MachineBranchProbabilityInfo>();
}
MachineBlockFrequency::~MachineBlockFrequency() {
MachineBlockFrequencyInfo::~MachineBlockFrequencyInfo() {
delete MBFI;
}
void MachineBlockFrequency::getAnalysisUsage(AnalysisUsage &AU) const {
void MachineBlockFrequencyInfo::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<MachineBranchProbabilityInfo>();
AU.setPreservesAll();
MachineFunctionPass::getAnalysisUsage(AU);
}
bool MachineBlockFrequency::runOnMachineFunction(MachineFunction &F) {
bool MachineBlockFrequencyInfo::runOnMachineFunction(MachineFunction &F) {
MachineBranchProbabilityInfo &MBPI = getAnalysis<MachineBranchProbabilityInfo>();
MBFI->doFunction(&F, &MBPI);
return false;
@ -55,6 +55,6 @@ bool MachineBlockFrequency::runOnMachineFunction(MachineFunction &F) {
/// 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) {
uint32_t MachineBlockFrequencyInfo::getBlockFreq(MachineBasicBlock *MBB) {
return MBFI->getBlockFreq(MBB);
}