[llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SecondTrigger.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Mon Aug 11 14:09:01 PDT 2003
Changes in directory llvm/lib/Reoptimizer/LightWtProfiling/Trigger:
SecondTrigger.cpp updated: 1.11 -> 1.12
---
Log message:
Let constructVBB fail silently (by returning an empty vector) if it
finds a return instruction, instead of crashing.
Only call optimizeTrace on a non-empty vector.
This should let us start testing the traceToFunction pass.
---
Diffs of the changes:
Index: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SecondTrigger.cpp
diff -u llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SecondTrigger.cpp:1.11 llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SecondTrigger.cpp:1.12
--- llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SecondTrigger.cpp:1.11 Fri Aug 8 14:33:50 2003
+++ llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SecondTrigger.cpp Mon Aug 11 14:08:46 2003
@@ -506,6 +506,12 @@
TerminatorInst *TI = bb->getTerminator();
BranchInst *BI = dyn_cast<BranchInst>(TI);
if (!BI) {
+ if (ReturnInst *RI = dyn_cast<ReturnInst> (TI)) {
+ // Silently fail if we have a basic block in the trace that
+ // ends in a return.
+ vBB.clear();
+ return;
+ }
std::cerr << "Offending instruction: " << *TI << "\n";
assert(0 && "Terminator instruction of BB must be a branch");
}
@@ -556,8 +562,8 @@
//use path 0 to form vBB
//vector<BasicBlock *> vBB;
- //constructVBB (path, start, vBB);
- //optimizeTrace (vBB, firstLevelTraceStartAddr);
+ //constructVBB (paths[0], start, vBB);
+ //if (!vBB.empty()) { optimizeTrace (vBB, firstLevelTraceStartAddr); }
//return;
#ifdef GET_ALL_INFO
More information about the llvm-commits
mailing list