[llvm-commits] [poolalloc] r41351 - in /poolalloc/trunk/lib/DSA: BottomUpClosure.cpp CallTargets.cpp CompleteBottomUp.cpp DataStructureAA.cpp DataStructureOpt.cpp DataStructureStats.cpp EquivClassGraphs.cpp GraphChecker.cpp Local.cpp StdLibPass.cpp Steensgaard.cpp TopDownClosure.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Thu Aug 23 19:57:58 PDT 2007
Author: alenhar2
Date: Thu Aug 23 21:57:58 2007
New Revision: 41351
URL: http://llvm.org/viewvc/llvm-project?rev=41351&view=rev
Log:
forgot to commit this
Modified:
poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
poolalloc/trunk/lib/DSA/CallTargets.cpp
poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp
poolalloc/trunk/lib/DSA/DataStructureAA.cpp
poolalloc/trunk/lib/DSA/DataStructureOpt.cpp
poolalloc/trunk/lib/DSA/DataStructureStats.cpp
poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp
poolalloc/trunk/lib/DSA/GraphChecker.cpp
poolalloc/trunk/lib/DSA/Local.cpp
poolalloc/trunk/lib/DSA/StdLibPass.cpp
poolalloc/trunk/lib/DSA/Steensgaard.cpp
poolalloc/trunk/lib/DSA/TopDownClosure.cpp
Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=41351&r1=41350&r2=41351&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Thu Aug 23 21:57:58 2007
@@ -34,6 +34,8 @@
X("dsa-bu", "Bottom-up Data Structure Analysis");
}
+char BUDataStructures::ID;
+
// run - Calculate the bottom up data structure graphs for each function in the
// program.
//
Modified: poolalloc/trunk/lib/DSA/CallTargets.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/CallTargets.cpp?rev=41351&r1=41350&r2=41351&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/CallTargets.cpp (original)
+++ poolalloc/trunk/lib/DSA/CallTargets.cpp Thu Aug 23 21:57:58 2007
@@ -38,6 +38,8 @@
RegisterPass<CallTargetFinder> X("calltarget","Find Call Targets (uses DSA)");
}
+char CallTargetFinder::ID;
+
void CallTargetFinder::findIndTargets(Module &M)
{
TDDataStructures* T = &getAnalysis<TDDataStructures>();
Modified: poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp?rev=41351&r1=41350&r2=41351&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp (original)
+++ poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp Thu Aug 23 21:57:58 2007
@@ -29,6 +29,7 @@
STATISTIC (NumCBUInlines, "Number of graphs inlined");
}
+char CompleteBUDataStructures::ID;
// run - Calculate the bottom up data structure graphs for each function in the
// program.
Modified: poolalloc/trunk/lib/DSA/DataStructureAA.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructureAA.cpp?rev=41351&r1=41350&r2=41351&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DataStructureAA.cpp (original)
+++ poolalloc/trunk/lib/DSA/DataStructureAA.cpp Thu Aug 23 21:57:58 2007
@@ -104,6 +104,8 @@
RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
+char DSAA::ID;
+
ModulePass *llvm::createDSAAPass() { return new DSAA(); }
// getGraphForValue - Return the DSGraph to use for queries about the specified
Modified: poolalloc/trunk/lib/DSA/DataStructureOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructureOpt.cpp?rev=41351&r1=41350&r2=41351&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DataStructureOpt.cpp (original)
+++ poolalloc/trunk/lib/DSA/DataStructureOpt.cpp Thu Aug 23 21:57:58 2007
@@ -52,6 +52,8 @@
RegisterPass<DSOpt> X("ds-opt", "DSA-based simple optimizations");
}
+char DSOpt::ID;
+
ModulePass *llvm::createDSOptPass() { return new DSOpt(); }
/// OptimizeGlobals - This method uses information taken from DSA to optimize
Modified: poolalloc/trunk/lib/DSA/DataStructureStats.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructureStats.cpp?rev=41351&r1=41350&r2=41351&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DataStructureStats.cpp (original)
+++ poolalloc/trunk/lib/DSA/DataStructureStats.cpp Thu Aug 23 21:57:58 2007
@@ -65,6 +65,8 @@
static RegisterPass<DSGraphStats> Z("dsstats", "DS Graph Statistics");
}
+char DSGraphStats::ID;
+
FunctionPass *llvm::createDataStructureStatsPass() {
return new DSGraphStats();
}
Modified: poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp?rev=41351&r1=41350&r2=41351&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp (original)
+++ poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp Thu Aug 23 21:57:58 2007
@@ -37,6 +37,8 @@
"Number of graphs inlined");
}
+char EquivClassGraphs::ID;
+
#ifndef NDEBUG
template<typename GT>
static void CheckAllGraphs(Module *M, GT &ECGraphs) {
Modified: poolalloc/trunk/lib/DSA/GraphChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/GraphChecker.cpp?rev=41351&r1=41350&r2=41351&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/GraphChecker.cpp (original)
+++ poolalloc/trunk/lib/DSA/GraphChecker.cpp Thu Aug 23 21:57:58 2007
@@ -77,6 +77,8 @@
RegisterPass<DSGC> X("datastructure-gc", "DSA Graph Checking Pass");
}
+char DSGC::ID;
+
FunctionPass *llvm::createDataStructureGraphCheckerPass() {
return new DSGC();
}
Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=41351&r1=41350&r2=41351&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Thu Aug 23 21:57:58 2007
@@ -64,7 +64,7 @@
////////////////////////////////////////////////////////////////////////////
// Helper functions used to implement the visitation functions...
- void MergeConstantInitIntoNode(DSNodeHandle &NH, Constant *C);
+ void MergeConstantInitIntoNode(DSNodeHandle &NH, const Type* Ty, Constant *C);
/// createNode - Create a new DSNode, ensuring that it is properly added to
/// the graph.
@@ -297,6 +297,8 @@
void GraphBuilder::visitLoadInst(LoadInst &LI) {
DSNodeHandle Ptr = getValueDest(*LI.getOperand(0));
+ if (Ptr.isNull()) return; // Load from null
+
// Make that the node is read from...
Ptr.getNode()->setReadMarker();
@@ -345,6 +347,8 @@
}
void GraphBuilder::visitIntToPtrInst(IntToPtrInst &I) {
+ std::cerr << "cast in " << I.getParent()->getParent()->getName() << "\n";
+ I.dump();
setDestTo(I, createNode()->setUnknownMarker()->setIntToPtrMarker());
}
@@ -659,13 +663,13 @@
// MergeConstantInitIntoNode - Merge the specified constant into the node
// pointed to by NH.
-void GraphBuilder::MergeConstantInitIntoNode(DSNodeHandle &NH, Constant *C) {
+void GraphBuilder::MergeConstantInitIntoNode(DSNodeHandle &NH, const Type* Ty, Constant *C) {
// Ensure a type-record exists...
DSNode *NHN = NH.getNode();
- NHN->mergeTypeInfo(C->getType(), NH.getOffset());
+ NHN->mergeTypeInfo(Ty, NH.getOffset());
- if (C->getType()->isFirstClassType()) {
- if (isa<PointerType>(C->getType()))
+ if (Ty->isFirstClassType()) {
+ if (isa<PointerType>(Ty))
// Avoid adding edges from null, or processing non-"pointer" stores
NH.addEdgeTo(getValueDest(*C));
return;
@@ -676,15 +680,15 @@
if (ConstantArray *CA = dyn_cast<ConstantArray>(C)) {
for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i)
// We don't currently do any indexing for arrays...
- MergeConstantInitIntoNode(NH, cast<Constant>(CA->getOperand(i)));
+ MergeConstantInitIntoNode(NH, cast<ArrayType>(Ty)->getElementType(), cast<Constant>(CA->getOperand(i)));
} else if (ConstantStruct *CS = dyn_cast<ConstantStruct>(C)) {
- const StructLayout *SL = TD.getStructLayout(CS->getType());
+ const StructLayout *SL = TD.getStructLayout(cast<StructType>(Ty));
for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i) {
DSNode *NHN = NH.getNode();
//Some programmers think ending a structure with a [0 x sbyte] is cute
if (SL->getElementOffset(i) < SL->getSizeInBytes()) {
DSNodeHandle NewNH(NHN, NH.getOffset()+(unsigned)SL->getElementOffset(i));
- MergeConstantInitIntoNode(NewNH, cast<Constant>(CS->getOperand(i)));
+ MergeConstantInitIntoNode(NewNH, cast<StructType>(Ty)->getElementType(i), cast<Constant>(CS->getOperand(i)));
} else if (SL->getElementOffset(i) == SL->getSizeInBytes()) {
DOUT << "Zero size element at end of struct\n";
NHN->foldNodeCompletely();
@@ -703,9 +707,10 @@
assert(!GV->isDeclaration() && "Cannot merge in external global!");
// Get a node handle to the global node and merge the initializer into it.
DSNodeHandle NH = getValueDest(*GV);
- MergeConstantInitIntoNode(NH, GV->getInitializer());
+ MergeConstantInitIntoNode(NH, GV->getType()->getElementType(), GV->getInitializer());
}
+char LocalDataStructures::ID;
bool LocalDataStructures::runOnModule(Module &M) {
setTargetData(getAnalysis<TargetData>());
Modified: poolalloc/trunk/lib/DSA/StdLibPass.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/StdLibPass.cpp?rev=41351&r1=41350&r2=41351&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/StdLibPass.cpp (original)
+++ poolalloc/trunk/lib/DSA/StdLibPass.cpp Thu Aug 23 21:57:58 2007
@@ -29,6 +29,8 @@
static RegisterPass<StdLibDataStructures>
X("dsa-stdlib", "Standard Library Local Data Structure Analysis");
+char StdLibDataStructures::ID;
+
bool StdLibDataStructures::runOnModule(Module &M) {
LocalDataStructures &LocalDSA = getAnalysis<LocalDataStructures>();
setGraphSource(&LocalDSA);
Modified: poolalloc/trunk/lib/DSA/Steensgaard.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Steensgaard.cpp?rev=41351&r1=41350&r2=41351&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Steensgaard.cpp (original)
+++ poolalloc/trunk/lib/DSA/Steensgaard.cpp Thu Aug 23 21:57:58 2007
@@ -85,6 +85,8 @@
RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
+char Steens::ID;
+
ModulePass *llvm::createSteensgaardPass() { return new Steens(); }
/// ResolveFunctionCall - Resolve the actual arguments of a call to function F
Modified: poolalloc/trunk/lib/DSA/TopDownClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/TopDownClosure.cpp?rev=41351&r1=41350&r2=41351&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/TopDownClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/TopDownClosure.cpp Thu Aug 23 21:57:58 2007
@@ -38,6 +38,8 @@
STATISTIC (NumTDInlines, "Number of graphs inlined");
}
+char TDDataStructures::ID;
+
void TDDataStructures::markReachableFunctionsExternallyAccessible(DSNode *N,
hash_set<DSNode*> &Visited) {
if (!N || Visited.count(N)) return;
More information about the llvm-commits
mailing list