diff --git a/llvm/test/Feature/load_extension.ll b/llvm/test/Feature/load_extension.ll --- a/llvm/test/Feature/load_extension.ll +++ b/llvm/test/Feature/load_extension.ll @@ -1,6 +1,7 @@ ; REQUIRES: x86-registered-target ; RUN: opt %s %loadbye -goodbye -wave-goodbye -disable-output -enable-new-pm=0 2>&1 | FileCheck %s ; RUN: opt %s %loadnewpmbye %loadbye -passes="goodbye" -wave-goodbye -disable-output 2>&1 | FileCheck %s +; RUN: opt %s %loadnewpmbye -passes="goodbye" -wave-goodbye -disable-output 2>&1 | FileCheck %s ; RUN: opt -module-summary %s -o %t.o ; RUN: llvm-lto2 run %t.o %loadbye -wave-goodbye -use-new-pm=0 -o %t -r %t.o,somefunk,plx -r %t.o,junk,plx 2>&1 | FileCheck %s ; RUN: llvm-lto2 run %t.o %loadbye %loadnewpmbye -wave-goodbye -use-new-pm -o %t -r %t.o,somefunk,plx -r %t.o,junk,plx 2>&1 | FileCheck %s @@ -8,6 +9,10 @@ ; REQUIRES: plugins, examples ; UNSUPPORTED: windows ; CHECK: Bye +; +; Specifying a new PM pass plugin with the old PM is an error. +; RUN: ! opt %s %loadnewpmbye -goodbye -wave-goodbye -disable-output -enable-new-pm=0 2>&1 | FileCheck %s --check-prefix=ERROR +; ERROR: load-pass-plugin specified with legacy PM. target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" diff --git a/llvm/tools/opt/NewPMDriver.h b/llvm/tools/opt/NewPMDriver.h --- a/llvm/tools/opt/NewPMDriver.h +++ b/llvm/tools/opt/NewPMDriver.h @@ -26,6 +26,7 @@ namespace llvm { class StringRef; class Module; +class PassPlugin; class TargetMachine; class ToolOutputFile; class TargetLibraryInfoImpl; @@ -69,7 +70,8 @@ TargetLibraryInfoImpl *TLII, ToolOutputFile *Out, ToolOutputFile *ThinLinkOut, ToolOutputFile *OptRemarkFile, StringRef PassPipeline, ArrayRef PassInfos, - opt_tool::OutputKind OK, opt_tool::VerifierKind VK, + ArrayRef PassPlugins, opt_tool::OutputKind OK, + opt_tool::VerifierKind VK, bool ShouldPreserveAssemblyUseListOrder, bool ShouldPreserveBitcodeUseListOrder, bool EmitSummaryIndex, bool EmitModuleHash, diff --git a/llvm/tools/opt/NewPMDriver.cpp b/llvm/tools/opt/NewPMDriver.cpp --- a/llvm/tools/opt/NewPMDriver.cpp +++ b/llvm/tools/opt/NewPMDriver.cpp @@ -66,10 +66,6 @@ DebugLogging::Verbose, "verbose", "Print extra information about adaptors and pass managers"))); -static cl::list - PassPlugins("load-pass-plugin", - cl::desc("Load passes from plugin library")); - // This flag specifies a textual description of the alias analysis pipeline to // use when querying for aliasing information. It only works in concert with // the "passes" flag above. @@ -269,6 +265,7 @@ ToolOutputFile *ThinLTOLinkOut, ToolOutputFile *OptRemarkFile, StringRef PassPipeline, ArrayRef Passes, + ArrayRef PassPlugins, OutputKind OK, VerifierKind VK, bool ShouldPreserveAssemblyUseListOrder, bool ShouldPreserveBitcodeUseListOrder, @@ -341,17 +338,9 @@ PassBuilder PB(TM, PTO, P, &PIC); registerEPCallbacks(PB); - // Load requested pass plugins and let them register pass builder callbacks - for (auto &PluginFN : PassPlugins) { - auto PassPlugin = PassPlugin::Load(PluginFN); - if (!PassPlugin) { - errs() << "Failed to load passes from '" << PluginFN - << "'. Request ignored.\n"; - continue; - } - - PassPlugin->registerPassBuilderCallbacks(PB); - } + // For any loaded plugins, let them register pass builder callbacks. + for (auto &PassPlugin : PassPlugins) + PassPlugin.registerPassBuilderCallbacks(PB); PB.registerPipelineParsingCallback( [](StringRef Name, ModulePassManager &MPM, diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -39,6 +39,7 @@ #include "llvm/LinkAllPasses.h" #include "llvm/MC/SubtargetFeature.h" #include "llvm/MC/TargetRegistry.h" +#include "llvm/Passes/PassPlugin.h" #include "llvm/Remarks/HotnessThresholdParser.h" #include "llvm/Support/Debug.h" #include "llvm/Support/FileSystem.h" @@ -300,6 +301,10 @@ cl::desc("The format used for serializing remarks (default: YAML)"), cl::value_desc("format"), cl::init("yaml")); +static cl::list + PassPlugins("load-pass-plugin", + cl::desc("Load passes from plugin library")); + namespace llvm { cl::opt PGOKindFlag("pgo-kind", cl::init(NoPGO), cl::Hidden, @@ -581,6 +586,17 @@ initializeExampleIRTransforms(Registry); #endif + SmallVector PluginList; + PassPlugins.setCallback([&](const std::string &PluginPath) { + auto Plugin = PassPlugin::Load(PluginPath); + if (!Plugin) { + errs() << "Failed to load passes from '" << PluginPath + << "'. Request ignored.\n"; + return; + } + PluginList.emplace_back(Plugin.get()); + }); + cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .bc modular optimizer and analysis printer\n"); @@ -591,6 +607,19 @@ return 1; } + // If `-passes=` is specified, use NPM. + // If `-enable-new-pm` is specified and there are no codegen passes, use NPM. + // e.g. `-enable-new-pm -sroa` will use NPM. + // but `-enable-new-pm -codegenprepare` will still revert to legacy PM. + const bool UseNPM = (EnableNewPassManager && !shouldForceLegacyPM()) || + PassPipeline.getNumOccurrences() > 0; + + if (!UseNPM && PluginList.size()) { + errs() << argv[0] << ": " << PassPlugins.ArgStr + << " specified with legacy PM.\n"; + return 1; + } + // FIXME: once the legacy PM code is deleted, move runPassPipeline() here and // construct the PassBuilder before parsing IR so we can reuse the same // PassBuilder for print passes. @@ -752,12 +781,7 @@ } } - // If `-passes=` is specified, use NPM. - // If `-enable-new-pm` is specified and there are no codegen passes, use NPM. - // e.g. `-enable-new-pm -sroa` will use NPM. - // but `-enable-new-pm -codegenprepare` will still revert to legacy PM. - if ((EnableNewPassManager && !shouldForceLegacyPM()) || - PassPipeline.getNumOccurrences() > 0) { + if (UseNPM) { if (AnalyzeOnly) { errs() << "Cannot specify -analyze under new pass manager, either " "specify '-enable-new-pm=0', or use the corresponding new pass " @@ -821,7 +845,7 @@ // layer. return runPassPipeline(argv[0], *M, TM.get(), &TLII, Out.get(), ThinLinkOut.get(), RemarksFile.get(), Pipeline, - Passes, OK, VK, PreserveAssemblyUseListOrder, + Passes, PluginList, OK, VK, PreserveAssemblyUseListOrder, PreserveBitcodeUseListOrder, EmitSummaryIndex, EmitModuleHash, EnableDebugify) ? 0 diff --git a/polly/test/CodeGen/multiple-codegens.ll b/polly/test/CodeGen/multiple-codegens.ll --- a/polly/test/CodeGen/multiple-codegens.ll +++ b/polly/test/CodeGen/multiple-codegens.ll @@ -1,6 +1,6 @@ ; RUN: opt %loadPolly -polly-scops -polly-opt-isl -polly-codegen -polly-scops -polly-codegen -S < %s | FileCheck %s -; RUN: opt %loadPolly "-passes=scop(polly-opt-isl,polly-codegen,polly-codegen)" -S < %s | FileCheck %s -; RUN: opt %loadPolly "-passes=scop(polly-opt-isl,polly-codegen),scop(polly-codegen)" -S < %s | FileCheck %s +; RUN: opt %loadNPMPolly "-passes=scop(polly-opt-isl,polly-codegen,polly-codegen)" -S < %s | FileCheck %s +; RUN: opt %loadNPMPolly "-passes=scop(polly-opt-isl,polly-codegen),scop(polly-codegen)" -S < %s | FileCheck %s ; ; llvm.org/PR34441 ; Properly handle multiple -polly-scops/-polly-codegen in the same diff --git a/polly/test/DeLICM/map_memset_zero.ll b/polly/test/DeLICM/map_memset_zero.ll --- a/polly/test/DeLICM/map_memset_zero.ll +++ b/polly/test/DeLICM/map_memset_zero.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-delicm -disable-output < %s | FileCheck -match-full-lines %s -; RUN: opt %loadPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output < %s | FileCheck -match-full-lines %s +; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output < %s | FileCheck -match-full-lines %s ; ; Check that PHI mapping works even in presence of a memset whose' ; zero value is used. diff --git a/polly/test/DeLICM/pass_existence.ll b/polly/test/DeLICM/pass_existence.ll --- a/polly/test/DeLICM/pass_existence.ll +++ b/polly/test/DeLICM/pass_existence.ll @@ -1,6 +1,6 @@ ; RUN: opt %loadPolly -polly-delicm -disable-output < %s ; RUN: opt %loadPolly -polly-print-delicm -disable-output < %s | FileCheck %s -; RUN: opt %loadPolly "-passes=scop(print)" -disable-output < %s | FileCheck %s +; RUN: opt %loadNPMPolly "-passes=scop(print)" -disable-output < %s | FileCheck %s ; ; Simple test for the existence of the DeLICM pass. ; diff --git a/polly/test/DeadCodeElimination/computeout.ll b/polly/test/DeadCodeElimination/computeout.ll --- a/polly/test/DeadCodeElimination/computeout.ll +++ b/polly/test/DeadCodeElimination/computeout.ll @@ -1,5 +1,5 @@ ; RUN: opt -S %loadPolly -basic-aa -polly-dce -polly-print-ast -disable-output < %s | FileCheck %s -; RUN: opt -S %loadPolly "-passes=scop(polly-dce,print)" < %s | FileCheck %s +; RUN: opt -S %loadNPMPolly "-passes=scop(polly-dce,print)" < %s | FileCheck %s ; RUN: opt -S %loadPolly -basic-aa -polly-dce -polly-print-ast -polly-dependences-computeout=1 -disable-output < %s | FileCheck %s -check-prefix=TIMEOUT target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" diff --git a/polly/test/DeadCodeElimination/dead_iteration_elimination.ll b/polly/test/DeadCodeElimination/dead_iteration_elimination.ll --- a/polly/test/DeadCodeElimination/dead_iteration_elimination.ll +++ b/polly/test/DeadCodeElimination/dead_iteration_elimination.ll @@ -1,5 +1,5 @@ ; RUN: opt -S %loadPolly -basic-aa -polly-dependences-analysis-type=value-based -polly-dce -polly-dce-precise-steps=2 -polly-print-ast -disable-output < %s | FileCheck %s -; RUN: opt -S %loadPolly "-passes=scop(polly-dce,print)" -polly-dependences-analysis-type=value-based -polly-dce-precise-steps=2 < %s | FileCheck %s +; RUN: opt -S %loadNPMPolly "-passes=scop(polly-dce,print)" -polly-dependences-analysis-type=value-based -polly-dce-precise-steps=2 < %s | FileCheck %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" ; ; for(i = 0; i < 200; i++ ) diff --git a/polly/test/ForwardOpTree/forward_load.ll b/polly/test/ForwardOpTree/forward_load.ll --- a/polly/test/ForwardOpTree/forward_load.ll +++ b/polly/test/ForwardOpTree/forward_load.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-print-optree -disable-output < %s | FileCheck %s -match-full-lines -; RUN: opt %loadPolly "-passes=scop(print)" -disable-output < %s | FileCheck %s -match-full-lines +; RUN: opt %loadNPMPolly "-passes=scop(print)" -disable-output < %s | FileCheck %s -match-full-lines ; ; Rematerialize a load. ; diff --git a/polly/test/PruneUnprofitable/prune_only_scalardeps.ll b/polly/test/PruneUnprofitable/prune_only_scalardeps.ll --- a/polly/test/PruneUnprofitable/prune_only_scalardeps.ll +++ b/polly/test/PruneUnprofitable/prune_only_scalardeps.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-process-unprofitable=false -polly-unprofitable-scalar-accs=false -polly-prune-unprofitable -disable-output -stats < %s 2>&1 | FileCheck -match-full-lines %s -; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-process-unprofitable=false -polly-unprofitable-scalar-accs=false "-passes=scop(polly-prune-unprofitable)" -disable-output -stats < %s 2>&1 | FileCheck -match-full-lines %s +; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb -polly-process-unprofitable=false -polly-unprofitable-scalar-accs=false "-passes=scop(polly-prune-unprofitable)" -disable-output -stats < %s 2>&1 | FileCheck -match-full-lines %s ; REQUIRES: asserts ; ; Skip this SCoP for having scalar dependencies between all statements, diff --git a/polly/test/ScheduleOptimizer/computeout.ll b/polly/test/ScheduleOptimizer/computeout.ll --- a/polly/test/ScheduleOptimizer/computeout.ll +++ b/polly/test/ScheduleOptimizer/computeout.ll @@ -1,7 +1,7 @@ ; RUN: opt -S %loadPolly -basic-aa -polly-opt-isl -polly-isl-arg=--no-schedule-serialize-sccs -polly-print-ast -disable-output < %s | FileCheck %s -; RUN: opt -S %loadPolly "-passes=scop(polly-opt-isl,print)" -polly-isl-arg=--no-schedule-serialize-sccs -disable-output < %s | FileCheck %s +; RUN: opt -S %loadNPMPolly "-passes=scop(polly-opt-isl,print)" -polly-isl-arg=--no-schedule-serialize-sccs -disable-output < %s | FileCheck %s ; RUN: opt -S %loadPolly -basic-aa -polly-opt-isl -polly-isl-arg=--schedule-serialize-sccs -polly-dependences-computeout=1 -polly-print-ast -disable-output < %s | FileCheck %s -check-prefix=TIMEOUT -; RUN: opt -S %loadPolly "-passes=scop(polly-opt-isl,print)" -polly-isl-arg=--no-schedule-serialize-sccs -polly-dependences-computeout=1 -disable-output < %s | FileCheck %s -check-prefix=TIMEOUT +; RUN: opt -S %loadNPMPolly "-passes=scop(polly-opt-isl,print)" -polly-isl-arg=--no-schedule-serialize-sccs -polly-dependences-computeout=1 -disable-output < %s | FileCheck %s -check-prefix=TIMEOUT target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" ; for(i = 0; i < 100; i++ ) diff --git a/polly/test/ScheduleOptimizer/focaltech_test_detail_threshold-7bc17e.ll b/polly/test/ScheduleOptimizer/focaltech_test_detail_threshold-7bc17e.ll --- a/polly/test/ScheduleOptimizer/focaltech_test_detail_threshold-7bc17e.ll +++ b/polly/test/ScheduleOptimizer/focaltech_test_detail_threshold-7bc17e.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-vectorizer=stripmine -polly-invariant-load-hoisting -polly-optimized-scops -polly-print-opt-isl -disable-output < %s | FileCheck %s -; RUN: opt %loadPolly "-passes=scop(print)" -polly-vectorizer=stripmine -polly-invariant-load-hoisting -disable-output < %s | FileCheck %s +; RUN: opt %loadNPMPolly "-passes=scop(print)" -polly-vectorizer=stripmine -polly-invariant-load-hoisting -disable-output < %s | FileCheck %s ; ; llvm.org/PR46578 ; diff --git a/polly/test/Simplify/dead_access_load.ll b/polly/test/Simplify/dead_access_load.ll --- a/polly/test/Simplify/dead_access_load.ll +++ b/polly/test/Simplify/dead_access_load.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-simplify -disable-output < %s | FileCheck %s -match-full-lines -; RUN: opt %loadPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines +; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines ; ; Remove a dead load-instruction ; (an load whose result is not used anywhere) diff --git a/polly/test/Simplify/dead_access_phi.ll b/polly/test/Simplify/dead_access_phi.ll --- a/polly/test/Simplify/dead_access_phi.ll +++ b/polly/test/Simplify/dead_access_phi.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-simplify -disable-output < %s | FileCheck %s -match-full-lines -; RUN: opt %loadPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines +; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines ; ; Remove a dead PHI write/read pair ; (accesses that are effectively not used) diff --git a/polly/test/Simplify/dead_access_value.ll b/polly/test/Simplify/dead_access_value.ll --- a/polly/test/Simplify/dead_access_value.ll +++ b/polly/test/Simplify/dead_access_value.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-simplify -disable-output < %s | FileCheck %s -match-full-lines -; RUN: opt %loadPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines +; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines ; ; Remove a dead value write/read pair ; (accesses that are effectively not used) diff --git a/polly/test/Simplify/dead_instruction.ll b/polly/test/Simplify/dead_instruction.ll --- a/polly/test/Simplify/dead_instruction.ll +++ b/polly/test/Simplify/dead_instruction.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-simplify -disable-output < %s | FileCheck %s -match-full-lines -; RUN: opt %loadPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines +; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines ; ; Remove a dead instruction ; (an instruction whose result is not used anywhere) diff --git a/polly/test/Simplify/notdead_region_exitphi.ll b/polly/test/Simplify/notdead_region_exitphi.ll --- a/polly/test/Simplify/notdead_region_exitphi.ll +++ b/polly/test/Simplify/notdead_region_exitphi.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-print-simplify -disable-output < %s | FileCheck %s -match-full-lines -; RUN: opt %loadPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines +; RUN: opt %loadNPMPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines ; ; Do not remove dependencies of a phi node in a region's exit block. ; diff --git a/polly/test/Simplify/notdead_region_innerphi.ll b/polly/test/Simplify/notdead_region_innerphi.ll --- a/polly/test/Simplify/notdead_region_innerphi.ll +++ b/polly/test/Simplify/notdead_region_innerphi.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-print-simplify -disable-output < %s | FileCheck %s -match-full-lines -; RUN: opt %loadPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines +; RUN: opt %loadNPMPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines ; ; Do not remove dependencies of a phi node within a region statement (%phi). ; diff --git a/polly/test/Simplify/notredundant_region_middle.ll b/polly/test/Simplify/notredundant_region_middle.ll --- a/polly/test/Simplify/notredundant_region_middle.ll +++ b/polly/test/Simplify/notredundant_region_middle.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-print-simplify -disable-output < %s | FileCheck %s -match-full-lines -; RUN: opt %loadPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines +; RUN: opt %loadNPMPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines ; ; Do not remove redundant stores in the middle of region statements. ; The store in region_true could be removed, but in practice we do try to diff --git a/polly/test/Simplify/notredundant_synthesizable_unknownit.ll b/polly/test/Simplify/notredundant_synthesizable_unknownit.ll --- a/polly/test/Simplify/notredundant_synthesizable_unknownit.ll +++ b/polly/test/Simplify/notredundant_synthesizable_unknownit.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-simplify -disable-output < %s | FileCheck %s -match-full-lines -; RUN: opt %loadPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines +; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines ; ; Do not remove the scalar value write of %i.trunc in inner.for. ; It is used by body. diff --git a/polly/test/Simplify/overwritten.ll b/polly/test/Simplify/overwritten.ll --- a/polly/test/Simplify/overwritten.ll +++ b/polly/test/Simplify/overwritten.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-simplify -disable-output < %s | FileCheck -match-full-lines %s -; RUN: opt %loadPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck -match-full-lines %s +; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck -match-full-lines %s ; ; Remove a store that is overwritten by another store in the same statement. ; diff --git a/polly/test/Simplify/overwritten_3store.ll b/polly/test/Simplify/overwritten_3store.ll --- a/polly/test/Simplify/overwritten_3store.ll +++ b/polly/test/Simplify/overwritten_3store.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-simplify -disable-output < %s | FileCheck -match-full-lines %s -; RUN: opt %loadPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck -match-full-lines %s +; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck -match-full-lines %s ; ; Remove a store that is overwritten by another store in the same statement. ; Check that even multiple stores are removed. diff --git a/polly/test/Simplify/overwritten_loadbetween.ll b/polly/test/Simplify/overwritten_loadbetween.ll --- a/polly/test/Simplify/overwritten_loadbetween.ll +++ b/polly/test/Simplify/overwritten_loadbetween.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-print-simplify -disable-output < %s | FileCheck -match-full-lines %s -; RUN: opt %loadPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck -match-full-lines %s +; RUN: opt %loadNPMPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck -match-full-lines %s ; ; Do not remove overwrites when the value is read before. ; diff --git a/polly/test/Simplify/pass_existence.ll b/polly/test/Simplify/pass_existence.ll --- a/polly/test/Simplify/pass_existence.ll +++ b/polly/test/Simplify/pass_existence.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-print-simplify -disable-output < %s | FileCheck %s -; RUN: opt %loadPolly -disable-output "-passes=scop(print)" < %s -aa-pipeline=basic-aa < %s | FileCheck %s +; RUN: opt %loadNPMPolly -disable-output "-passes=scop(print)" < %s -aa-pipeline=basic-aa < %s | FileCheck %s ; ; Simple test for the existence of the Simplify pass. ; diff --git a/polly/test/Simplify/phi_in_regionstmt.ll b/polly/test/Simplify/phi_in_regionstmt.ll --- a/polly/test/Simplify/phi_in_regionstmt.ll +++ b/polly/test/Simplify/phi_in_regionstmt.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-print-simplify -disable-output < %s | FileCheck %s -match-full-lines -; RUN: opt %loadPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines +; RUN: opt %loadNPMPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines ; ; The PHINode %cond91.sink.sink.us.sink.6 is in the middle of a region ; statement. diff --git a/polly/test/Simplify/redundant.ll b/polly/test/Simplify/redundant.ll --- a/polly/test/Simplify/redundant.ll +++ b/polly/test/Simplify/redundant.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-print-simplify -disable-output < %s | FileCheck %s -match-full-lines -; RUN: opt %loadPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines +; RUN: opt %loadNPMPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines ; ; Remove redundant store (a store that writes the same value already ; at the destination) diff --git a/polly/test/Simplify/redundant_differentindex.ll b/polly/test/Simplify/redundant_differentindex.ll --- a/polly/test/Simplify/redundant_differentindex.ll +++ b/polly/test/Simplify/redundant_differentindex.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-print-simplify -disable-output < %s | FileCheck %s -match-full-lines -; RUN: opt %loadPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines +; RUN: opt %loadNPMPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines ; ; A store that has a different index than the load it is storing is ; not redundant. diff --git a/polly/test/Simplify/redundant_storebetween.ll b/polly/test/Simplify/redundant_storebetween.ll --- a/polly/test/Simplify/redundant_storebetween.ll +++ b/polly/test/Simplify/redundant_storebetween.ll @@ -1,5 +1,5 @@ ; RUN: opt %loadPolly -polly-print-simplify -disable-output < %s | FileCheck %s -match-full-lines -; RUN: opt %loadPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines +; RUN: opt %loadNPMPolly "-passes=scop(print)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines ; ; Don't remove store where there is another store to the same target ; in-between them. diff --git a/polly/test/Support/Plugins.ll b/polly/test/Support/Plugins.ll --- a/polly/test/Support/Plugins.ll +++ b/polly/test/Support/Plugins.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -passes='polly-prepare,scop(print)' -S < %s \ +; RUN: opt %loadNPMPolly -passes='polly-prepare,scop(print)' -S < %s \ ; RUN: | FileCheck %s ; This testcase tests plugin registration. Check-lines below serve to verify diff --git a/polly/test/Support/defaultpipelines.ll b/polly/test/Support/defaultpipelines.ll --- a/polly/test/Support/defaultpipelines.ll +++ b/polly/test/Support/defaultpipelines.ll @@ -7,12 +7,12 @@ ; RUN: opt %loadPolly -enable-new-pm=0 -polly -Oz -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=OFF ; ; New pass manager -; RUN: opt %loadPolly -enable-new-pm=1 -polly -O0 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=OFF -; RUN: opt %loadPolly -enable-new-pm=1 -polly -O1 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ON -; RUN: opt %loadPolly -enable-new-pm=1 -polly -O2 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ON -; RUN: opt %loadPolly -enable-new-pm=1 -polly -O3 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ON -; RUN: opt %loadPolly -enable-new-pm=1 -polly -Os -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=OFF -; RUN: opt %loadPolly -enable-new-pm=1 -polly -Oz -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=OFF +; RUN: opt %loadNPMPolly -enable-new-pm=1 -polly -O0 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=OFF +; RUN: opt %loadNPMPolly -enable-new-pm=1 -polly -O1 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ON +; RUN: opt %loadNPMPolly -enable-new-pm=1 -polly -O2 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ON +; RUN: opt %loadNPMPolly -enable-new-pm=1 -polly -O3 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ON +; RUN: opt %loadNPMPolly -enable-new-pm=1 -polly -Os -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=OFF +; RUN: opt %loadNPMPolly -enable-new-pm=1 -polly -Oz -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=OFF ; ; Check that Polly's default pipeline works from detection to code generation ; with either pass manager. diff --git a/polly/test/Support/pipelineposition.ll b/polly/test/Support/pipelineposition.ll --- a/polly/test/Support/pipelineposition.ll +++ b/polly/test/Support/pipelineposition.ll @@ -5,9 +5,9 @@ ; RUN: opt %loadPolly -O3 -enable-new-pm=0 -polly -polly-position=before-vectorizer -disable-output -debug-only=polly-scops < %s 2>&1 | FileCheck %s --check-prefix=INLINED3 ; ; New pass manager -; RUN: opt %loadPolly -O3 -enable-new-pm=1 -polly -polly-position=early -disable-output -debug-only=polly-scops < %s 2>&1 | FileCheck %s --check-prefix=NOINLINE -; RUN: opt %loadPolly -O3 -enable-new-pm=1 -polly -polly-position=early -polly-run-inliner -disable-output -debug-only=polly-scops < %s 2>&1 | FileCheck %s --check-prefix=INLINED1 -; RUN: opt %loadPolly -O3 -enable-new-pm=1 -polly -polly-position=before-vectorizer -disable-output -debug-only=polly-scops < %s 2>&1 | FileCheck %s --check-prefix=INLINED3 +; RUN: opt %loadNPMPolly -O3 -enable-new-pm=1 -polly -polly-position=early -disable-output -debug-only=polly-scops < %s 2>&1 | FileCheck %s --check-prefix=NOINLINE +; RUN: opt %loadNPMPolly -O3 -enable-new-pm=1 -polly -polly-position=early -polly-run-inliner -disable-output -debug-only=polly-scops < %s 2>&1 | FileCheck %s --check-prefix=INLINED1 +; RUN: opt %loadNPMPolly -O3 -enable-new-pm=1 -polly -polly-position=before-vectorizer -disable-output -debug-only=polly-scops < %s 2>&1 | FileCheck %s --check-prefix=INLINED3 ; ; REQUIRES: asserts ; diff --git a/polly/test/lit.site.cfg.in b/polly/test/lit.site.cfg.in --- a/polly/test/lit.site.cfg.in +++ b/polly/test/lit.site.cfg.in @@ -26,6 +26,11 @@ # directories. config.excludes = ['Inputs'] +commonOpts = ' -polly-process-unprofitable ' \ + + ' -polly-remarks-minimal ' \ + + ' -polly-use-llvm-names ' \ + + ' -polly-import-jscop-dir=%S ' \ + + ' -polly-codegen-verify ' if config.llvm_polly_link_into_tools == '' or \ config.llvm_polly_link_into_tools.lower() == '0' or \ config.llvm_polly_link_into_tools.lower() == 'n' or \ @@ -36,22 +41,14 @@ config.llvm_polly_link_into_tools.lower() == 'llvm_polly_link_into_tools-notfound': config.substitutions.append(('%loadPolly', '-load ' + config.polly_lib_dir + '/LLVMPolly@LLVM_SHLIBEXT@' - + ' -load-pass-plugin ' + + commonOpts )) + config.substitutions.append(('%loadNPMPolly', '-load-pass-plugin ' + config.polly_lib_dir + '/LLVMPolly@LLVM_SHLIBEXT@' - + ' -polly-process-unprofitable ' - + ' -polly-remarks-minimal ' - + ' -polly-use-llvm-names ' - + ' -polly-import-jscop-dir=%S ' - + ' -polly-codegen-verify ' - )) + + commonOpts )) else: - config.substitutions.append(('%loadPolly', '' - + ' -polly-process-unprofitable ' - + ' -polly-remarks-minimal ' - + ' -polly-use-llvm-names ' - + ' -polly-import-jscop-dir=%S ' - + ' -polly-codegen-verify ' - )) + config.substitutions.append(('%loadPolly', commonOpts )) + config.substitutions.append(('%loadNPMPolly', commonOpts )) + if config.enable_gpgpu_codegen == 'TRUE' : config.available_features.add('pollyacc')