mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-13 23:18:58 +00:00
Teach AliasSetTracker about VAArgInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49674 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4a9a3e5374
commit
235fc57ef2
@ -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