[llvm-commits] CVS: reopt/lib/LightWtProfiling/TraceToFunction.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Thu Jan 8 16:23:01 PST 2004
Changes in directory reopt/lib/LightWtProfiling:
TraceToFunction.cpp updated: 1.16 -> 1.17
---
Log message:
Trap more globals and constants from being considered as trace live-in/outs.
Add more debugging stuff and rewrite some comments.
---
Diffs of the changes: (+12 -4)
Index: reopt/lib/LightWtProfiling/TraceToFunction.cpp
diff -u reopt/lib/LightWtProfiling/TraceToFunction.cpp:1.16 reopt/lib/LightWtProfiling/TraceToFunction.cpp:1.17
--- reopt/lib/LightWtProfiling/TraceToFunction.cpp:1.16 Wed Nov 19 16:51:49 2003
+++ reopt/lib/LightWtProfiling/TraceToFunction.cpp Thu Jan 8 16:22:19 2004
@@ -11,8 +11,9 @@
// Use the mapping information (probably BB TO MI MAP) to translate
// the BasicBlocks in ReturnBlockForTraceExit to a uint64_t
// address. (Figure out how Anand's code does this.)
-// 3) a) Used before defined --> live-in and live-out: dui bu dui?
-// b) Live in and not defined by trace --> not live out.
+// 3) Check these:
+// a) Used before defined --> live-in and live-out
+// b) Live in and not defined by trace --> not live out
//
// Potential optimizations:
// Get rid of BranchNumber
@@ -136,7 +137,8 @@
for (unsigned i = 0; i < I.getNumOperands (); ++i) {
Value *V = I.getOperand (i);
// V is used in the trace by instruction I.
- if (!(isa<Constant> (V) || isa<GlobalVariable> (V)))
+ if (!(isa<Constant> (V) || isa<GlobalValue> (V)
+ || isa<BasicBlock>(V)))
if (!DefinedInTraceBeforeUse (V, T))
S.insert (V);
}
@@ -159,7 +161,8 @@
Instruction &I = *BI;
Value *V = &I;
// I is an instruction in B, which is in the trace.
- if (V->getType () != Type::VoidTy) // Don't worry about void Values.
+ if (!(V->getType () == Type::VoidTy
+ || V->getType () == Type::LabelTy)) // No void or label Values
if (!DefinedInTraceBeforeUse (V, T))
S.insert (&I);
}
@@ -516,6 +519,11 @@
DEBUG(std::cerr << *V << " in instruction " << I
<< " is argument " << LiveInToParameterMap[V]
<< " in new function\n");
+ DEBUG(std::cerr << " -- V's type is " << V->getType () << "\n");
+ DEBUG(std::cerr << " -- Argument " << LiveInToParameterMap[V]
+ << "'s type is "
+ << getFunctionArg (F, LiveInToParameterMap[V])->getType ()
+ << "\n");
assert (V->getType () ==
getFunctionArg (F, LiveInToParameterMap[V])->getType ()
&& "Live-in Value's type doesn't match corresponding arg type");
More information about the llvm-commits
mailing list