[llvm-commits] CVS: reopt/include/reopt/UnpackTraceFunction.h

Brian Gaeke gaeke at cs.uiuc.edu
Sun May 23 05:09:01 PDT 2004


Changes in directory reopt/include/reopt:

UnpackTraceFunction.h added (r1.1)

---
Log message:

Definition of class UnpackTraceFunction moved into this public header file.


---
Diffs of the changes:  (+64 -0)

Index: reopt/include/reopt/UnpackTraceFunction.h
diff -c /dev/null reopt/include/reopt/UnpackTraceFunction.h:1.1
*** /dev/null	Sun May 23 05:08:48 2004
--- reopt/include/reopt/UnpackTraceFunction.h	Sun May 23 05:08:38 2004
***************
*** 0 ****
--- 1,64 ----
+ //===- reopt/UnpackTraceFunction.h -------------------------------*- C++ -*--=//
+ //
+ // Unpackage functions previously formed from traces by TraceToFunction.
+ //
+ //===----------------------------------------------------------------------===//
+ 
+ #ifndef REOPT_UNPACKTRACEFUNCTION_H
+ #define REOPT_UNPACKTRACEFUNCTION_H
+ 
+ #include "llvm/CodeGen/MachineFunctionPass.h"
+ #include <set>
+ 
+ namespace llvm {
+ 
+ class TargetMachine;
+ class TraceFunction;
+ class AllocInfo;
+ class Type;
+ 
+ /// This pass inserts copies in two places in the machine
+ /// code for TF->TraceFn: first, at the entry basic block to copy the values in
+ /// TF->LiveInSet from TF->MatrixFn's registers to TF->TraceFn's registers, and
+ /// second, at each exit basic block to copy the values in TF->LiveOutSet from
+ /// TF->TraceFn's registers to TF->MatrixFn's registers.
+ ///
+ class UnpackTraceFunction : public MachineFunctionPass {
+   TargetMachine *TM;
+   TraceFunction *TF;
+ 
+   /// Static stack size of the MachineFunction. Filled in by rewriteProlog ()
+   /// by calling getStaticStackSize (), and then used again by rewriteEpilog ().
+   ///
+   unsigned StaticStackSize;
+ 
+   /// Total stack size of the MachineFunction, including space for regs
+   /// modified in TraceFn to be saved.
+   ///
+   int TotalStackSize;
+ 
+   /// Registers clobbered in the trace. Filled in by findRegsUsedInFunction ().
+   ///
+   std::set<unsigned> RegsToRestore;
+   std::set<unsigned> RegsToSave;
+ 
+   unsigned getStaticStackSize (MachineFunction &MF);
+   unsigned stackOffsetForReg (unsigned R);
+   void findRegsToRestore (MachineFunction &MF);
+   void insertCopyMachineInstrs (AllocInfo &Source, AllocInfo &Target,
+                                 MachineBasicBlock &B, const Type *Ty);
+   void insertBranchMachineInstrs (uint64_t Target, MachineBasicBlock &B);
+   const MachineInstr *containsReturnInstr (MachineBasicBlock &B);
+   void rewriteProlog (MachineFunction &MF, MachineBasicBlock &MBB);
+   void rewriteEpilog (MachineFunction &MF, MachineBasicBlock &MBB);
+ 
+ public:
+   UnpackTraceFunction (TargetMachine *TM_) : TM (TM_), TF (0) { }
+   void setTraceFunction (TraceFunction *TF_) { TF = TF_; }
+   const char *getPassName () const { return "Unpack trace function"; }
+   virtual bool runOnMachineFunction (MachineFunction &MF);
+ };
+ 
+ } // end namespace llvm
+ 
+ #endif // REOPT_UNPACKTRACEFUNCTION_H





More information about the llvm-commits mailing list