Index: llvm/test/Feature/load_extension.ll =================================================================== --- llvm/test/Feature/load_extension.ll +++ 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" Index: llvm/tools/opt/NewPMDriver.h =================================================================== --- llvm/tools/opt/NewPMDriver.h +++ 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, Index: llvm/tools/opt/NewPMDriver.cpp =================================================================== --- llvm/tools/opt/NewPMDriver.cpp +++ 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, Index: llvm/tools/opt/opt.cpp =================================================================== --- llvm/tools/opt/opt.cpp +++ 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 Index: polly/test/CodeGen/multiple-codegens.ll =================================================================== --- polly/test/CodeGen/multiple-codegens.ll +++ 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 Index: polly/test/DeLICM/map_memset_zero.ll =================================================================== --- polly/test/DeLICM/map_memset_zero.ll +++ 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. Index: polly/test/DeLICM/pass_existence.ll =================================================================== --- polly/test/DeLICM/pass_existence.ll +++ 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. ; Index: polly/test/DeadCodeElimination/computeout.ll =================================================================== --- polly/test/DeadCodeElimination/computeout.ll +++ 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" Index: polly/test/DeadCodeElimination/dead_iteration_elimination.ll =================================================================== --- polly/test/DeadCodeElimination/dead_iteration_elimination.ll +++ 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++ ) Index: polly/test/ForwardOpTree/forward_load.ll =================================================================== --- polly/test/ForwardOpTree/forward_load.ll +++ 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. ; Index: polly/test/PruneUnprofitable/prune_only_scalardeps.ll =================================================================== --- polly/test/PruneUnprofitable/prune_only_scalardeps.ll +++ 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, Index: polly/test/ScheduleOptimizer/computeout.ll =================================================================== --- polly/test/ScheduleOptimizer/computeout.ll +++ 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++ ) Index: polly/test/ScheduleOptimizer/focaltech_test_detail_threshold-7bc17e.ll =================================================================== --- polly/test/ScheduleOptimizer/focaltech_test_detail_threshold-7bc17e.ll +++ 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 ; Index: polly/test/Simplify/dead_access_load.ll =================================================================== --- polly/test/Simplify/dead_access_load.ll +++ 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) Index: polly/test/Simplify/dead_access_phi.ll =================================================================== --- polly/test/Simplify/dead_access_phi.ll +++ 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) Index: polly/test/Simplify/dead_access_value.ll =================================================================== --- polly/test/Simplify/dead_access_value.ll +++ 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) Index: polly/test/Simplify/dead_instruction.ll =================================================================== --- polly/test/Simplify/dead_instruction.ll +++ 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) Index: polly/test/Simplify/notdead_region_exitphi.ll =================================================================== --- polly/test/Simplify/notdead_region_exitphi.ll +++ 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. ; Index: polly/test/Simplify/notdead_region_innerphi.ll =================================================================== --- polly/test/Simplify/notdead_region_innerphi.ll +++ 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). ; Index: polly/test/Simplify/notredundant_region_middle.ll =================================================================== --- polly/test/Simplify/notredundant_region_middle.ll +++ 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 Index: polly/test/Simplify/notredundant_synthesizable_unknownit.ll =================================================================== --- polly/test/Simplify/notredundant_synthesizable_unknownit.ll +++ 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. Index: polly/test/Simplify/overwritten.ll =================================================================== --- polly/test/Simplify/overwritten.ll +++ 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. ; Index: polly/test/Simplify/overwritten_3store.ll =================================================================== --- polly/test/Simplify/overwritten_3store.ll +++ 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. Index: polly/test/Simplify/overwritten_loadbetween.ll =================================================================== --- polly/test/Simplify/overwritten_loadbetween.ll +++ 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. ; Index: polly/test/Simplify/pass_existence.ll =================================================================== --- polly/test/Simplify/pass_existence.ll +++ 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. ; Index: polly/test/Simplify/phi_in_regionstmt.ll =================================================================== --- polly/test/Simplify/phi_in_regionstmt.ll +++ 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. Index: polly/test/Simplify/redundant.ll =================================================================== --- polly/test/Simplify/redundant.ll +++ 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) Index: polly/test/Simplify/redundant_differentindex.ll =================================================================== --- polly/test/Simplify/redundant_differentindex.ll +++ 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. Index: polly/test/Simplify/redundant_storebetween.ll =================================================================== --- polly/test/Simplify/redundant_storebetween.ll +++ 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. Index: polly/test/Support/Plugins.ll =================================================================== --- polly/test/Support/Plugins.ll +++ 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 Index: polly/test/Support/defaultpipelines.ll =================================================================== --- polly/test/Support/defaultpipelines.ll +++ 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. Index: polly/test/Support/pipelineposition.ll =================================================================== --- polly/test/Support/pipelineposition.ll +++ 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 ; Index: polly/test/lit.site.cfg.in =================================================================== --- polly/test/lit.site.cfg.in +++ 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')