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

Brian Gaeke gaeke at cs.uiuc.edu
Thu Oct 30 14:49:01 PST 2003


Changes in directory reopt/lib/LightWtProfiling:

SLI.cpp updated: 1.9 -> 1.10

---
Log message:

Include SecondTrigger.h instead of explicitly declaring countPath() extern.
Shorten some of the conditional-branch-handling code.


---
Diffs of the changes:  (+10 -17)

Index: reopt/lib/LightWtProfiling/SLI.cpp
diff -u reopt/lib/LightWtProfiling/SLI.cpp:1.9 reopt/lib/LightWtProfiling/SLI.cpp:1.10
--- reopt/lib/LightWtProfiling/SLI.cpp:1.9	Mon Oct  6 15:56:06 2003
+++ reopt/lib/LightWtProfiling/SLI.cpp	Thu Oct 30 14:48:39 2003
@@ -5,6 +5,7 @@
 
 #include "GetTimer.h"
 #include "Globals.h"
+#include "SecondTrigger.h"
 #include "Support/DataTypes.h"
 #include "Support/Debug.h"
 #include "reopt/MappingInfo.h"
@@ -18,7 +19,6 @@
 #include <cassert>
 
 extern "C" void llvm_time_end();
-extern void countPath();
 extern "C" void llvm_first_trigger();
 extern void initModules ();
 
@@ -321,43 +321,36 @@
           assert(!isBranchNever(instr) && "Branch never not handled!");
           if(isBranchAlways(instr)){
             uint64_t target = getBranchTarget(instr, addr);
+            trace.push_back(instr);
+            trace.push_back(vm->readInstrFrmVm(addr+4, tr, tr2));
             if(target == addr1){
-              trace.push_back(instr);
-              trace.push_back(vm->readInstrFrmVm(addr+4, tr, tr2));
               trace[index] = getBranchInst(instr, 
                                            (uint64_t)(intptr_t)&trace[0], 
                                            (uint64_t)(intptr_t)&trace[index]);
-              index += 2;
+
             } else{
-              trace.push_back(instr);
-              trace.push_back(vm->readInstrFrmVm(addr+4, tr, tr2));
               BasicBlock *targetBB=NULL;
               assert(getReverseBBMap(getBranchTarget(instr, addr), M, targetBB));
               branchStub[index] = targetBB;
-              index += 2;
             }
+            index += 2;
             addr += 4;
           } else{
             assert (isCondBranch);
             uint64_t target = getBranchTarget(instr, addr);
+            fillLater = index;
+            trace.push_back(instr);
+            trace.push_back(vm->readInstrFrmVm(addr+4, tr, tr2));
             if (target == succ0) {
                 isSucc0 = true;
-                fillLater = index;
-                trace.push_back(instr);
-                trace.push_back(vm->readInstrFrmVm(addr+4, tr, tr2));
                 trace.push_back(succ1_code[0]);
                 trace.push_back(succ1_code[1]);
-                index += 4;
-                addr += 4;
             } else {
-                fillLater = index;
-                trace.push_back(instr);
-                trace.push_back(vm->readInstrFrmVm(addr+4, tr, tr2));
                 trace.push_back(succ0_code[0]);
                 trace.push_back(succ0_code[1]);
-                index += 4;
-                addr += 4; 
             }
+            index += 4;
+            addr += 4;
           }
         } else{
           trace.push_back(instr);





More information about the llvm-commits mailing list