#include "polly/MaximalStaticExpansion.h"
#include "polly/DependenceInfo.h"
#include "polly/LinkAllPasses.h"
#include "polly/ScopInfo.h"
#include "polly/ScopPass.h"
#include "polly/Support/ISLTools.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/InitializePasses.h"
#include "isl/isl-noexceptions.h"
#include "isl/union_map.h"
#include <cassert>
#include <limits>
#include <string>
#include <vector>
usingnamespacellvm;
usingnamespacepolly;
#define DEBUG_TYPE …
namespace {
class MaximalStaticExpanderWrapperPass final : public ScopPass { … };
#ifndef NDEBUG
static bool isDimBoundedByConstant(isl::set Set, unsigned dim) {
auto ParamDims = unsignedFromIslSize(Set.dim(isl::dim::param));
Set = Set.project_out(isl::dim::param, 0, ParamDims);
Set = Set.project_out(isl::dim::set, 0, dim);
auto SetDims = unsignedFromIslSize(Set.tuple_dim());
assert(SetDims >= 1);
Set = Set.project_out(isl::dim::set, 1, SetDims - 1);
return bool(Set.is_bounded());
}
#endif
class MaximalStaticExpansionImpl { … };
static std::unique_ptr<MaximalStaticExpansionImpl>
runMaximalStaticExpansion(Scop &S, OptimizationRemarkEmitter &ORE,
const Dependences &D) { … }
static PreservedAnalyses runMSEUsingNPM(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR,
raw_ostream *OS) { … }
}
PreservedAnalyses
MaximalStaticExpansionPass::run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR,
SPMUpdater &) { … }
PreservedAnalyses
MaximalStaticExpansionPrinterPass::run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR,
SPMUpdater &) { … }
char MaximalStaticExpanderWrapperPass::ID = …;
bool MaximalStaticExpanderWrapperPass::runOnScop(Scop &S) { … }
void MaximalStaticExpanderWrapperPass::printScop(raw_ostream &OS,
Scop &S) const { … }
void MaximalStaticExpanderWrapperPass::getAnalysisUsage(
AnalysisUsage &AU) const { … }
Pass *polly::createMaximalStaticExpansionPass() { … }
INITIALIZE_PASS_BEGIN(MaximalStaticExpanderWrapperPass, "polly-mse",
"Polly - Maximal static expansion of SCoP", false, false);
INITIALIZE_PASS_DEPENDENCY(DependenceInfo);
INITIALIZE_PASS_DEPENDENCY(OptimizationRemarkEmitterWrapperPass);
INITIALIZE_PASS_END(MaximalStaticExpanderWrapperPass, "polly-mse",
"Polly - Maximal static expansion of SCoP", false, false)