Teach LICM and AliasSetTracker about AccessesArgumentsReadonly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118618 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-11-09 19:58:21 +00:00
parent 40b6a19daa
commit cd93f3bbb9
2 changed files with 2 additions and 2 deletions

View File

@ -124,7 +124,7 @@ void AliasSet::addCallSite(CallSite CS, AliasAnalysis &AA) {
AliasAnalysis::ModRefBehavior Behavior = AA.getModRefBehavior(CS);
if (Behavior == AliasAnalysis::DoesNotAccessMemory)
return;
else if (Behavior == AliasAnalysis::OnlyReadsMemory) {
if (AliasAnalysis::onlyReadsMemory(Behavior)) {
AliasTy = MayAlias;
AccessTy |= Refs;
return;

View File

@ -412,7 +412,7 @@ bool LICM::canSinkOrHoistInst(Instruction &I) {
AliasAnalysis::ModRefBehavior Behavior = AA->getModRefBehavior(CI);
if (Behavior == AliasAnalysis::DoesNotAccessMemory)
return true;
else if (Behavior == AliasAnalysis::OnlyReadsMemory) {
if (AliasAnalysis::onlyReadsMemory(Behavior)) {
// If this call only reads from memory and there are no writes to memory
// in the loop, we can hoist or sink the call as appropriate.
bool FoundMod = false;