[llvm] 3f69b21 - [NewPM][opt] Fix -globals-aa not being recognized as alias analysis in NPM
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 15 11:18:34 PDT 2020
Author: Arthur Eubanks
Date: 2020-09-15T11:18:19-07:00
New Revision: 3f69b2140f55ace97c3b7819eb9c19fc682da998
URL: https://github.com/llvm/llvm-project/commit/3f69b2140f55ace97c3b7819eb9c19fc682da998
DIFF: https://github.com/llvm/llvm-project/commit/3f69b2140f55ace97c3b7819eb9c19fc682da998.diff
LOG: [NewPM][opt] Fix -globals-aa not being recognized as alias analysis in NPM
Was missing MODULE_ALIAS_ANALYSIS, previously only FUNCTION_ALIAS_ANALYSIS was taken into account.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D87664
Added:
Modified:
llvm/lib/Passes/PassBuilder.cpp
llvm/test/Analysis/GlobalsModRef/comdat-ipo.ll
Removed:
################################################################################
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index cd64aecd81d7..03b31c233361 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -2787,6 +2787,9 @@ Error PassBuilder::parseAAPipeline(AAManager &AA, StringRef PipelineText) {
}
bool PassBuilder::isAAPassName(StringRef PassName) {
+#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
+ if (PassName == NAME) \
+ return true;
#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
if (PassName == NAME) \
return true;
diff --git a/llvm/test/Analysis/GlobalsModRef/comdat-ipo.ll b/llvm/test/Analysis/GlobalsModRef/comdat-ipo.ll
index f251e01ca69c..aeeebfd3aede 100644
--- a/llvm/test/Analysis/GlobalsModRef/comdat-ipo.ll
+++ b/llvm/test/Analysis/GlobalsModRef/comdat-ipo.ll
@@ -1,4 +1,5 @@
-; RUN: opt < %s -basic-aa -globals-aa -gvn -S | FileCheck %s
+; RUN: opt < %s -basic-aa -globals-aa -gvn -enable-new-pm=0 -S | FileCheck %s
+; RUN: opt < %s -basic-aa -globals-aa -gvn -enable-new-pm=1 -S | FileCheck %s
; See PR26774
More information about the llvm-commits
mailing list