diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-26 22:47:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-26 22:47:03 +0000 |
commit | bc499de74fef014485e96ed3f34b9ddf6dfcb81c (patch) | |
tree | 8dd1ab08de7aafa12a4728c67b061f2223989282 /lib/Analysis/DataStructure/DataStructureAA.cpp | |
parent | b7523418b097fddd6afae64eb057753d7e8f1166 (diff) |
slightly improve mod/ref for DSAA by checking the globals graph for fallback
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20868 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/DataStructureAA.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/DataStructureAA.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Analysis/DataStructure/DataStructureAA.cpp b/lib/Analysis/DataStructure/DataStructureAA.cpp index 6f1cb56d86..c2449c2b74 100644 --- a/lib/Analysis/DataStructure/DataStructureAA.cpp +++ b/lib/Analysis/DataStructure/DataStructureAA.cpp @@ -222,6 +222,18 @@ DSAA::getModRefInfo(CallSite CS, Value *P, unsigned Size) { 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; } |