Index: include/polly/MaximalStaticExpansion.h =================================================================== --- /dev/null +++ include/polly/MaximalStaticExpansion.h @@ -0,0 +1,24 @@ +//===- polly/MaximalStaticExpander.h - Expand fully all memory accesses.-*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===------------------------------------------------------------------------------===// + +#ifndef POLLY_MSE_H +#define POLLY_MSE_H + +#include "polly/ScopPass.h" +#include "llvm/IR/PassManager.h" + +namespace polly { +struct MaximalStaticExpandPass + : public llvm::PassInfoMixin { + llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &, + ScopStandardAnalysisResults &, SPMUpdater &); +}; +} // namespace polly + +#endif /* POLLY_MSE_H */ Index: lib/Support/PollyPasses.def =================================================================== --- lib/Support/PollyPasses.def +++ lib/Support/PollyPasses.def @@ -25,6 +25,7 @@ #endif SCOP_PASS("polly-export-jscop", JSONExportPass()) SCOP_PASS("polly-import-jscop", JSONImportPass()) +SCOP_PASS("polly-mse", MaximalStaticExpandPass()) SCOP_PASS("print", IslAstPrinterPass(outs())) SCOP_PASS("print", DependenceInfoPrinterPass(outs())) SCOP_PASS("polly-codegen", CodeGenerationPass()) Index: lib/Support/RegisterPasses.cpp =================================================================== --- lib/Support/RegisterPasses.cpp +++ lib/Support/RegisterPasses.cpp @@ -32,6 +32,7 @@ #include "polly/ForwardOpTree.h" #include "polly/JSONExporter.h" #include "polly/LinkAllPasses.h" +#include "polly/MaximalStaticExpansion.h" #include "polly/Options.h" #include "polly/PolyhedralInfo.h" #include "polly/ScopDetection.h" @@ -479,6 +480,8 @@ if (ImportJScop) SPM.addPass(JSONImportPass()); assert(!DeadCodeElim && "This option is not implemented"); + if (FullyIndexedStaticExpansion) + SPM.addPass(MaximalStaticExpandPass()); assert(!EnablePruneUnprofitable && "This option is not implemented"); if (Target == TARGET_CPU || Target == TARGET_HYBRID) switch (Optimizer) { Index: lib/Transform/MaximalStaticExpansion.cpp =================================================================== --- lib/Transform/MaximalStaticExpansion.cpp +++ lib/Transform/MaximalStaticExpansion.cpp @@ -12,6 +12,7 @@ // //===----------------------------------------------------------------------===// +#include "polly/MaximalStaticExpansion.h" #include "polly/DependenceInfo.h" #include "polly/FlattenAlgo.h" #include "polly/LinkAllPasses.h" @@ -459,6 +460,19 @@ return new MaximalStaticExpander(); } +PreservedAnalyses MaximalStaticExpandPass::run(Scop &S, + ScopAnalysisManager &SAM, + ScopStandardAnalysisResults &SAR, + SPMUpdater &) { + + // Invalidate all analyses on Scop. + PreservedAnalyses PA; + PA.preserveSet>(); + PA.preserveSet>(); + PA.preserveSet>(); + return PA; +} + INITIALIZE_PASS_BEGIN(MaximalStaticExpander, "polly-mse", "Polly - Maximal static expansion of SCoP", false, false); INITIALIZE_PASS_DEPENDENCY(DependenceInfo);