Teach LICM and AliasSetTracker about AccessesArgumentsReadonly.
authorDan Gohman <gohman@apple.com>
Tue, 9 Nov 2010 19:58:21 +0000 (19:58 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 9 Nov 2010 19:58:21 +0000 (19:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118618 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/AliasSetTracker.cpp
lib/Transforms/Scalar/LICM.cpp

index 7d05a9c35d93adcf8c1732ae991525f95d0da7b9..e74fbec5e1fe0251fbc6ca0d0567fb657da666ca 100644 (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;
index 7e1021725c9d8c76ec9f13451bad34b6d52f8bb4..a58468871249088791c9734137682e95cf6852fc 100644 (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;