drop redundant prints

This commit is contained in:
Egor Mayorov
2024-12-12 01:37:33 +03:00
parent 63c32b08da
commit f4644fafc3

View File

@@ -120,72 +120,6 @@ map<FuncInfo*, vector<pair<int, SAPFOR::Instruction*>>>
const map<FuncInfo*, vector<SAPFOR::BasicBlock*>> &fullIR, const map<FuncInfo*, vector<SAPFOR::BasicBlock*>> &fullIR,
const map<string, vector<LoopGraph*>>& loopGraph) const map<string, vector<LoopGraph*>>& loopGraph)
{ {
/*
// print and look part (Yes, I am stupid)
printf("\n\n\n\nPRINT EXAMPLE\n\n\n\n\n");
cout << "DEF USE INFO" << endl;
for(pair<string, vector<DefUseList>> p: defUseByFunctions) {
cout << "function name = " << p.first << endl;
for(auto& v: p.second) {
cout << "VARIABLE = ";
v.print();
}
}
cout << "\n\nALL FUNC INFO" << endl;
for(pair<string, vector<FuncInfo*>> p: allFuncInfo) {
cout << "file name = " << p.first << endl;
for(auto& v: p.second) {
cout << "func name = " << v->funcName << endl;
for(auto& v1: v->funcParams.identificators) {
cout << "identifier: " << v1 << endl;
}
}
}
cout << "\n\n FULL IR" << endl;
for(const pair<FuncInfo*, vector<SAPFOR::BasicBlock*>>& p: fullIR) {
cout << "func name = " << p.first->funcName << endl;
for(auto v: p.second) {
cout << "block num = " << v->getNumber() << endl;
cout << "prev: {";
for(auto pr: v->getPrev()){
cout << pr->getNumber() << ",";
}
cout << "}\nnext: {";
for(auto n: v->getNext()){
cout << n->getNumber() << ",";
}
cout << "}" << endl;
for(auto inst: v->getInstructions()){
cout << "instruction: " << inst->getInstruction()->dump() << endl;
cout << "operator: " << inst->getInstruction()->getOperator()->sunparse() << endl;
}
}
}
cout << "\n\nLoopGraph" << endl;
for(const pair<string, vector<LoopGraph*>>& p: loopGraph){
cout << "file name = " << p.first << endl;
for(auto v: p.second) {
cout << v->loop->sunparse() << endl;
cout << v->countOfIters << endl;
cout << v->loopSymbol << endl;
vector<FuncInfo*> fi = FindFuncInfoVec(p.first, allFuncInfo);
SAPFOR::BasicBlock* head = nullptr;
for(auto funcs: fi){
vector<SAPFOR::BasicBlock*> blocks = FindBlocksVec(funcs, fullIR);
head = GetBasicBlocksForLoop(v, blocks);
if(head != nullptr){
break;
}
}
if(head != nullptr){
cout << "loop head block num = " << head->getNumber() << endl;
}else{
cout << "no such block for loop (fail)" << endl;
}
}
}
*/
/*find blocks with loops start for each function*/ /*find blocks with loops start for each function*/
map<FuncInfo*, vector<SAPFOR::BasicBlock*>> mapFuncLoops; map<FuncInfo*, vector<SAPFOR::BasicBlock*>> mapFuncLoops;
@@ -201,16 +135,6 @@ map<FuncInfo*, vector<pair<int, SAPFOR::Instruction*>>>
} }
} }
/*print found blocks with loops for each function*/
// cout << "ALL LOOPS" << endl;
// for(auto m: mapFuncLoops){
// cout << "func: " << m.first->funcName << endl;
// for(auto v: m.second){
// cout << "block num: " << v->getNumber() << endl;
// cout << v->getInstructions().front()->getInstruction()->getOperator()->sunparse() << endl;
// }
// }
/*find instructions with read operaton which affects on number iterations for loops*/ /*find instructions with read operaton which affects on number iterations for loops*/
map<FuncInfo*, vector<pair<int, SAPFOR::Instruction*>>> finalInstructions; map<FuncInfo*, vector<pair<int, SAPFOR::Instruction*>>> finalInstructions;
/*for each function*/ /*for each function*/