Commit 29b9788b authored by lxq's avatar lxq

start loop analysis

parent 56317aae
...@@ -27,11 +27,8 @@ LiveRangeAnalyzer::joinFor(BasicBlock *bb) { ...@@ -27,11 +27,8 @@ LiveRangeAnalyzer::joinFor(BasicBlock *bb) {
for (auto succ : bb->get_succ_basic_blocks()) { for (auto succ : bb->get_succ_basic_blocks()) {
auto &irs = succ->get_instructions(); auto &irs = succ->get_instructions();
auto it = irs.begin(); auto it = irs.begin();
cout << succ->get_name() << endl;
while (it != irs.end() and it->is_phi()) while (it != irs.end() and it->is_phi())
++it; ++it;
/* if (it == irs.end())
* cout << succ->print() << endl; */
assert(it != irs.end() && "need to find first_ir from copy-stmt"); assert(it != irs.end() && "need to find first_ir from copy-stmt");
union_ip(out, IN[instr_id.at(&(*it))]); union_ip(out, IN[instr_id.at(&(*it))]);
// cout << "# " + it->print() << endl; // cout << "# " + it->print() << endl;
...@@ -85,10 +82,6 @@ LiveRangeAnalyzer::get_dfs_order(Function *func) { ...@@ -85,10 +82,6 @@ LiveRangeAnalyzer::get_dfs_order(Function *func) {
for (auto succ : bb->get_succ_basic_blocks()) for (auto succ : bb->get_succ_basic_blocks())
Q.push_front(succ); Q.push_front(succ);
} }
cout << func->get_name() << "'s dfs order:\n\t";
for (auto bb : BB_DFS_Order)
cout << bb->get_name() << " ";
cout << endl;
} }
void void
......
add_library( add_library(
OP_lib STATIC OP_lib STATIC
LoopUnroll.cpp
ExceptCallMerge.cpp
Dominators.cpp Dominators.cpp
Mem2Reg.cpp Mem2Reg.cpp
GVN.cpp GVN.cpp
LoopUnroll.cpp
ExceptCallMerge.cpp
) )
...@@ -51,11 +51,10 @@ NegCallMerge::run(Function *func) { ...@@ -51,11 +51,10 @@ NegCallMerge::run(Function *func) {
} }
} }
// remove useless BasicBlocks // remove useless BasicBlocks
cout << "remove blocks for function " << func->get_name() << endl;
for (auto _bb : calls) { for (auto _bb : calls) {
auto bb = static_cast<BasicBlock *>(_bb); auto bb = static_cast<BasicBlock *>(_bb);
if (bb != reserved) { if (bb != reserved) {
cout << "remove block " << bb->get_name() << endl; cout << "remove block " << bb->get_name() << " in function " << func->get_name() << endl;
auto it = blocks.begin(); auto it = blocks.begin();
for (; &*it != bb; ++it) for (; &*it != bb; ++it)
; ;
......
...@@ -29,8 +29,8 @@ struct BackEdgeSearcher { ...@@ -29,8 +29,8 @@ struct BackEdgeSearcher {
type = "back-edge"; type = "back-edge";
edges.push_back(edge); edges.push_back(edge);
} }
cout << "find " << type << ": " << LoopUnroll::str(edge) /* cout << "find " << type << ": " << LoopUnroll::str(edge)
<< "\n"; * << "\n"; */
} else } else
dfsrun(succ); dfsrun(succ);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment