mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Teach AliasSetTracker about VAArgInst.
llvm-svn: 49674
This commit is contained in:
parent
3e7d0f3882
commit
14dce3e51c
@ -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)); }
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user