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

Brian Gaeke gaeke at cs.uiuc.edu
Mon Jul 12 05:02:01 PDT 2004


Changes in directory reopt/lib/LightWtProfiling:

UnpackTraceFunction.cpp updated: 1.97 -> 1.98

---
Log message:

Just checking in unrelated cosmetic changes which I've accumulated as I
rip apart rewriteEpilog().


---
Diffs of the changes:  (+12 -11)

Index: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp
diff -u reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.97 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.98
--- reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.97	Mon Jul 12 01:21:33 2004
+++ reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp	Mon Jul 12 05:01:24 2004
@@ -399,11 +399,12 @@
     // MatrixFn's stack, so MatrixFn's frame pointer will be the base
     // register. But first we need to load it from the stack (FIXME: we
     // should only do this once!)
-    TRI.cpMem2RegMI (mvec, sp, stackOffsetForReg (fp), g3, TRI.getRegType(g3),
-                     g2);
+    static const unsigned matrixFP = SparcV9::g3;
+    TRI.cpMem2RegMI (mvec, sp, stackOffsetForReg (fp), matrixFP,
+                     TRI.getRegType(matrixFP), g2);
     DEBUG (std::cerr << "addLiveOutCopy: loading matrixFn's frame pointer; "
            << "value is spilled at offset = " << Target.Placement << "\n");
-    BaseReg = g3;
+    BaseReg = matrixFP;
     Offset = Target.Placement;
   }
   TRI.cpReg2MemMI (mvec, R, BaseReg, Offset, RegType, g2);
@@ -468,17 +469,16 @@
   static const unsigned fp = SparcV9::i6, sp = SparcV9::o6, g1 = SparcV9::g1,
     g2 = SparcV9::g2;
 
-  // UTF epilog: start out by clearing everything out of the exit basic block
-  // (FIXME: may not work once we start doing optimizations!!! We will probably
-  // have to use a separate MBB)
-  MBB.clear ();
-  // This is just an educated guess...
+  // We start out each trace-exit MBB with %fp holding the TraceFn frame
+  // pointer.
   fpIsTraceFP = true;
-  
-  // Insert stores from each live-out variable's reg. in the trace
+
+  // Replace the contents of the trace-exit MBB with live-out stores followed
+  // by a branch back to the matrix function's basic block. First, clear the
+  // MBB, then insert stores from each live-out variable's reg. in the trace
   // to its stack slot in the trace function, from which it will be
   // reloaded below into a register. 
-  std::vector<MachineInstr *> mvec;
+  MBB.clear ();
   LiveVariableVector &So = TF->LiveOutVector;
   for (LiveVariableVector::iterator SI = So.begin (), SE = So.end ();
 	   SI != SE; ++SI) {
@@ -511,6 +511,7 @@
   // Restore MatrixFn's FP. Warning! After this point, addLiveOutCopy won't work
   // anymore, because it depends on being able to access TraceFn's frame
   // pointer in %fp.
+  std::vector<MachineInstr *> mvec;
   mvec.clear ();
   TRI.cpMem2RegMI (mvec, sp, stackOffsetForReg (fp), fp, TRI.getRegType(fp),
                    g2);





More information about the llvm-commits mailing list