[llvm-commits] CVS: reopt/lib/TraceToFunction/TraceToFunction.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Wed Jul 7 01:38:01 PDT 2004
Changes in directory reopt/lib/TraceToFunction:
TraceToFunction.cpp updated: 1.69 -> 1.70
---
Log message:
Get rid of the std::set version of AlternateEntryPoints, leaving only
the vector version.
---
Diffs of the changes: (+5 -8)
Index: reopt/lib/TraceToFunction/TraceToFunction.cpp
diff -u reopt/lib/TraceToFunction/TraceToFunction.cpp:1.69 reopt/lib/TraceToFunction/TraceToFunction.cpp:1.70
--- reopt/lib/TraceToFunction/TraceToFunction.cpp:1.69 Tue Jul 6 21:19:51 2004
+++ reopt/lib/TraceToFunction/TraceToFunction.cpp Wed Jul 7 01:37:14 2004
@@ -51,7 +51,6 @@
class TraceFunctionBuilder {
BranchNumberMap BranchNumber;
TraceFunction *TF;
- std::set<BasicBlock *> AlternateEntryPoints;
std::vector<BasicBlock *> AlternateEntryPointsV;
void getTraceLiveInSet (LiveVariableSet &S, LiveVariableVector &LVV,
Trace &T);
@@ -178,11 +177,6 @@
if (std::find (Vector.begin (), Vector.end (), V) == Vector.end ())
Vector.push_back (V);
}
-static void insert (std::set<BasicBlock *> &Set, std::vector<BasicBlock *> &Vector, BasicBlock *V){
- Set.insert (V);
- if (std::find (Vector.begin (), Vector.end (), V) == Vector.end ())
- Vector.push_back (V);
-}
/// addTraceLiveInsToSet - helper fn. for getTraceLiveInSet and
/// getTraceLiveOutSet. Adds the live-ins of T to S, assuming that
@@ -255,7 +249,7 @@
// If there are alternate entry points into the trace, their live-INs are
// live-OUT from the main trace.
- if (!AlternateEntryPoints.empty ()) {
+ if (!AlternateEntryPointsV.empty ()) {
for (std::vector<BasicBlock *>::iterator i = AlternateEntryPointsV.begin (),
e = AlternateEntryPointsV.end (); i != e; ++i) {
// Find the position of the block in the trace.
@@ -584,7 +578,10 @@
if (T.contains (edge.second) && edge.second != T.getEntryBasicBlock ()) {
DEBUG (std::cerr << "buildFLIMap: " << edge.second->getName()
<< " is a back-edge target that's internal to the trace\n");
- insert (AlternateEntryPoints, AlternateEntryPointsV, edge.second);
+ if (std::find (AlternateEntryPointsV.begin (),
+ AlternateEntryPointsV.end (), edge.second)
+ == AlternateEntryPointsV.end ())
+ AlternateEntryPointsV.push_back (edge.second);
}
// 1. remove the block from the trace if it is in there
BasicBlock *bb = i;
More information about the llvm-commits
mailing list