mirror of
https://github.com/RPCSX/llvm.git
synced 2025-04-12 04:56:49 +00:00
Clang format change /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273335 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
38ae857b16
commit
3071cc9727
@ -27,36 +27,30 @@ using namespace llvm;
|
|||||||
#define DEBUG_TYPE "block-freq"
|
#define DEBUG_TYPE "block-freq"
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
enum GVDAGType {
|
enum GVDAGType { GVDT_None, GVDT_Fraction, GVDT_Integer };
|
||||||
GVDT_None,
|
|
||||||
GVDT_Fraction,
|
|
||||||
GVDT_Integer
|
|
||||||
};
|
|
||||||
|
|
||||||
static cl::opt<GVDAGType>
|
static cl::opt<GVDAGType> ViewMachineBlockFreqPropagationDAG(
|
||||||
ViewMachineBlockFreqPropagationDAG("view-machine-block-freq-propagation-dags",
|
"view-machine-block-freq-propagation-dags", cl::Hidden,
|
||||||
cl::Hidden,
|
cl::desc("Pop up a window to show a dag displaying how machine block "
|
||||||
cl::desc("Pop up a window to show a dag displaying how machine block "
|
"frequencies propagate through the CFG."),
|
||||||
"frequencies propagate through the CFG."),
|
cl::values(clEnumValN(GVDT_None, "none", "do not display graphs."),
|
||||||
cl::values(
|
clEnumValN(GVDT_Fraction, "fraction",
|
||||||
clEnumValN(GVDT_None, "none",
|
"display a graph using the "
|
||||||
"do not display graphs."),
|
"fractional block frequency representation."),
|
||||||
clEnumValN(GVDT_Fraction, "fraction", "display a graph using the "
|
clEnumValN(GVDT_Integer, "integer",
|
||||||
"fractional block frequency representation."),
|
"display a graph using the raw "
|
||||||
clEnumValN(GVDT_Integer, "integer", "display a graph using the raw "
|
"integer fractional block frequency representation."),
|
||||||
"integer fractional block frequency representation."),
|
clEnumValEnd));
|
||||||
clEnumValEnd));
|
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
template <>
|
template <> struct GraphTraits<MachineBlockFrequencyInfo *> {
|
||||||
struct GraphTraits<MachineBlockFrequencyInfo *> {
|
|
||||||
typedef const MachineBasicBlock NodeType;
|
typedef const MachineBasicBlock NodeType;
|
||||||
typedef MachineBasicBlock::const_succ_iterator ChildIteratorType;
|
typedef MachineBasicBlock::const_succ_iterator ChildIteratorType;
|
||||||
typedef MachineFunction::const_iterator nodes_iterator;
|
typedef MachineFunction::const_iterator nodes_iterator;
|
||||||
|
|
||||||
static inline
|
static inline const NodeType *
|
||||||
const NodeType *getEntryNode(const MachineBlockFrequencyInfo *G) {
|
getEntryNode(const MachineBlockFrequencyInfo *G) {
|
||||||
return &G->getFunction()->front();
|
return &G->getFunction()->front();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,11 +71,11 @@ struct GraphTraits<MachineBlockFrequencyInfo *> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template <>
|
||||||
struct DOTGraphTraits<MachineBlockFrequencyInfo*> :
|
struct DOTGraphTraits<MachineBlockFrequencyInfo *>
|
||||||
public DefaultDOTGraphTraits {
|
: public DefaultDOTGraphTraits {
|
||||||
explicit DOTGraphTraits(bool isSimple=false) :
|
explicit DOTGraphTraits(bool isSimple = false)
|
||||||
DefaultDOTGraphTraits(isSimple) {}
|
: DefaultDOTGraphTraits(isSimple) {}
|
||||||
|
|
||||||
static std::string getGraphName(const MachineBlockFrequencyInfo *G) {
|
static std::string getGraphName(const MachineBlockFrequencyInfo *G) {
|
||||||
return G->getFunction()->getName();
|
return G->getFunction()->getName();
|
||||||
@ -109,7 +103,6 @@ struct DOTGraphTraits<MachineBlockFrequencyInfo*> :
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -122,9 +115,8 @@ INITIALIZE_PASS_END(MachineBlockFrequencyInfo, "machine-block-freq",
|
|||||||
|
|
||||||
char MachineBlockFrequencyInfo::ID = 0;
|
char MachineBlockFrequencyInfo::ID = 0;
|
||||||
|
|
||||||
|
MachineBlockFrequencyInfo::MachineBlockFrequencyInfo()
|
||||||
MachineBlockFrequencyInfo::
|
: MachineFunctionPass(ID) {
|
||||||
MachineBlockFrequencyInfo() :MachineFunctionPass(ID) {
|
|
||||||
initializeMachineBlockFrequencyInfoPass(*PassRegistry::getPassRegistry());
|
initializeMachineBlockFrequencyInfoPass(*PassRegistry::getPassRegistry());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,12 +155,12 @@ void MachineBlockFrequencyInfo::view() const {
|
|||||||
"MachineBlockFrequencyDAGs");
|
"MachineBlockFrequencyDAGs");
|
||||||
#else
|
#else
|
||||||
errs() << "MachineBlockFrequencyInfo::view is only available in debug builds "
|
errs() << "MachineBlockFrequencyInfo::view is only available in debug builds "
|
||||||
"on systems with Graphviz or gv!\n";
|
"on systems with Graphviz or gv!\n";
|
||||||
#endif // NDEBUG
|
#endif // NDEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockFrequency MachineBlockFrequencyInfo::
|
BlockFrequency
|
||||||
getBlockFreq(const MachineBasicBlock *MBB) const {
|
MachineBlockFrequencyInfo::getBlockFreq(const MachineBasicBlock *MBB) const {
|
||||||
return MBFI ? MBFI->getBlockFreq(MBB) : 0;
|
return MBFI ? MBFI->getBlockFreq(MBB) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user