mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-13 08:25:27 +00:00
Finish making AliasAnalysis aware of the fact that most atomic intrinsics only dereference their arguments, and enhance
BasicAA to make use of this fact when computing ModRef info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63718 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -256,6 +256,22 @@ bool BasicAliasAnalysis::pointsToConstantMemory(const Value *P) {
|
||||
//
|
||||
AliasAnalysis::ModRefResult
|
||||
BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
|
||||
// If the function only accesses its arguments, it suffices to check that
|
||||
// P does not alias any of those arguments.
|
||||
if (AliasAnalysis::getModRefBehavior(CS, 0) ==
|
||||
AliasAnalysis::AccessesArguments) {
|
||||
bool doesAlias = false;
|
||||
for (CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end();
|
||||
AI != AE; ++AI)
|
||||
if (alias(*AI, ~0U, P, Size) != NoAlias) {
|
||||
doesAlias = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!doesAlias)
|
||||
return NoModRef;
|
||||
}
|
||||
|
||||
if (!isa<Constant>(P)) {
|
||||
const Value *Object = P->getUnderlyingObject();
|
||||
|
||||
|
Reference in New Issue
Block a user