49 class LoopTreeGraph :
public PrintableGraph<Method*,Loop*> {
51 struct insert_loop : std::unary_function<void,Loop*> {
53 explicit insert_loop(LoopTreeGraph *
parent) : parent(parent) {}
55 parent->nodes.insert(loop);
56 std::for_each(loop->loop_begin(),loop->loop_end(),insert_loop(
parent));
57 Loop *p = loop->get_parent();
59 parent->edges.insert(std::make_pair(loop,p));
66 std::for_each(LT->loop_begin(),LT->loop_end(),insert_loop(
this));
68 for(Method::BBListTy::const_iterator
i = M.bb_begin(),
69 e = M.bb_end();
i !=
e; ++
i) {
74 Loop loop = LT->get_Loop(BI);
76 EdgeType edge = std::make_pair(idom,BI);
83 virtual OStream& getGraphName(OStream&
OS)
const {
84 return OS <<
"LoopTreeGraph";
87 virtual OStream& getNodeLabel(OStream&
OS,
Loop *
const &node)
const {
108 std::string get_filename(
methodinfo *m,
jitdata *jd, std::string prefix =
"cfg_", std::string suffix=
".dot");
109 std::string get_filename(
methodinfo *m,
jitdata *jd, std::string prefix, std::string suffix)
111 std::string filename = prefix;
118 for (
size_t i = filename.find_first_of(
'/');
119 i != std::string::npos;
120 i = filename.find_first_of(
'/',
i+1)) {
121 filename.replace(
i,1,1,
'.');
123 const char *unchar =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.";
124 for (
size_t i = filename.find_first_not_of(unchar);
125 i != std::string::npos;
126 i = filename.find_first_not_of(unchar,
i+1)) {
127 filename.replace(
i,1,1,
'_');
137 LoopTree *LT = get_Pass<LoopPass>();
static void print(const char *filename, const PrintableGraphTy &G)
LoopTreeBase< BeginInst > LoopTree
static Option< bool > enabled
JNIEnv jclass jobject const char * name
jitdata * get_jitdata() const
std::set< EdgeType > & edges
virtual bool run(JITData &JD)
Run the Pass.
Stores the interdependencies of a pass.
virtual PassUsage & get_PassUsage(PassUsage &PA) const
Set the requirements for the pass.
LoopBase< BeginInst > Loop
byte_iterator begin() const
static PassRegistry< BasicBlockSchedulingPass > X("BasicBlockSchedulingPass")
void add_requires()
PassName is required.