[llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/Phase2.cpp design.txt

Joel Stanley jstanley at cs.uiuc.edu
Thu Apr 10 17:33:00 PDT 2003


Changes in directory llvm/lib/Reoptimizer/Inst:

Phase2.cpp updated: 1.5 -> 1.6
design.txt updated: 1.7 -> 1.8

---
Log message:




---
Diffs of the changes:

Index: llvm/lib/Reoptimizer/Inst/Phase2.cpp
diff -u llvm/lib/Reoptimizer/Inst/Phase2.cpp:1.5 llvm/lib/Reoptimizer/Inst/Phase2.cpp:1.6
--- llvm/lib/Reoptimizer/Inst/Phase2.cpp:1.5	Thu Apr 10 00:35:03 2003
+++ llvm/lib/Reoptimizer/Inst/Phase2.cpp	Thu Apr 10 17:34:16 2003
@@ -6,27 +6,20 @@
 //
 //      On program startup ("phase 2" function called from main()):
 //      
-//       0. Read the neccessary ELF data associated with the executable image.
-//       1. Build a starting-addres-to-function-extent map for use by later phases.
+//       1. Read the neccessary ELF data associated with the executable image.
 //       
-//       2. For each function F (only in text segment preferably), setup phase 3 branches.
+//       2. For each function F (only in text segment preferably), write code to call phase 3.
 //
-//       Approach A:
-//       
 //           2a. Replace the first instruction in F with a branch to a new slot in the
 //           dummy function.
 //
-// 	     2b. At the new slot write first the (replaced) first instruction in F,
-// 	     followed by code to call the phase 3 function with the address of F as an
-// 	     argument.
-// 	  
-//       Approach B:
-//       
-//           2a. Save the first number instructions in an F -> [instructions] record of
-//           some kind.  Phase 3 will restore them later
+//           2b. Obtain a heap region to write the phase 3 call into.
 //           
-// 	     2b. Over the top of the original instructions (now saved), write a call to
-// 	     phase 3, passing the address of F as an argument.
+// 	     2c. At the new slot write the indirect jump to the heap region, followed by
+// 	     the original (replaced) instruction and branch brack to original code.
+//
+//           2d. Write code to call phase 3 into the heap region, etc.
+//
 
 #include <stdlib.h>
 #include <iostream>


Index: llvm/lib/Reoptimizer/Inst/design.txt
diff -u llvm/lib/Reoptimizer/Inst/design.txt:1.7 llvm/lib/Reoptimizer/Inst/design.txt:1.8
--- llvm/lib/Reoptimizer/Inst/design.txt:1.7	Thu Apr 10 00:35:03 2003
+++ llvm/lib/Reoptimizer/Inst/design.txt	Thu Apr 10 17:34:16 2003
@@ -745,9 +745,8 @@
 there, and then, in the heap-allocated memory write the actual code to do the
 instrumentation, etc, etc.
 
-- Rewrite instruction building mechanisms are general BinInterface macros. Blech.
-
 }}}
+
 {{{ IMPLEMENTATION SKETCH
 
     {{{ Current implementation sketch:





More information about the llvm-commits mailing list