[llvm-commits] [llvm] r135937 - in /llvm/trunk: include/llvm/ include/llvm/Analysis/ include/llvm/CodeGen/ lib/Analysis/ lib/CodeGen/
Jakub Staszak
jstaszak at apple.com
Mon Jul 25 12:25:40 PDT 2011
Author: kuba
Date: Mon Jul 25 14:25:40 2011
New Revision: 135937
URL: http://llvm.org/viewvc/llvm-project?rev=135937&view=rev
Log:
Rename BlockFrequency to BlockFrequencyInfo and MachineBlockFrequency to
MachineBlockFrequencyInfo.
Added:
llvm/trunk/include/llvm/Analysis/BlockFrequencyInfo.h
- copied, changed from r135924, llvm/trunk/include/llvm/Analysis/BlockFrequency.h
llvm/trunk/include/llvm/CodeGen/MachineBlockFrequencyInfo.h
- copied, changed from r135924, llvm/trunk/include/llvm/CodeGen/MachineBlockFrequency.h
llvm/trunk/lib/Analysis/BlockFrequencyInfo.cpp
- copied, changed from r135924, llvm/trunk/lib/Analysis/BlockFrequency.cpp
llvm/trunk/lib/CodeGen/MachineBlockFrequencyInfo.cpp
- copied, changed from r135924, llvm/trunk/lib/CodeGen/MachineBlockFrequency.cpp
Removed:
llvm/trunk/include/llvm/Analysis/BlockFrequency.h
llvm/trunk/include/llvm/CodeGen/MachineBlockFrequency.h
llvm/trunk/lib/Analysis/BlockFrequency.cpp
llvm/trunk/lib/CodeGen/MachineBlockFrequency.cpp
Modified:
llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h
llvm/trunk/include/llvm/InitializePasses.h
llvm/trunk/lib/Analysis/Analysis.cpp
llvm/trunk/lib/Analysis/CMakeLists.txt
llvm/trunk/lib/CodeGen/CMakeLists.txt
llvm/trunk/lib/CodeGen/CodeGen.cpp
Removed: llvm/trunk/include/llvm/Analysis/BlockFrequency.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/BlockFrequency.h?rev=135936&view=auto
==============================================================================
--- llvm/trunk/include/llvm/Analysis/BlockFrequency.h (original)
+++ llvm/trunk/include/llvm/Analysis/BlockFrequency.h (removed)
@@ -1,53 +0,0 @@
-//========-------- BlockFrequency.h - Block Frequency Analysis -------========//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Loops should be simplified before this analysis.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ANALYSIS_BLOCKFREQUENCY_H
-#define LLVM_ANALYSIS_BLOCKFREQUENCY_H
-
-#include "llvm/Pass.h"
-#include <climits>
-
-namespace llvm {
-
-class BranchProbabilityInfo;
-template<class BlockT, class FunctionT, class BranchProbInfoT>
-class BlockFrequencyImpl;
-
-/// BlockFrequency pass uses BlockFrequencyImpl implementation to estimate
-/// IR basic block frequencies.
-class BlockFrequency : public FunctionPass {
-
- BlockFrequencyImpl<BasicBlock, Function, BranchProbabilityInfo> *BFI;
-
-public:
- static char ID;
-
- BlockFrequency();
-
- ~BlockFrequency();
-
- void getAnalysisUsage(AnalysisUsage &AU) const;
-
- bool runOnFunction(Function &F);
-
- /// 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
- /// the other block frequencies. We do this to avoid using of floating points.
- ///
- uint32_t getBlockFreq(BasicBlock *BB);
-};
-
-}
-
-#endif
Modified: llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h?rev=135937&r1=135936&r2=135937&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h (original)
+++ llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h Mon Jul 25 14:25:40 2011
@@ -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 @@
}
}
- friend class BlockFrequency;
- friend class MachineBlockFrequency;
+ friend class BlockFrequencyInfo;
+ friend class MachineBlockFrequencyInfo;
void doFunction(FunctionT *fn, BlockProbInfoT *bpi) {
Fn = fn;
Copied: llvm/trunk/include/llvm/Analysis/BlockFrequencyInfo.h (from r135924, llvm/trunk/include/llvm/Analysis/BlockFrequency.h)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/BlockFrequencyInfo.h?p2=llvm/trunk/include/llvm/Analysis/BlockFrequencyInfo.h&p1=llvm/trunk/include/llvm/Analysis/BlockFrequency.h&r1=135924&r2=135937&rev=135937&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/BlockFrequency.h (original)
+++ llvm/trunk/include/llvm/Analysis/BlockFrequencyInfo.h Mon Jul 25 14:25:40 2011
@@ -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 @@
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;
Removed: llvm/trunk/include/llvm/CodeGen/MachineBlockFrequency.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBlockFrequency.h?rev=135936&view=auto
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineBlockFrequency.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineBlockFrequency.h (removed)
@@ -1,53 +0,0 @@
-//====----- MachineBlockFrequency.h - MachineBlock Frequency Analysis ----====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Loops should be simplified before this analysis.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MACHINEBLOCKFREQUENCY_H
-#define LLVM_CODEGEN_MACHINEBLOCKFREQUENCY_H
-
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include <climits>
-
-namespace llvm {
-
-class MachineBranchProbabilityInfo;
-template<class BlockT, class FunctionT, class BranchProbInfoT>
-class BlockFrequencyImpl;
-
-/// MachineBlockFrequency pass uses BlockFrequencyImpl implementation to estimate
-/// machine basic block frequencies.
-class MachineBlockFrequency : public MachineFunctionPass {
-
- BlockFrequencyImpl<MachineBasicBlock, MachineFunction, MachineBranchProbabilityInfo> *MBFI;
-
-public:
- static char ID;
-
- MachineBlockFrequency();
-
- ~MachineBlockFrequency();
-
- void getAnalysisUsage(AnalysisUsage &AU) const;
-
- bool runOnMachineFunction(MachineFunction &F);
-
- /// 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
- /// the other block frequencies. We do this to avoid using of floating points.
- ///
- uint32_t getBlockFreq(MachineBasicBlock *MBB);
-};
-
-}
-
-#endif
Copied: llvm/trunk/include/llvm/CodeGen/MachineBlockFrequencyInfo.h (from r135924, llvm/trunk/include/llvm/CodeGen/MachineBlockFrequency.h)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBlockFrequencyInfo.h?p2=llvm/trunk/include/llvm/CodeGen/MachineBlockFrequencyInfo.h&p1=llvm/trunk/include/llvm/CodeGen/MachineBlockFrequency.h&r1=135924&r2=135937&rev=135937&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineBlockFrequency.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineBlockFrequencyInfo.h Mon Jul 25 14:25:40 2011
@@ -1,4 +1,4 @@
-//====----- MachineBlockFrequency.h - MachineBlock Frequency Analysis ----====//
+//====----- MachineBlockFrequencyInfo.h - MachineBlock Frequency Analysis ----====//
//
// The LLVM Compiler Infrastructure
//
@@ -23,18 +23,18 @@
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;
Modified: llvm/trunk/include/llvm/InitializePasses.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=135937&r1=135936&r2=135937&view=diff
==============================================================================
--- llvm/trunk/include/llvm/InitializePasses.h (original)
+++ llvm/trunk/include/llvm/InitializePasses.h Mon Jul 25 14:25:40 2011
@@ -65,7 +65,7 @@
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 initializeLowerInvokePass(PassRegistry&);
void initializeLowerSetJmpPass(PassRegistry&);
void initializeLowerSwitchPass(PassRegistry&);
-void initializeMachineBlockFrequencyPass(PassRegistry&);
+void initializeMachineBlockFrequencyInfoPass(PassRegistry&);
void initializeMachineBranchProbabilityInfoPass(PassRegistry&);
void initializeMachineCSEPass(PassRegistry&);
void initializeMachineDominatorTreePass(PassRegistry&);
Modified: llvm/trunk/lib/Analysis/Analysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Analysis.cpp?rev=135937&r1=135936&r2=135937&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/Analysis.cpp (original)
+++ llvm/trunk/lib/Analysis/Analysis.cpp Mon Jul 25 14:25:40 2011
@@ -23,7 +23,7 @@
initializeAliasSetPrinterPass(Registry);
initializeNoAAPass(Registry);
initializeBasicAliasAnalysisPass(Registry);
- initializeBlockFrequencyPass(Registry);
+ initializeBlockFrequencyInfoPass(Registry);
initializeBranchProbabilityInfoPass(Registry);
initializeCFGViewerPass(Registry);
initializeCFGPrinterPass(Registry);
Removed: llvm/trunk/lib/Analysis/BlockFrequency.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BlockFrequency.cpp?rev=135936&view=auto
==============================================================================
--- llvm/trunk/lib/Analysis/BlockFrequency.cpp (original)
+++ llvm/trunk/lib/Analysis/BlockFrequency.cpp (removed)
@@ -1,59 +0,0 @@
-//=======-------- BlockFrequency.cpp - Block Frequency Analysis -------=======//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Loops should be simplified before this analysis.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/InitializePasses.h"
-#include "llvm/Analysis/BlockFrequencyImpl.h"
-#include "llvm/Analysis/BlockFrequency.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",
- true, true)
-INITIALIZE_PASS_DEPENDENCY(BranchProbabilityInfo)
-INITIALIZE_PASS_END(BlockFrequency, "block-freq", "Block Frequency Analysis",
- true, true)
-
-char BlockFrequency::ID = 0;
-
-
-BlockFrequency::BlockFrequency() : FunctionPass(ID) {
- initializeBlockFrequencyPass(*PassRegistry::getPassRegistry());
- BFI = new BlockFrequencyImpl<BasicBlock, Function, BranchProbabilityInfo>();
-}
-
-BlockFrequency::~BlockFrequency() {
- delete BFI;
-}
-
-void BlockFrequency::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<BranchProbabilityInfo>();
- AU.setPreservesAll();
-}
-
-bool BlockFrequency::runOnFunction(Function &F) {
- BranchProbabilityInfo &BPI = getAnalysis<BranchProbabilityInfo>();
- BFI->doFunction(&F, &BPI);
- return false;
-}
-
-/// 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
-/// the other block frequencies. We do this to avoid using of floating points.
-///
-uint32_t BlockFrequency::getBlockFreq(BasicBlock *BB) {
- return BFI->getBlockFreq(BB);
-}
Copied: llvm/trunk/lib/Analysis/BlockFrequencyInfo.cpp (from r135924, llvm/trunk/lib/Analysis/BlockFrequency.cpp)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BlockFrequencyInfo.cpp?p2=llvm/trunk/lib/Analysis/BlockFrequencyInfo.cpp&p1=llvm/trunk/lib/Analysis/BlockFrequency.cpp&r1=135924&r2=135937&rev=135937&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BlockFrequency.cpp (original)
+++ llvm/trunk/lib/Analysis/BlockFrequencyInfo.cpp Mon Jul 25 14:25:40 2011
@@ -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 @@
/// 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);
}
Modified: llvm/trunk/lib/Analysis/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CMakeLists.txt?rev=135937&r1=135936&r2=135937&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CMakeLists.txt (original)
+++ llvm/trunk/lib/Analysis/CMakeLists.txt Mon Jul 25 14:25:40 2011
@@ -6,7 +6,7 @@
AliasSetTracker.cpp
Analysis.cpp
BasicAliasAnalysis.cpp
- BlockFrequency.cpp
+ BlockFrequencyInfo.cpp
BranchProbabilityInfo.cpp
CFGPrinter.cpp
CaptureTracking.cpp
Modified: llvm/trunk/lib/CodeGen/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CMakeLists.txt?rev=135937&r1=135936&r2=135937&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CMakeLists.txt (original)
+++ llvm/trunk/lib/CodeGen/CMakeLists.txt Mon Jul 25 14:25:40 2011
@@ -33,7 +33,7 @@
LocalStackSlotAllocation.cpp
LowerSubregs.cpp
MachineBasicBlock.cpp
- MachineBlockFrequency.cpp
+ MachineBlockFrequencyInfo.cpp
MachineBranchProbabilityInfo.cpp
MachineCSE.cpp
MachineDominators.cpp
Modified: llvm/trunk/lib/CodeGen/CodeGen.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGen.cpp?rev=135937&r1=135936&r2=135937&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CodeGen.cpp (original)
+++ llvm/trunk/lib/CodeGen/CodeGen.cpp Mon Jul 25 14:25:40 2011
@@ -27,6 +27,7 @@
initializeLiveIntervalsPass(Registry);
initializeLiveStacksPass(Registry);
initializeLiveVariablesPass(Registry);
+ initializeMachineBlockFrequencyInfoPass(Registry);
initializeMachineCSEPass(Registry);
initializeMachineDominatorTreePass(Registry);
initializeMachineLICMPass(Registry);
Removed: llvm/trunk/lib/CodeGen/MachineBlockFrequency.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBlockFrequency.cpp?rev=135936&view=auto
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineBlockFrequency.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineBlockFrequency.cpp (removed)
@@ -1,60 +0,0 @@
-//====----- MachineBlockFrequency.cpp - Machine Block Frequency Analysis ----====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Loops should be simplified before this analysis.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/InitializePasses.h"
-#include "llvm/Analysis/BlockFrequencyImpl.h"
-#include "llvm/CodeGen/MachineBlockFrequency.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
-
-using namespace llvm;
-
-INITIALIZE_PASS_BEGIN(MachineBlockFrequency, "machine-block-freq",
- "Machine Block Frequency Analysis", true, true)
-INITIALIZE_PASS_DEPENDENCY(MachineBranchProbabilityInfo)
-INITIALIZE_PASS_END(MachineBlockFrequency, "machine-block-freq",
- "Machine Block Frequency Analysis", true, true)
-
-char MachineBlockFrequency::ID = 0;
-
-
-MachineBlockFrequency::MachineBlockFrequency() : MachineFunctionPass(ID) {
- initializeMachineBlockFrequencyPass(*PassRegistry::getPassRegistry());
- MBFI = new BlockFrequencyImpl<MachineBasicBlock, MachineFunction,
- MachineBranchProbabilityInfo>();
-}
-
-MachineBlockFrequency::~MachineBlockFrequency() {
- delete MBFI;
-}
-
-void MachineBlockFrequency::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<MachineBranchProbabilityInfo>();
- AU.setPreservesAll();
- MachineFunctionPass::getAnalysisUsage(AU);
-}
-
-bool MachineBlockFrequency::runOnMachineFunction(MachineFunction &F) {
- MachineBranchProbabilityInfo &MBPI = getAnalysis<MachineBranchProbabilityInfo>();
- MBFI->doFunction(&F, &MBPI);
- return false;
-}
-
-/// 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
-/// the other block frequencies. We do this to avoid using of floating points.
-///
-uint32_t MachineBlockFrequency::getBlockFreq(MachineBasicBlock *MBB) {
- return MBFI->getBlockFreq(MBB);
-}
Copied: llvm/trunk/lib/CodeGen/MachineBlockFrequencyInfo.cpp (from r135924, llvm/trunk/lib/CodeGen/MachineBlockFrequency.cpp)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBlockFrequencyInfo.cpp?p2=llvm/trunk/lib/CodeGen/MachineBlockFrequencyInfo.cpp&p1=llvm/trunk/lib/CodeGen/MachineBlockFrequency.cpp&r1=135924&r2=135937&rev=135937&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineBlockFrequency.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineBlockFrequencyInfo.cpp Mon Jul 25 14:25:40 2011
@@ -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 @@
/// 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);
}
More information about the llvm-commits
mailing list