[Attributor] Check for noalias call in AAInstanceInfo
The relevant property of allocation functions of interest here is their uniqueness (in the sense of disjoint provenance), which is encoded by the noalias return attribute. Differential Revision: https://reviews.llvm.org/D130225
This commit is contained in:
parent
3bba12a81e
commit
32017d5efe
@ -4845,11 +4845,8 @@ struct AAInstanceInfoImpl : public AAInstanceInfo {
|
||||
auto EquivalentUseCB = [&](const Use &OldU, const Use &NewU) {
|
||||
if (auto *SI = dyn_cast<StoreInst>(OldU.getUser())) {
|
||||
auto *Ptr = SI->getPointerOperand()->stripPointerCasts();
|
||||
if (isa<AllocaInst>(Ptr) && AA::isDynamicallyUnique(A, *this, *Ptr))
|
||||
return true;
|
||||
auto *TLI = A.getInfoCache().getTargetLibraryInfoForFunction(
|
||||
*SI->getFunction());
|
||||
if (isAllocationFn(Ptr, TLI) && AA::isDynamicallyUnique(A, *this, *Ptr))
|
||||
if ((isa<AllocaInst>(Ptr) || isNoAliasCall(Ptr)) &&
|
||||
AA::isDynamicallyUnique(A, *this, *Ptr))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user