[llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/PhaseInfo.h Phases.cpp SparcInstManip.cpp

Joel Stanley jstanley at cs.uiuc.edu
Fri May 30 10:58:09 PDT 2003


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

PhaseInfo.h updated: 1.9.2.1 -> 1.9.2.2
Phases.cpp updated: 1.35.2.1 -> 1.35.2.2
SparcInstManip.cpp updated: 1.16.2.1 -> 1.16.2.2

---
Log message:

Just cleaning up.


---
Diffs of the changes:

Index: llvm/lib/Reoptimizer/Inst/lib/PhaseInfo.h
diff -u llvm/lib/Reoptimizer/Inst/lib/PhaseInfo.h:1.9.2.1 llvm/lib/Reoptimizer/Inst/lib/PhaseInfo.h:1.9.2.2
--- llvm/lib/Reoptimizer/Inst/lib/PhaseInfo.h:1.9.2.1	Fri May 30 10:25:33 2003
+++ llvm/lib/Reoptimizer/Inst/lib/PhaseInfo.h	Fri May 30 10:57:08 2003
@@ -26,19 +26,10 @@
 
 typedef std::pair<uint64_t, uint64_t> AddressRange;
 
-typedef struct InstInfoNode {
-    unsigned      paramSize;
-    void*         retVal;
-    void*         instFunc;
-    //InstInfoNode* next;
-};
-
 typedef struct GBTElem {
     unsigned      siteID;
     unsigned      gbtType;
     unsigned      short* loadVar;
-    unsigned      gbtStartIdx;
-    InstInfoNode* instInfoList;
 };
 
 class Phase3Info 


Index: llvm/lib/Reoptimizer/Inst/lib/Phases.cpp
diff -u llvm/lib/Reoptimizer/Inst/lib/Phases.cpp:1.35.2.1 llvm/lib/Reoptimizer/Inst/lib/Phases.cpp:1.35.2.2
--- llvm/lib/Reoptimizer/Inst/lib/Phases.cpp:1.35.2.1	Fri May 30 10:25:33 2003
+++ llvm/lib/Reoptimizer/Inst/lib/Phases.cpp	Fri May 30 10:57:09 2003
@@ -45,10 +45,13 @@
 //
 //      2. Change the branch to the phase 4 slot to branch to a (new) phase 5 slot. See
 //      appropriate InstManip instance for detailed information about phase 5 slot
-//      contents.
+//      contents.  If there is no registered instrumentation for the phase 5 slot, leave a
+//      nop in place of the branch to reduce runtime overhead.
 //
 //      3. Deallocate the slot that originated this invocation of phase4().
 //
+// PHASE 5: Phase 5 isn't like the other phases; rather, it simply invokes all
+//          registered instrumentation functions for a particular site.
 
 #include <algorithm>
 #include <iomanip>
@@ -399,18 +402,6 @@
     ::doFlush(srcAddr, srcAddr + im->getInstWidth());
 
     return slotBase;
-
-#if 0
-    // Obtain a new slot of the given size
-    uint64_t slotBase = tc->getMemMgr()->getMemory(slotSize);
-    assert(slotBase && "Unable to obtain memory from MemoryManager instance");
-
-    // Replace instruction at srcAddr with branch to start of new slot
-    tc->getVM()->writeInstToVM(srcAddr, im->getBranchAlways(slotBase, srcAddr));
-    ::doFlush(srcAddr, srcAddr + im->getInstWidth());
-
-    return slotBase;
-#endif
 }
 
 static void dumpSnippet(vector<unsigned>& snippet, InstManip* im)
@@ -610,7 +601,7 @@
 
     for(unsigned i = 0; i < ppGBTSize; ++i) {
         ostr << "[pp] ppGBT[" << i << "]: " << ppGBT[i].gbtType << ", "
-             << ppGBT[i].loadVar << ", " << ppGBT[i].gbtStartIdx << endl;
+             << ppGBT[i].loadVar << endl;
     }
 }
 
@@ -690,14 +681,6 @@
                           m_pPhase4Info->getCandidate().front().second);
     }
 
-#if 0
-    // (TEMP) For now, restore the candidate load to its original position for debugging
-    // purposes.
-
-    m_pPhase4Info->getTraceCache()->getVM()->writeInstToVM(m_pPhase4Info->getCandidate().front().first,
-                                                           m_pPhase4Info->getCandidate().front().second);
-#endif
-
     DEBUG_MSG(1, "================ End Phase 4 ================\n");
 }
 
@@ -709,32 +692,6 @@
     InstSiteInfo* siteInfo = InstInfo::findSiteInfo(gbte->siteID, gbte->gbtType);
     siteInfo->invokeFunctions();
     DEBUG_MSG(1, "================ End Phase 5 ================\n");
-
-#if 0
-    switch(gbte->gbtType){
-        case pp::GBT_INTERVAL_START: {
-            DEBUG_MSG(1, "--- phase 5 start site invocation ---\n");
-            DEBUG_MSG(2, "retVal address is " << HEX(gbte->retVal) << endl);
-
-            void (*instFunc)(void*) = (void (*)(void*)) gbte->instFunc;
-            instFunc(gbte->retVal);
-            break;
-        }
-        case pp::GBT_INTERVAL_END: {
-            DEBUG_MSG(1, "--- phase 5 end site invocation ---\n");
-            DEBUG_MSG(2, "start parameter is at gbt index " << gbte->gbtStartIdx << endl);
-            DEBUG_MSG(2, "start parameter addr is "
-                      << HEX(ppGBT[gbte->gbtStartIdx].retVal) << endl);
-
-            void (*instFunc)(void*, void*) = (void (*)(void*, void*)) gbte->instFunc;
-            instFunc(gbte->retVal, ppGBT[gbte->gbtStartIdx].retVal);
-
-            break;
-        }
-    }
-
-    DEBUG_MSG(1, "--- phase 5 invocation completed ---\n" << std::flush);
-#endif
 }
 
 //////////////// InstSiteInfo implementation ////////////////
@@ -749,10 +706,10 @@
 
     if(!isRegistered(func)) {
         DEBUG_MSG(3, "not yet registered, registering...\n");
+
         void* retVal = static_cast<void*>(new char[retValBytes]);
         m_registeredFuncs.insert(func);
-        fi = new InstFunctionInfo(retVal, func);
-        m_instFuncInfos.push_back(fi);
+        m_instFuncInfos.push_back(fi = new InstFunctionInfo(retVal, func));
         installBranch();
     }
     else
@@ -770,6 +727,7 @@
 
     if(!isRegistered(func)) {
         DEBUG_MSG(3, "not yet registered, registering...\n");
+
         m_registeredFuncs.insert(func);
         m_instFuncInfos.push_back(new InstFunctionInfo(retVal, func, startInfo));
         installBranch();


Index: llvm/lib/Reoptimizer/Inst/lib/SparcInstManip.cpp
diff -u llvm/lib/Reoptimizer/Inst/lib/SparcInstManip.cpp:1.16.2.1 llvm/lib/Reoptimizer/Inst/lib/SparcInstManip.cpp:1.16.2.2
--- llvm/lib/Reoptimizer/Inst/lib/SparcInstManip.cpp:1.16.2.1	Fri May 30 10:25:34 2003
+++ llvm/lib/Reoptimizer/Inst/lib/SparcInstManip.cpp	Fri May 30 10:57:09 2003
@@ -242,16 +242,6 @@
 
     DEBUG_MSG(2, "buildPhase5HeapSlot completed\n");
 
-#if 0
-    // If we're dealing with a start-interval instrumentation function, heap-allocate
-    // its parameter memory
-
-    if(gbte->gbtType == pp::GBT_INTERVAL_START) {
-        assert(!gbte->retVal && "Expected null retVal value");
-        gbte->retVal = static_cast<void*>(new char[gbte->paramSize]);
-    }
-#endif
-
     ////////////////
     // Construct the phase 5 jump slot
 





More information about the llvm-commits mailing list