diff options
| author | Dan Gohman <gohman@apple.com> | 2008-04-14 18:34:50 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-04-14 18:34:50 +0000 |
| commit | 2cd8e38ab97d3ad17f9c0d589e5e0591c267cd5e (patch) | |
| tree | fe2c60ea9af2cd710f2225b944d0f65216d917b9 | |
| parent | 87bfc03f4ab714ec16e96c30fd79ac93d3f943c7 (diff) | |
| download | bcm5719-llvm-2cd8e38ab97d3ad17f9c0d589e5e0591c267cd5e.tar.gz bcm5719-llvm-2cd8e38ab97d3ad17f9c0d589e5e0591c267cd5e.zip | |
Teach AliasSetTracker about VAArgInst.
llvm-svn: 49674
| -rw-r--r-- | llvm/include/llvm/Analysis/AliasSetTracker.h | 3 | ||||
| -rw-r--r-- | llvm/lib/Analysis/AliasSetTracker.cpp | 17 |
2 files changed, 20 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/AliasSetTracker.h b/llvm/include/llvm/Analysis/AliasSetTracker.h index 4b5148909ac..a4367c43734 100644 --- a/llvm/include/llvm/Analysis/AliasSetTracker.h +++ b/llvm/include/llvm/Analysis/AliasSetTracker.h @@ -29,6 +29,7 @@ class AliasAnalysis; class LoadInst; class StoreInst; class FreeInst; +class VAArgInst; class AliasSetTracker; class AliasSet; @@ -281,6 +282,7 @@ public: bool add(LoadInst *LI); bool add(StoreInst *SI); bool add(FreeInst *FI); + bool add(VAArgInst *VAAI); bool add(CallSite CS); // Call/Invoke instructions bool add(CallInst *CI) { return add(CallSite(CI)); } bool add(InvokeInst *II) { return add(CallSite(II)); } @@ -295,6 +297,7 @@ public: bool remove(LoadInst *LI); bool remove(StoreInst *SI); bool remove(FreeInst *FI); + bool remove(VAArgInst *VAAI); bool remove(CallSite CS); bool remove(CallInst *CI) { return remove(CallSite(CI)); } bool remove(InvokeInst *II) { return remove(CallSite(II)); } diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp index c35dc324b14..50a6bb8a834 100644 --- a/llvm/lib/Analysis/AliasSetTracker.cpp +++ b/llvm/lib/Analysis/AliasSetTracker.cpp @@ -292,6 +292,12 @@ bool AliasSetTracker::add(FreeInst *FI) { return NewPtr; } +bool AliasSetTracker::add(VAArgInst *VAAI) { + bool NewPtr; + addPointer(VAAI->getOperand(0), ~0, AliasSet::ModRef, NewPtr); + return NewPtr; +} + bool AliasSetTracker::add(CallSite CS) { if (AA.doesNotAccessMemory(CS)) @@ -321,6 +327,8 @@ bool AliasSetTracker::add(Instruction *I) { return add(II); else if (FreeInst *FI = dyn_cast<FreeInst>(I)) return add(FI); + else if (VAArgInst *VAAI = dyn_cast<VAArgInst>(I)) + return add(VAAI); return true; } @@ -414,6 +422,13 @@ bool AliasSetTracker::remove(FreeInst *FI) { return true; } +bool AliasSetTracker::remove(VAArgInst *VAAI) { + AliasSet *AS = findAliasSetForPointer(VAAI->getOperand(0), ~0); + if (!AS) return false; + remove(*AS); + return true; +} + bool AliasSetTracker::remove(CallSite CS) { if (AA.doesNotAccessMemory(CS)) return false; // doesn't alias anything @@ -434,6 +449,8 @@ bool AliasSetTracker::remove(Instruction *I) { return remove(CI); else if (FreeInst *FI = dyn_cast<FreeInst>(I)) return remove(FI); + else if (VAArgInst *VAAI = dyn_cast<VAArgInst>(I)) + return remove(VAAI); return true; } |

