Random cleanups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7247 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-07-23 14:59:40 +00:00
parent 1815383276
commit 9daa8a12d3
2 changed files with 36 additions and 52 deletions

View File

@ -4,12 +4,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
//#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
//#include "llvm/CodeGen/MachineCodeForMethod.h"
//#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" // FIXME: Remove when modularized better
#include "llvm/BasicBlock.h" #include "llvm/BasicBlock.h"
#include "llvm/Constants.h" #include "llvm/Constants.h"
#include "llvm/Instruction.h"
#include "llvm/iTerminators.h" #include "llvm/iTerminators.h"
#include "llvm/iPHINode.h" #include "llvm/iPHINode.h"
#include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstr.h"
@ -24,10 +20,6 @@
#include "ModuloScheduling.h" #include "ModuloScheduling.h"
#include <algorithm> #include <algorithm>
#include <fstream> #include <fstream>
#include <iostream>
using std::endl;
using std::cerr;
//************************************************************ //************************************************************
// printing Debug information // printing Debug information
@ -455,9 +447,9 @@ ModuloScheduling::constructKernel(BasicBlock *prologue,
kernel_ist.erase(--kernel_ist.end()); kernel_ist.erase(--kernel_ist.end());
// set the first successor to itself // set the first successor to itself
((BranchInst *) cln)->setSuccessor(0, kernel); cln->setSuccessor(0, kernel);
// set the second successor to eiplogue // set the second successor to eiplogue
((BranchInst *) cln)->setSuccessor(1, epilogue); cln->setSuccessor(1, epilogue);
//*****change the condition******* //*****change the condition*******
@ -907,38 +899,38 @@ ModuloScheduling::dumpScheduling(){
void void
ModuloScheduling::dumpFinalSchedule(){ ModuloScheduling::dumpFinalSchedule(){
cerr << "dump schedule:" << endl; std::cerr << "dump schedule:" << "\n";
const TargetSchedInfo & msi = target.getSchedInfo(); const TargetSchedInfo & msi = target.getSchedInfo();
unsigned numIssueSlots = msi.maxNumIssueTotal; unsigned numIssueSlots = msi.maxNumIssueTotal;
for (unsigned i = 0; i < numIssueSlots; i++) for (unsigned i = 0; i < numIssueSlots; i++)
cerr << "\t#"; std::cerr << "\t#";
cerr << endl; std::cerr << "\n";
for (unsigned i = 0; i < schedule.size(); i++) { for (unsigned i = 0; i < schedule.size(); i++) {
cerr << "cycle" << i << ": "; std::cerr << "cycle" << i << ": ";
for (unsigned j = 0; j < schedule[i].size(); j++) for (unsigned j = 0; j < schedule[i].size(); j++)
if (schedule[i][j] != NULL) if (schedule[i][j] != NULL)
cerr << schedule[i][j]->getNodeId() << "\t"; std::cerr << schedule[i][j]->getNodeId() << "\t";
else else
cerr << "\t"; std::cerr << "\t";
cerr << endl; std::cerr << "\n";
} }
cerr << "dump coreSchedule:" << endl; std::cerr << "dump coreSchedule:" << "\n";
for (unsigned i = 0; i < numIssueSlots; i++) for (unsigned i = 0; i < numIssueSlots; i++)
cerr << "\t#"; std::cerr << "\t#";
cerr << endl; std::cerr << "\n";
for (unsigned i = 0; i < coreSchedule.size(); i++) { for (unsigned i = 0; i < coreSchedule.size(); i++) {
cerr << "cycle" << i << ": "; std::cerr << "cycle" << i << ": ";
for (unsigned j = 0; j < coreSchedule[i].size(); j++) for (unsigned j = 0; j < coreSchedule[i].size(); j++)
if (coreSchedule[i][j] != NULL) if (coreSchedule[i][j] != NULL)
cerr << coreSchedule[i][j]->getNodeId() << "\t"; std::cerr << coreSchedule[i][j]->getNodeId() << "\t";
else else
cerr << "\t"; std::cerr << "\t";
cerr << endl; std::cerr << "\n";
} }
} }
@ -979,13 +971,13 @@ ModuloSchedulingPass::runOnFunction(Function &F){
ModuloSchedulingSet ModuloSchedulingSet(*graphSet); ModuloSchedulingSet ModuloSchedulingSet(*graphSet);
DEBUG_PRINT(cerr<<"runOnFunction in ModuloSchedulingPass returns\n"<<endl); DEBUG_PRINT(std::cerr<<"runOnFunction in ModuloSchedulingPass returns\n"<<"\n");
return false; return false;
} }
Pass * Pass *
createModuloSchedulingPass(const TargetMachine & tgt){ createModuloSchedulingPass(const TargetMachine & tgt){
DEBUG_PRINT(cerr<<"creating modulo scheduling "<<endl); DEBUG_PRINT(std::cerr<<"creating modulo scheduling\n");
return new ModuloSchedulingPass(tgt); return new ModuloSchedulingPass(tgt);
} }

View File

@ -4,12 +4,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
//#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
//#include "llvm/CodeGen/MachineCodeForMethod.h"
//#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" // FIXME: Remove when modularized better
#include "llvm/BasicBlock.h" #include "llvm/BasicBlock.h"
#include "llvm/Constants.h" #include "llvm/Constants.h"
#include "llvm/Instruction.h"
#include "llvm/iTerminators.h" #include "llvm/iTerminators.h"
#include "llvm/iPHINode.h" #include "llvm/iPHINode.h"
#include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstr.h"
@ -24,10 +20,6 @@
#include "ModuloScheduling.h" #include "ModuloScheduling.h"
#include <algorithm> #include <algorithm>
#include <fstream> #include <fstream>
#include <iostream>
using std::endl;
using std::cerr;
//************************************************************ //************************************************************
// printing Debug information // printing Debug information
@ -455,9 +447,9 @@ ModuloScheduling::constructKernel(BasicBlock *prologue,
kernel_ist.erase(--kernel_ist.end()); kernel_ist.erase(--kernel_ist.end());
// set the first successor to itself // set the first successor to itself
((BranchInst *) cln)->setSuccessor(0, kernel); cln->setSuccessor(0, kernel);
// set the second successor to eiplogue // set the second successor to eiplogue
((BranchInst *) cln)->setSuccessor(1, epilogue); cln->setSuccessor(1, epilogue);
//*****change the condition******* //*****change the condition*******
@ -907,38 +899,38 @@ ModuloScheduling::dumpScheduling(){
void void
ModuloScheduling::dumpFinalSchedule(){ ModuloScheduling::dumpFinalSchedule(){
cerr << "dump schedule:" << endl; std::cerr << "dump schedule:" << "\n";
const TargetSchedInfo & msi = target.getSchedInfo(); const TargetSchedInfo & msi = target.getSchedInfo();
unsigned numIssueSlots = msi.maxNumIssueTotal; unsigned numIssueSlots = msi.maxNumIssueTotal;
for (unsigned i = 0; i < numIssueSlots; i++) for (unsigned i = 0; i < numIssueSlots; i++)
cerr << "\t#"; std::cerr << "\t#";
cerr << endl; std::cerr << "\n";
for (unsigned i = 0; i < schedule.size(); i++) { for (unsigned i = 0; i < schedule.size(); i++) {
cerr << "cycle" << i << ": "; std::cerr << "cycle" << i << ": ";
for (unsigned j = 0; j < schedule[i].size(); j++) for (unsigned j = 0; j < schedule[i].size(); j++)
if (schedule[i][j] != NULL) if (schedule[i][j] != NULL)
cerr << schedule[i][j]->getNodeId() << "\t"; std::cerr << schedule[i][j]->getNodeId() << "\t";
else else
cerr << "\t"; std::cerr << "\t";
cerr << endl; std::cerr << "\n";
} }
cerr << "dump coreSchedule:" << endl; std::cerr << "dump coreSchedule:" << "\n";
for (unsigned i = 0; i < numIssueSlots; i++) for (unsigned i = 0; i < numIssueSlots; i++)
cerr << "\t#"; std::cerr << "\t#";
cerr << endl; std::cerr << "\n";
for (unsigned i = 0; i < coreSchedule.size(); i++) { for (unsigned i = 0; i < coreSchedule.size(); i++) {
cerr << "cycle" << i << ": "; std::cerr << "cycle" << i << ": ";
for (unsigned j = 0; j < coreSchedule[i].size(); j++) for (unsigned j = 0; j < coreSchedule[i].size(); j++)
if (coreSchedule[i][j] != NULL) if (coreSchedule[i][j] != NULL)
cerr << coreSchedule[i][j]->getNodeId() << "\t"; std::cerr << coreSchedule[i][j]->getNodeId() << "\t";
else else
cerr << "\t"; std::cerr << "\t";
cerr << endl; std::cerr << "\n";
} }
} }
@ -979,13 +971,13 @@ ModuloSchedulingPass::runOnFunction(Function &F){
ModuloSchedulingSet ModuloSchedulingSet(*graphSet); ModuloSchedulingSet ModuloSchedulingSet(*graphSet);
DEBUG_PRINT(cerr<<"runOnFunction in ModuloSchedulingPass returns\n"<<endl); DEBUG_PRINT(std::cerr<<"runOnFunction in ModuloSchedulingPass returns\n"<<"\n");
return false; return false;
} }
Pass * Pass *
createModuloSchedulingPass(const TargetMachine & tgt){ createModuloSchedulingPass(const TargetMachine & tgt){
DEBUG_PRINT(cerr<<"creating modulo scheduling "<<endl); DEBUG_PRINT(std::cerr<<"creating modulo scheduling\n");
return new ModuloSchedulingPass(tgt); return new ModuloSchedulingPass(tgt);
} }