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

Brian Gaeke gaeke at cs.uiuc.edu
Thu Oct 23 13:53:02 PDT 2003


Changes in directory reopt/lib/LightWtProfiling:

TraceToFunction.cpp updated: 1.9 -> 1.10

---
Log message:

Add TODOs to head-of-file comment.
Fix an apparently mistakenly reversed if-test.


---
Diffs of the changes:  (+18 -1)

Index: reopt/lib/LightWtProfiling/TraceToFunction.cpp
diff -u reopt/lib/LightWtProfiling/TraceToFunction.cpp:1.9 reopt/lib/LightWtProfiling/TraceToFunction.cpp:1.10
--- reopt/lib/LightWtProfiling/TraceToFunction.cpp:1.9	Tue Oct 14 16:24:52 2003
+++ reopt/lib/LightWtProfiling/TraceToFunction.cpp	Thu Oct 23 13:51:54 2003
@@ -3,6 +3,23 @@
 // Repackage traces as functions, so that global (function-level) optimizations
 // can be applied to traces.
 //
+// TODO (also search for FIXME in this file):
+// 1) Only let things go into the LiveIn/Out sets for which we have register
+//    allocation information available. Otherwise abort.
+//    a) Also only let things go into the LiveOut sets which definitely define
+//       a value (e.g., not "call void ...")
+// 2) For each basic block that exits the trace, we need to keep track of the
+//    address that the "ret" instruction would have returned to. 
+//    a) Use the O2CMap to find, for each Exit BB of the TraceFunction, the
+//       corresponding BB of the matrix Function.
+//    b) Get its Terminator, which should be a BranchInst having an off-Trace
+//       destination, which is a BasicBlock in the matrix Function.
+//    c) Use the mapping information (probably BB TO MI MAP) to translate the
+//       BasicBlock to a uint64_t address. (Figure out how Anand's code does
+//       this.)
+// 3) a) Used before defined --> live-in and live-out: dui bu dui?
+//    b) Live in and not defined by trace --> not live out.
+//
 //===----------------------------------------------------------------------===//
 
 #include "Trace.h"
@@ -120,7 +137,7 @@
 	Value *V = I.getOperand (i);
 	// V is used in the trace by instruction I.
 	if (!(isa<Constant> (V) || isa<GlobalVariable> (V)))
-	  if (DefinedInTraceBeforeUse (V, T))
+	  if (!DefinedInTraceBeforeUse (V, T))
 	    S.insert (V);
       }
     }





More information about the llvm-commits mailing list