[llvm-commits] CVS: llvm/lib/Reoptimizer/Mapping/getLLVMinfo.cpp
Anand Shukla
ashukla at cs.uiuc.edu
Sat May 31 21:39:01 PDT 2003
Changes in directory llvm/lib/Reoptimizer/Mapping:
getLLVMinfo.cpp updated: 1.9 -> 1.10
---
Log message:
Added API to give absolute instruction position in a BB
---
Diffs of the changes:
Index: llvm/lib/Reoptimizer/Mapping/getLLVMinfo.cpp
diff -u llvm/lib/Reoptimizer/Mapping/getLLVMinfo.cpp:1.9 llvm/lib/Reoptimizer/Mapping/getLLVMinfo.cpp:1.10
--- llvm/lib/Reoptimizer/Mapping/getLLVMinfo.cpp:1.9 Sun Jan 19 17:41:36 2003
+++ llvm/lib/Reoptimizer/Mapping/getLLVMinfo.cpp Sat May 31 21:38:11 2003
@@ -62,6 +62,45 @@
return tmp;
}
+vector<unsigned int> getLLVMInstrPositionInfo(Instruction *LI){
+
+ //std::cerr<<"BBMimaplength: "<<BBMIMap_length<<"\n";
+ //std::cerr<<"in getLLVMinstrInfo(Instruction *LI)\n";
+ static bool initialized_tables_LI = false;
+
+ BasicBlock *BB = LI->getParent();
+ Function *F = BB->getParent();
+ Module *M = F->getParent();
+ //std::cerr<<"got BB, F, M\n";
+ if(!initialized_tables_LI){
+ createllvmInstructionKey(M);
+ //std::cerr<<"created InstructionKey\n";
+ initialized_tables_LI = true;
+ }
+
+ pair<uint64_t, uint64_t> BBnoVec = getBasicBlockInfo(BB);
+ //std::cerr<<"got BBnoVec\n";
+
+ unsigned Fno = getFunctionNo(F);
+ //std::cerr<<"got Fno: "<<Fno<<"\n";
+ unsigned BBno = getBasicBlockNo(BB);
+ //std::cerr<<"got BBno: "<<BBno<<"\n";
+ unsigned LIno = getLLVMInstrNo(LI);
+ //std::cerr<<"got LIno: "<<LIno<<"\n";
+
+ vector<unsigned> &MInoVec = getLLVMInstrInfo(Fno, BBno, LIno);
+ //std::cerr<<"got MInoVec\n";
+ uint64_t BBadd = BBnoVec.first;
+ //std::cerr<<"added BBadd: "<<BBadd<<"\n";
+ vector<unsigned int> MIaddVec;
+ for(unsigned i = 0; i < MInoVec.size(); ++i)
+ {
+ MIaddVec.push_back(MInoVec[i]);
+ }
+ //std::cerr<"done\n";
+ return MIaddVec;
+}
+
vector<uint64_t> getLLVMInstrInfo(Instruction *LI){
More information about the llvm-commits
mailing list