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

Joel Stanley jstanley at cs.uiuc.edu
Sun May 4 16:09:01 PDT 2003


Changes in directory llvm/lib/Reoptimizer/Inst/lib:

Phases.cpp updated: 1.22 -> 1.23
design.txt updated: 1.12 -> 1.13

---
Log message:

The instrumentation exclusion set is now working.


---
Diffs of the changes:

Index: llvm/lib/Reoptimizer/Inst/lib/Phases.cpp
diff -u llvm/lib/Reoptimizer/Inst/lib/Phases.cpp:1.22 llvm/lib/Reoptimizer/Inst/lib/Phases.cpp:1.23
--- llvm/lib/Reoptimizer/Inst/lib/Phases.cpp:1.22	Sun May  4 15:01:30 2003
+++ llvm/lib/Reoptimizer/Inst/lib/Phases.cpp	Sun May  4 16:16:17 2003
@@ -50,25 +50,29 @@
 //      3. Deallocate the slot that originated this invocation of phase4().
 //
 
-#include <stdlib.h>
-#include <iostream>
+#include <algorithm>
 #include <iomanip>
+#include <iostream>
+#include <set>
+#include <stdlib.h>
 #include <vector>
-#include <algorithm>
 
+#include "llvm/Reoptimizer/Inst/ElfReader.h"
+#include "llvm/Reoptimizer/MemoryManager.h"
 #include "llvm/Reoptimizer/TraceCache.h"
 #include "llvm/Reoptimizer/VirtualMem.h"
-#include "llvm/Reoptimizer/MemoryManager.h"
-#include "llvm/Reoptimizer/Inst/ElfReader.h"
 
 #include "InstManip.h"
-#include "SparcInstManip.h"
 #include "PhaseInfo.h"
+#include "SparcInstManip.h"
 
 using std::vector;
 using std::cerr;
 using std::endl;
 
+// The function generated at compile-time by the 'mkexcl' command line utility.
+void makeExcludedSymbolSet(std::set<std::string>& set);
+
 // Description of GBT contents emitted by phase 1. The extern reference to the GBT will be
 // resolved at link-time, and will point to the GBT itself. The size of the GBT is
 // obtained in the same manner.
@@ -97,8 +101,9 @@
   private:
     Phase2() {}
     
-    TraceCache* m_pTC;
-    InstManip*  m_pIM;
+    std::set<std::string> m_excludeSet;
+    TraceCache*           m_pTC;
+    InstManip*            m_pIM;
 };
 
 // Phase3 is the class that is responsible for making the "phase 3" transformation; the
@@ -157,6 +162,7 @@
     m_pTC(tc),
     m_pIM(pIM)
 {
+    makeExcludedSymbolSet(m_excludeSet);
 }
 
 void Phase2::transform()
@@ -186,15 +192,15 @@
     for(vector<std::pair<std::string, AddressRange> >::iterator i = funcs.begin(),
             e = funcs.end(); i != e; ++i) {
 
-#if 1
-        cerr << i->first << endl;
-        
-#else
-        if(i->first == "fibs") {
-            cerr << "Transforming function " << i->first << "..." << endl;
-            transformFunction(i->second);
+        if(m_excludeSet.find(i->first) == m_excludeSet.end()) {
+            // Function is not in exclude set, so go ahead and transform it
+            //cerr << i->first << " is to be transformed" << endl;
+
+            if(i->first == "fibs") {
+                cerr << "Transforming function " << i->first << "..." << endl;
+                transformFunction(i->second);
+            }
         }
-#endif
     }
 
     cerr << "============================== End Phase 2 ==============================\n";    


Index: llvm/lib/Reoptimizer/Inst/lib/design.txt
diff -u llvm/lib/Reoptimizer/Inst/lib/design.txt:1.12 llvm/lib/Reoptimizer/Inst/lib/design.txt:1.13
--- llvm/lib/Reoptimizer/Inst/lib/design.txt:1.12	Wed Apr 30 11:36:09 2003
+++ llvm/lib/Reoptimizer/Inst/lib/design.txt	Sun May  4 16:16:17 2003
@@ -886,8 +886,8 @@
 
 {{{ TODO
 
-    - Refactor for platform independence, or at least approximate closely a good refactoring.
-      - Suggest making a slot builder class as well -- pull out slot creation from InstManip.
+    - Move statically-sized spill regions so that they are internal to SparcInstManip.
+      (do not need variable-sized spill region except for phase5 invocations)
 
     - Start table-of-stacks implementation for phase4 authorship of phase 5 slots.
 
@@ -896,6 +896,7 @@
     - Optimizations:
         - No need to save registers (other than those clobbered) in phase 3 slot, since phase 3
           is invoked at the start of the function. Must still spill/restore shared, though.
+        - No need to save registers (other than those clobbered) in general.
 
 }}}
 





More information about the llvm-commits mailing list