[PATCH] D86167: [opt][NewPM] Add basic-aa in legacy PM compatibility mode
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 18 13:12:47 PDT 2020
aeubanks created this revision.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
aeubanks requested review of this revision.
The legacy PM alias analysis pipeline by default includes basic-aa.
When running `opt -foo-pass` under the NPM and -disable-basic-aa is not
specified, use basic-aa.
This decreases the number of check-llvm failures under NPM from 913 to 752.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D86167
Files:
llvm/lib/Analysis/AliasAnalysis.cpp
llvm/test/Transforms/SLPVectorizer/X86/limit.ll
llvm/tools/opt/NewPMDriver.cpp
Index: llvm/tools/opt/NewPMDriver.cpp
===================================================================
--- llvm/tools/opt/NewPMDriver.cpp
+++ llvm/tools/opt/NewPMDriver.cpp
@@ -109,6 +109,7 @@
extern cl::opt<std::string> ProfileFile;
extern cl::opt<CSPGOKind> CSPGOKindFlag;
extern cl::opt<std::string> CSProfileGenFile;
+extern cl::opt<bool> DisableBasicAA;
static cl::opt<std::string>
ProfileRemappingFile("profile-remapping-file",
@@ -346,6 +347,15 @@
NonAAPasses.push_back(PassName);
}
}
+ // For compatibility with legacy pass manager.
+ // basic-aa was always available in the legacy pass manager,
+ // unless -disable-basic-aa was specified.
+ if (!Passes.empty() && !DisableBasicAA) {
+ if (auto Err = PB.parseAAPipeline(AA, "basic-aa")) {
+ errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";
+ return false;
+ }
+ }
LoopAnalysisManager LAM(DebugPM);
FunctionAnalysisManager FAM(DebugPM);
Index: llvm/test/Transforms/SLPVectorizer/X86/limit.ll
===================================================================
--- llvm/test/Transforms/SLPVectorizer/X86/limit.ll
+++ llvm/test/Transforms/SLPVectorizer/X86/limit.ll
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -slp-vectorizer -S | FileCheck %s
+; RUN: opt < %s -slp-vectorizer -enable-new-pm -S | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
Index: llvm/lib/Analysis/AliasAnalysis.cpp
===================================================================
--- llvm/lib/Analysis/AliasAnalysis.cpp
+++ llvm/lib/Analysis/AliasAnalysis.cpp
@@ -58,8 +58,7 @@
/// Allow disabling BasicAA from the AA results. This is particularly useful
/// when testing to isolate a single AA implementation.
-static cl::opt<bool> DisableBasicAA("disable-basic-aa", cl::Hidden,
- cl::init(false));
+cl::opt<bool> DisableBasicAA("disable-basic-aa", cl::Hidden, cl::init(false));
AAResults::AAResults(AAResults &&Arg)
: TLI(Arg.TLI), AAs(std::move(Arg.AAs)), AADeps(std::move(Arg.AADeps)) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86167.286382.patch
Type: text/x-patch
Size: 2175 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200818/2b9aadad/attachment.bin>
More information about the llvm-commits
mailing list