mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Rename PointsToLocalMemory to PointsToLocalOrConstantMemory to make
the code more self-documenting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118171 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cdfad36b40
commit
391f5bce04
@ -65,7 +65,7 @@ namespace {
|
|||||||
CallGraphSCCPass::getAnalysisUsage(AU);
|
CallGraphSCCPass::getAnalysisUsage(AU);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PointsToLocalMemory(Value *V);
|
bool PointsToLocalOrConstantMemory(Value *V);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,10 +79,10 @@ INITIALIZE_PASS_END(FunctionAttrs, "functionattrs",
|
|||||||
Pass *llvm::createFunctionAttrsPass() { return new FunctionAttrs(); }
|
Pass *llvm::createFunctionAttrsPass() { return new FunctionAttrs(); }
|
||||||
|
|
||||||
|
|
||||||
/// PointsToLocalMemory - Returns whether the given pointer value points to
|
/// PointsToLocalOrConstantMemory - Returns whether the given pointer value
|
||||||
/// memory that is local to the function. Global constants are considered
|
/// points to memory that is local to the function, with global constants being
|
||||||
/// local to all functions.
|
/// considered local to all functions.
|
||||||
bool FunctionAttrs::PointsToLocalMemory(Value *V) {
|
bool FunctionAttrs::PointsToLocalOrConstantMemory(Value *V) {
|
||||||
SmallVector<Value*, 16> Worklist;
|
SmallVector<Value*, 16> Worklist;
|
||||||
unsigned MaxLookup = 8;
|
unsigned MaxLookup = 8;
|
||||||
|
|
||||||
@ -179,7 +179,8 @@ bool FunctionAttrs::AddReadAttrs(const CallGraphSCC &SCC) {
|
|||||||
for (CallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end();
|
for (CallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end();
|
||||||
CI != CE; ++CI) {
|
CI != CE; ++CI) {
|
||||||
Value *Arg = *CI;
|
Value *Arg = *CI;
|
||||||
if (Arg->getType()->isPointerTy() && !PointsToLocalMemory(Arg))
|
if (Arg->getType()->isPointerTy() &&
|
||||||
|
!PointsToLocalOrConstantMemory(Arg))
|
||||||
// Writes memory. Just give up.
|
// Writes memory. Just give up.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -188,11 +189,13 @@ bool FunctionAttrs::AddReadAttrs(const CallGraphSCC &SCC) {
|
|||||||
}
|
}
|
||||||
} else if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
|
} else if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
|
||||||
// Ignore non-volatile loads from local memory.
|
// Ignore non-volatile loads from local memory.
|
||||||
if (!LI->isVolatile() && PointsToLocalMemory(LI->getPointerOperand()))
|
if (!LI->isVolatile() &&
|
||||||
|
PointsToLocalOrConstantMemory(LI->getPointerOperand()))
|
||||||
continue;
|
continue;
|
||||||
} else if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
|
} else if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
|
||||||
// Ignore non-volatile stores to local memory.
|
// Ignore non-volatile stores to local memory.
|
||||||
if (!SI->isVolatile() && PointsToLocalMemory(SI->getPointerOperand()))
|
if (!SI->isVolatile() &&
|
||||||
|
PointsToLocalOrConstantMemory(SI->getPointerOperand()))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user