diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-03-17 20:16:58 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-03-17 20:16:58 +0000 | 
| commit | 50cb9b40c2b00bd538371363c714a02a65d0398e (patch) | |
| tree | f0d07fa3007cb48551838ce2a7b6792c2a7281b6 /lib/Analysis/DataStructure/DataStructureAA.cpp | |
| parent | 94f8470fe38a51b998ab5bc4e195ef82fef07eb5 (diff) | |
simplify this function a bit, allow DS-AA to build on/improve the mod/ref
results returned by AA, not just use one or the other.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20662 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/DataStructureAA.cpp')
| -rw-r--r-- | lib/Analysis/DataStructure/DataStructureAA.cpp | 19 | 
1 files changed, 11 insertions, 8 deletions
| diff --git a/lib/Analysis/DataStructure/DataStructureAA.cpp b/lib/Analysis/DataStructure/DataStructureAA.cpp index 74fdb1f590..2d62162d1d 100644 --- a/lib/Analysis/DataStructure/DataStructureAA.cpp +++ b/lib/Analysis/DataStructure/DataStructureAA.cpp @@ -173,9 +173,11 @@ AliasAnalysis::AliasResult DSAA::alias(const Value *V1, unsigned V1Size,  ///  AliasAnalysis::ModRefResult  DSAA::getModRefInfo(CallSite CS, Value *P, unsigned Size) { +  AliasAnalysis::ModRefResult Result =AliasAnalysis::getModRefInfo(CS, P, Size);    Function *F = CS.getCalledFunction(); -  if (!F || F->isExternal()) -    return AliasAnalysis::getModRefInfo(CS, P, Size); + +  if (!F || F->isExternal() || Result == NoModRef) +    return Result;    // Clone the function TD graph, clearing off Mod/Ref flags    const Function *csParent = CS.getInstruction()->getParent()->getParent(); @@ -189,12 +191,13 @@ DSAA::getModRefInfo(CallSite CS, Value *P, unsigned Size) {    // Report the flags that have been added    const DSNodeHandle &DSH = TDGraph.getNodeForValue(P); -  if (const DSNode *N = DSH.getNode()) -    if (N->isModified()) -      return N->isRead() ? ModRef : Mod; -    else -      return N->isRead() ? Ref : NoModRef; -  return NoModRef; +  if (const DSNode *N = DSH.getNode()) { +    if (!N->isModified())   // We proved it was not modified. +      Result = ModRefResult(Result & ~Mod); +    if (!N->isRead())       // We proved it was not read. +      Result = ModRefResult(Result & ~Ref); +  } +  return Result;  } | 
