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

Brian Gaeke gaeke at cs.uiuc.edu
Mon Jun 14 00:07:09 PDT 2004


Changes in directory reopt/lib/TraceToFunction:

TraceToFunction.cpp updated: 1.61 -> 1.62

---
Log message:

Get rid of the old TODOs... because I'm not ever going to touch them.
Build the FLI map much earlier.
In doing so, detect back-edge targets that are internal to the trace.
(...And you thought we were doing "single entry" traces!)


---
Diffs of the changes:  (+6 -9)

Index: reopt/lib/TraceToFunction/TraceToFunction.cpp
diff -u reopt/lib/TraceToFunction/TraceToFunction.cpp:1.61 reopt/lib/TraceToFunction/TraceToFunction.cpp:1.62
--- reopt/lib/TraceToFunction/TraceToFunction.cpp:1.61	Tue Jun  8 13:54:00 2004
+++ reopt/lib/TraceToFunction/TraceToFunction.cpp	Mon Jun 14 00:05:46 2004
@@ -10,13 +10,6 @@
 // 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.
-// 2) Check these:
-//    a) Used before defined --> live-in and live-out
-//    b) Live in and not defined by trace --> not live out
-//
 // Potential optimizations:
 // Make it possible to turn off BranchNumber...it is only useful (now) when a
 // human is reading the code.
@@ -404,8 +397,6 @@
 ///
 void TraceFunctionBuilder::fillInFunctionBody (Trace &T, Function *F,
 					  LiveVariableSet &So) {
-  buildFLIMap (T, FLIMap);
-
   // First copy the basic blocks from the trace.
   cloneTraceBBsIntoFunction (TF);
 
@@ -508,6 +499,9 @@
       DEBUG (std::cerr << "buildFLIMap: identified FLI block " << i->getName()
         << " on edge <" << edge.first->getName () << ", "
         << edge.second->getName () << ">\n");
+      DEBUG (if (T.contains (edge.second) && edge.second != T.getEntryBasicBlock ())
+             std::cerr << "buildFLIMap: " << edge.second->getName()
+             << " is a back-edge target that's internal to the trace\n");
       // 1. remove the block from the trace if it is in there
       BasicBlock *bb = i;
       Trace::iterator TI = std::find (T.begin (), T.end (), bb);
@@ -734,6 +728,9 @@
   std::string CurrentFnName = T.getFunction ()->getName ();
   DEBUG(std::cerr << "In buildTraceFunction() for " << CurrentFnName << "\n");
   DEBUG(T.dump ());
+  
+  // Look for FLI blocks in the trace.
+  buildFLIMap (T, FLIMap);
 
   // Get some information about the trace's relationship to its parent
   // function.





More information about the llvm-commits mailing list