[llvm-commits] CVS: reopt/include/reopt/TraceToFunction.h

Brian Gaeke gaeke at cs.uiuc.edu
Fri Jul 9 14:42:09 PDT 2004


Changes in directory reopt/include/reopt:

TraceToFunction.h updated: 1.19 -> 1.20

---
Log message:

Key the Return Block for Trace Exit map on return instructions, not the
basic blocks that they happen to be in, because it is possible for the
CFG to change, and it seems to me more likely that a return instruction
would end up in a different basic block than for it to be destroyed and
replaced with a new one.

getFunctionArg is history, having no more users.


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

Index: reopt/include/reopt/TraceToFunction.h
diff -u reopt/include/reopt/TraceToFunction.h:1.19 reopt/include/reopt/TraceToFunction.h:1.20
--- reopt/include/reopt/TraceToFunction.h:1.19	Wed Jul  7 22:19:57 2004
+++ reopt/include/reopt/TraceToFunction.h	Fri Jul  9 14:41:27 2004
@@ -15,20 +15,14 @@
 
 namespace llvm {
 
+class ReturnInst;
+
 typedef std::set<Value *> LiveVariableSet;
 typedef std::vector<Value *> LiveVariableVector;
-typedef std::map<const BasicBlock *, BasicBlock *> BasicBlockMap;
+typedef std::map<const ReturnInst *, BasicBlock *> ReturnBlockMap;
 typedef std::map<const Value *, Value *> ValueMap;
 typedef std::map<const Value *, unsigned int> ValueToIntMap;
 
-/// getFunctionArg - Return a pointer to F's ARGNOth argument.
-///
-static inline Argument *getFunctionArg (Function *F, unsigned argno) {
-  Function::aiterator ai = F->abegin ();
-  while (argno) { ++ai; --argno; }
-  return &*ai;
-}
-
 // This class encapsulates all the TraceToFunction algorithm's saved baggage.
 // You can't have a TraceFunction without a Trace, but you might be able to
 // get away with using a Trace instead of this class in new code.
@@ -65,10 +59,10 @@
   ///
   static TraceFunction *get (Trace &T);
 
-  /// Map of basic blocks containing return instructions in TraceFn -->
+  /// Map of return instructions in TraceFn -->
   /// basic blocks that they are supposed to return to in MatrixFn.
   ///
-  BasicBlockMap ReturnBlockForTraceExit;
+  ReturnBlockMap ReturnBlockForTraceExit;
 
   /// Map of original values in MatrixFn --> clones in TraceFn.
   ///





More information about the llvm-commits mailing list