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

Brian Gaeke gaeke at cs.uiuc.edu
Sun May 16 00:13:02 PDT 2004


Changes in directory reopt/lib/LightWtProfiling:

SLI.cpp updated: 1.18 -> 1.19

---
Log message:

A few minor refactorings.


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

Index: reopt/lib/LightWtProfiling/SLI.cpp
diff -u reopt/lib/LightWtProfiling/SLI.cpp:1.18 reopt/lib/LightWtProfiling/SLI.cpp:1.19
--- reopt/lib/LightWtProfiling/SLI.cpp:1.18	Fri Mar  5 13:44:17 2004
+++ reopt/lib/LightWtProfiling/SLI.cpp	Sun May 16 00:12:14 2004
@@ -213,9 +213,6 @@
   // a BasicBlock, but since branchAddr ends a basic block, we must scan 
   // backwards hoping to find the beginning of its basic block.
   BasicBlock *root = 0, *end = 0;
-  // FIXME: Rewrite as:
-  // MappingInfo::reconstruct(M)->getBasicBlockForAddress (brTarget);
-  // returning either NULL or a valid BB *.
   assert(getReverseBBMap(brTarget, M, root)
          && "Branch target's BasicBlock not found in map!");
   assert(root && "Branch target mapped to NULL BasicBlock?");
@@ -345,16 +342,15 @@
               callMap[index] = getCallTarget(instr, addr);
               toInline[callTarget] = 1;
               index += 2;
-              addr += 4;
-            } else{
+            } else {
               trace.push_back(call_code[0]);
               trace.push_back(instr);
               trace.push_back(vm->readInstrFrmVm(addr+4, tr, tr2));
               trace.push_back(call_code[1]);
               callMap[index+1] = getCallTarget(instr, addr);
               index += 4;
-              addr += 4;
             }
+            addr += 4;
           } else{
             trace.push_back(call_code[2]); //save o7
             trace.push_back(loop_top_code[0]);
@@ -414,19 +410,16 @@
           assert((taken != vBB[0]) && "Conditional branch to top!");
           trace[index] = succ0_code[0];
           trace.push_back(succ0_code[1]);
-          trace.push_back(BRANCH_ALWAYS);
-          trace.push_back(NOP);
           branchStub[index+2] = taken;
-          index += 4;
         } else{
           assert((ntaken != vBB[0]) && "Conditional branch to top!");
           trace[index] = succ1_code[0];
           trace.push_back(succ1_code[1]);
-          trace.push_back(BRANCH_ALWAYS);
-          trace.push_back(NOP);
           branchStub[index+2] = ntaken;
-          index += 4;
         }
+        trace.push_back(BRANCH_ALWAYS); // this is index+2, above
+        trace.push_back(NOP);
+        index += 4;
       }
     }
   }





More information about the llvm-commits mailing list