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

Brian Gaeke gaeke at cs.uiuc.edu
Sun Mar 7 19:46:17 PST 2004


Changes in directory reopt/lib/LightWtProfiling:

SLI.cpp updated: 1.17 -> 1.18

---
Log message:

Disable this relatively reasonable-looking assertion about finding back-edges;
I'm not sure why it's failing, but disabling it will just cause us to pick
fewer traces than before.


---
Diffs of the changes:  (+11 -2)

Index: reopt/lib/LightWtProfiling/SLI.cpp
diff -u reopt/lib/LightWtProfiling/SLI.cpp:1.17 reopt/lib/LightWtProfiling/SLI.cpp:1.18
--- reopt/lib/LightWtProfiling/SLI.cpp:1.17	Fri Mar  5 11:29:50 2004
+++ reopt/lib/LightWtProfiling/SLI.cpp	Fri Mar  5 13:44:17 2004
@@ -231,8 +231,17 @@
 
   // Now we have to find the back-edge in the CFG corresponding to the loop
   // we want to instrument.
-  assert(backEdges.find(end) != backEdges.end() && 
-         "Can't find back-edge to instrument in CFG.");
+  if (backEdges.find(end) == backEdges.end()) {
+    // FIXME: This used to be an assertion, and it started failing a
+    // lot. There doesn't seem to be any harm in bailing out here, if we
+    // can't find the back-edge in our map. But it probably means that
+    // getBackEdges() has a bug.
+    DEBUG(std::cerr << "Warning: Back-edge not found in map: "
+                    << "Root (BB w/ branch target) @ " << (void*)root << ": "
+                    << *root << "; " << "End (BB w/ back-edge branch) @ "
+                    << (void*)end << ": " << *end << "\n");
+    return;
+  }
 
   //get forward edges
   std::map<BasicBlock *, unsigned long> forward;





More information about the llvm-commits mailing list