[llvm-commits] CVS: reopt/lib/LightWtProfiling/TraceToFunction.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Sat May 15 19:29:01 PDT 2004
Changes in directory reopt/lib/LightWtProfiling:
TraceToFunction.cpp updated: 1.33 -> 1.34
---
Log message:
Finish off isFirstLevelInstrumentationBlock()
---
Diffs of the changes: (+9 -3)
Index: reopt/lib/LightWtProfiling/TraceToFunction.cpp
diff -u reopt/lib/LightWtProfiling/TraceToFunction.cpp:1.33 reopt/lib/LightWtProfiling/TraceToFunction.cpp:1.34
--- reopt/lib/LightWtProfiling/TraceToFunction.cpp:1.33 Sat May 15 19:24:08 2004
+++ reopt/lib/LightWtProfiling/TraceToFunction.cpp Sat May 15 19:28:41 2004
@@ -411,15 +411,21 @@
}
/// isFirstLevelInstrumentationBlock - returns true iff BB is a basic block
-/// inserted by the first-level instrumentation (-instloops) pass.
+/// containing only a call to the first-level instrumentation function.
+/// Basic blocks of this form are inserted by the -instloops pass on loop
+/// back-edges.
///
static bool isFirstLevelInstrumentationBlock (BasicBlock *BB) {
BasicBlock::iterator i = BB->begin ();
+ // starts with llvm_first_trigger call
if (!isFirstTriggerCall (*i))
return false;
+ // next thing is an unconditional branch
++i;
- // FIXME
- return false;
+ if (!(isa<BranchInst> (i) && cast<BranchInst> (i)->isUnconditional ()))
+ return false;
+ // looks like the real thing to me...
+ return true;
}
/// fixupFunctionBodyBB - Given srcB in T and its clone dstB in F, and
More information about the llvm-commits
mailing list