[llvm-commits] CVS: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Mon Nov 3 01:01:03 PST 2003


Changes in directory reopt/lib/LightWtProfiling:

UnpackTraceFunction.cpp updated: 1.7 -> 1.8

---
Log message:

Include TraceToFunction.h.
Don't duplicate stuff here which we're sharing with TraceToFunction.
Add some pseudocode for insertCopyMachineInstrs().

Include PhyRegAlloc.h, gag.
Declare ExportedFnAllocState extern; start out getValueAllocStateFromGlobal()
 by fetching the AllocInfo from it.


---
Diffs of the changes:  (+19 -5)

Index: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp
diff -u reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.7 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.8
--- reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.7	Thu Oct 30 23:36:44 2003
+++ reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp	Mon Nov  3 01:00:32 2003
@@ -6,7 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "TraceToFunction.h"
 #include "../../../../lib/CodeGen/RegAlloc/AllocInfo.h"
+#include "../../../../lib/CodeGen/RegAlloc/PhyRegAlloc.h"
 #include "../../../../lib/Target/Sparc/SparcInternals.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineFunction.h"
@@ -17,11 +19,6 @@
 #include "Support/Debug.h"
 #include <set>
 
-// FIXME: following decls should be shared with TraceToFunction.cpp in a header
-typedef std::set<Value *> LiveVariableSet;
-typedef std::map<BasicBlock *, BasicBlock *> BasicBlockMap;
-extern BasicBlockMap ReturnBlockForTraceExit;
-
 /// Insert (a) machine instruction(s) for the current architecture, that
 /// copies the value in Source to the location specified by Target, at
 /// the beginning of B.
@@ -29,6 +26,19 @@
 void insertCopyMachineInstrs (AllocInfo &Source, AllocInfo &Target,
                               MachineBasicBlock &B) {
   // FIXME: not yet implemented
+#if 0
+  if (Source is memory && Target is register) {
+    Insert load instruction from stack loc. Source into register Target
+  } else if (Source is register && Target is register) {
+    Insert move instruction from register Source to register Target
+  } else if (Source is register && Target is memory) {
+    Insert store instruction from register Source to stack loc. Target
+  } else if (Source is memory && Target is memory) {
+    Get a temporary register somehow
+	Insert load instruction from stack loc. Source into register Temp
+    Insert store instruction from register Temp to stack loc. Target
+  }
+#endif
 }
 
 /// Emit the same sequence of MachineInstrs that
@@ -117,6 +127,8 @@
   extern struct ModuleAllocState _llvm_regAllocState;
 };
 
+extern PhyRegAlloc::SavedStateMapTy ExportedFnAllocState;
+
 /// Get the register number or stack position where V can be found in the
 /// machine code for the function F.
 ///
@@ -133,6 +145,8 @@
 ///
 AllocInfo getValueAllocStateFromGlobal (Function *F, Value *V) {
   // get the saved PhyRegAlloc state for F out of ExportedFnAllocState
+  std::vector<AllocInfo> &FState = ExportedFnAllocState[F];
+
   // get the AllocInfo for V from the saved PhyRegAlloc state for F
 }
 





More information about the llvm-commits mailing list