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

Brian Gaeke gaeke at cs.uiuc.edu
Fri Jan 16 11:50:01 PST 2004


Changes in directory reopt/lib/LightWtProfiling:

UnpackTraceFunction.cpp updated: 1.29 -> 1.30

---
Log message:

Fold insertLiveVariableCopies into UnpackTraceFunction::runOnMachineFunction.

---
Diffs of the changes:  (+10 -13)

Index: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp
diff -u reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.29 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.30
--- reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.29	Fri Jan 16 11:14:22 2004
+++ reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp	Fri Jan 16 11:49:46 2004
@@ -231,11 +231,16 @@
 /// first, at the entry basic block to copy the values in Si from
 /// MatrixF's registers to TraceF's registers, and second,
 /// at each exit basic block to copy the values in So from TraceF's
-/// registers to MatrixF's registers.
+/// registers to MatrixF's registers. MF is TraceF's MachineFunction.
 ///
-void insertLiveVariableCopies(Function *MatrixF, Function *TraceF,
-                              LiveVariableSet &Si, LiveVariableSet &So) {
-  MachineFunction &MF = MachineFunction::get (TraceF);
+bool UnpackTraceFunction::runOnMachineFunction (MachineFunction &MF) {
+  // This is pretty lame, but for now, we can only deal with one
+  // TraceFn and one MatrixFn in any given UnpackTraceFunction pass.
+  if (MF.getFunction () != TF->TraceFn)
+    return false;
+
+  Function *TraceF = TF->TraceFn, *MatrixF = TF->MatrixFn;
+  LiveVariableSet &Si = TF->LiveInSet, &So = TF->LiveOutSet;
 
   // Modify ENTRY MachineBasicBlock of MF
   MachineBasicBlock &E = MF.front (); // E = Entry MBB of MF
@@ -284,16 +289,8 @@
       insertBranchMachineInstrs (ReturnAddress, MBB);
     }
   }
-}
 
-bool UnpackTraceFunction::runOnMachineFunction (MachineFunction &MF) {
-  // This is pretty lame, but for now, we can only deal with one
-  // TraceFn and one MatrixFn in any given UnpackTraceFunction pass.
-  if (MF.getFunction () != TF->TraceFn)
-    return false;
-  
-  // not finished yet
-  return false;
+  return true; // MachineFunction was modified
 }
 
 } // end namespace llvm





More information about the llvm-commits mailing list