[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructureAA.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Mar 26 14:47:16 PST 2005
Changes in directory llvm/lib/Analysis/DataStructure:
DataStructureAA.cpp updated: 1.31 -> 1.32
---
Log message:
slightly improve mod/ref for DSAA by checking the globals graph for fallback
---
Diffs of the changes: (+12 -0)
DataStructureAA.cpp | 12 ++++++++++++
1 files changed, 12 insertions(+)
Index: llvm/lib/Analysis/DataStructure/DataStructureAA.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.31 llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.32
--- llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.31 Wed Mar 23 21:04:50 2005
+++ llvm/lib/Analysis/DataStructure/DataStructureAA.cpp Sat Mar 26 16:47:03 2005
@@ -222,6 +222,18 @@
cast<GlobalVariable>(P)->getType()->getElementType()->isFirstClassType() &&
"This isn't a global that DSA inconsiderately dropped "
"from the graph?");
+
+ DSGraph &GG = *CallerTDGraph.getGlobalsGraph();
+ DSScalarMap::iterator NI = GG.getScalarMap().find(P);
+ if (NI != GG.getScalarMap().end() && !NI->second.isNull()) {
+ // Otherwise, if the node is only M or R, return this. This can be
+ // useful for globals that should be marked const but are not.
+ DSNode *N = NI->second.getNode();
+ if (!N->isModified())
+ Result = (ModRefResult)(Result & ~Mod);
+ if (!N->isRead())
+ Result = (ModRefResult)(Result & ~Ref);
+ }
}
return Result;
}
More information about the llvm-commits
mailing list