[llvm-commits] CVS: llvm/include/llvm/Reoptimizer/BinInterface/LLVMTrace.h
Anand Shukla
ashukla at cs.uiuc.edu
Sat May 31 17:17:22 PDT 2003
Changes in directory llvm/include/llvm/Reoptimizer/BinInterface:
LLVMTrace.h added (r1.1)
---
Log message:
First version of working bininterface API/implementation
---
Diffs of the changes:
Index: llvm/include/llvm/Reoptimizer/BinInterface/LLVMTrace.h
diff -c /dev/null llvm/include/llvm/Reoptimizer/BinInterface/LLVMTrace.h:1.1
*** /dev/null Sat May 31 17:16:45 2003
--- llvm/include/llvm/Reoptimizer/BinInterface/LLVMTrace.h Sat May 31 17:16:35 2003
***************
*** 0 ****
--- 1,61 ----
+ //===-- ------------llvm/Reoptimizer/LLVMTrace.h -----------------*- C++ -*--=//
+ // Implements trace manipulation using bin interface
+ //
+ //===----------------------------------------------------------------------===//
+
+ #include<map>
+ #include<vector>
+
+ class BinInterface;
+ class TraceCache;
+ class VirtualMem;
+ class Instruction;
+ class BasicBlock;
+
+ class LLVMTrace{
+ private:
+ //LLVM instr to cids
+ std::map<Instruction *, std::vector<unsigned int> > InstrToCid;
+ //LLVM instr to section of epilog the
+ //control flow may go to
+ std::map<Instruction *, unsigned int> InstrToSec;
+ BinInterface *bb;
+ VirtualMem *vm;
+ TraceCache *tr;
+ unsigned int traceInstructions; //# of machine instructions in the trace
+ unsigned int unrollFactor; //How many times has it been unrolled
+ unsigned numberOfEpilogs;
+
+ public:
+ LLVMTrace(BinInterface *b, VirtualMem *v, TraceCache *t);
+
+ void addTrace(std::map<BasicBlock *, unsigned int> &bbToCid,
+ std::map<BasicBlock *, unsigned int> &bbToSec,
+ std::map<BasicBlock *, unsigned char> &removedBranch,
+ unsigned int lastSecId, unsigned int cidOffset,
+ unsigned int unroll);
+
+ //get CIDs for this instruction, and return it in vec
+ void getCids(Instruction *I, std::vector<unsigned int> &vec);
+
+ //get CIDs for ALL machine instructions including the
+ //ones that were formed because of unrolling, and return it in vec
+ void getAllCids(Instruction *I, std::vector<unsigned int> &vec);
+
+ //get section id for the instruction
+ unsigned int getSec(Instruction *I);
+
+ //get ALL section ids for the instruction, including the
+ //ones formed because of unrolling
+ void getAllSec(Instruction *I, std::vector<unsigned int> &vec);
+
+ //move instruction to beginning of section
+ void moveInstrToSec(Instruction *I, unsigned int sec);
+
+ //move instruction to after an instruction cid
+ void moveInstrAfter(Instruction *I, unsigned int cid);
+
+ //move instruction to before an instruction cid
+ void moveInstrBefore(Instruction *I, unsigned int cid);
+
+ };
More information about the llvm-commits
mailing list