[llvm] e597116 - [NPM] Add implicit basic-aa before other AA

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 13:48:40 PST 2020


Author: Arthur Eubanks
Date: 2020-11-18T13:48:24-08:00
New Revision: e597116f055d2e82d9179f6edcb49dd015c514c2

URL: https://github.com/llvm/llvm-project/commit/e597116f055d2e82d9179f6edcb49dd015c514c2
DIFF: https://github.com/llvm/llvm-project/commit/e597116f055d2e82d9179f6edcb49dd015c514c2.diff

LOG: [NPM] Add implicit basic-aa before other AA

This matches the legacy AA infra and fixes
llvm/test/ANalysis/TypeBasedAliasAnalysis/precedence.ll under NPM.

Added: 
    

Modified: 
    llvm/tools/opt/NewPMDriver.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/opt/NewPMDriver.cpp b/llvm/tools/opt/NewPMDriver.cpp
index 6d134afc96c3..224a3242eb17 100644
--- a/llvm/tools/opt/NewPMDriver.cpp
+++ b/llvm/tools/opt/NewPMDriver.cpp
@@ -333,16 +333,7 @@ bool llvm::runPassPipeline(StringRef Arg0, Module &M, TargetMachine *TM,
       return false;
     }
   }
-  // For compatibility with legacy pass manager.
-  // Alias analyses are not specially specified when using the legacy PM.
-  for (auto PassName : Passes) {
-    if (PB.isAAPassName(PassName)) {
-      if (auto Err = PB.parseAAPipeline(AA, PassName)) {
-        errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";
-        return false;
-      }
-    }
-  }
+
   // For compatibility with the legacy PM AA pipeline.
   // AAResultsWrapperPass by default provides basic-aa in the legacy PM
   // unless -disable-basic-aa is specified.
@@ -355,6 +346,17 @@ bool llvm::runPassPipeline(StringRef Arg0, Module &M, TargetMachine *TM,
     }
   }
 
+  // For compatibility with legacy pass manager.
+  // Alias analyses are not specially specified when using the legacy PM.
+  for (auto PassName : Passes) {
+    if (PB.isAAPassName(PassName)) {
+      if (auto Err = PB.parseAAPipeline(AA, PassName)) {
+        errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";
+        return false;
+      }
+    }
+  }
+
   LoopAnalysisManager LAM(DebugPM);
   FunctionAnalysisManager FAM(DebugPM);
   CGSCCAnalysisManager CGAM(DebugPM);


        


More information about the llvm-commits mailing list