[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
Fri Aug 21 14:05:23 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGb79889c2b143: [opt][NewPM] Add basic-aa in legacy PM compatibility mode (authored by aeubanks).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86167/new/

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,17 @@
       NonAAPasses.push_back(PassName);
     }
   }
+  // For compatibility with the legacy PM AA pipeline.
+  // AAResultsWrapperPass by default provides basic-aa in the legacy PM
+  // unless -disable-basic-aa is specified.
+  // TODO: remove this once tests implicitly requiring basic-aa use -passes= and
+  // -aa-pipeline=basic-aa.
+  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.287103.patch
Type: text/x-patch
Size: 2300 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200821/7cd2c7f7/attachment.bin>


More information about the llvm-commits mailing list