39#include "llvm/Support/CommandLine.h"
47cl::opt<int> DCEPreciseSteps(
48 "polly-dce-precise-steps",
49 cl::desc(
"The number of precise steps between two approximating "
50 "iterations. (A value of -1 schedules another approximation stage "
51 "before the actual dead code elimination."),
54class DeadCodeElimWrapperPass final :
public ScopPass {
57 explicit DeadCodeElimWrapperPass() :
ScopPass(ID) {}
66char DeadCodeElimWrapperPass::ID = 0;
109static bool runDeadCodeElimination(
Scop &
S,
int PreciseSteps,
119 if (PreciseSteps == -1)
132 Live = Live.
unite(Extra);
134 if (Steps > PreciseSteps) {
144 return S.restrictDomains(Live);
147bool DeadCodeElimWrapperPass::runOnScop(
Scop &
S) {
148 auto &DI = getAnalysis<DependenceInfo>();
151 bool Changed = runDeadCodeElimination(
S, DCEPreciseSteps, Deps);
161void DeadCodeElimWrapperPass::getAnalysisUsage(AnalysisUsage &AU)
const {
169 return new DeadCodeElimWrapperPass();
178 bool Changed = runDeadCodeElimination(
S, DCEPreciseSteps, Deps);
186 return PreservedAnalyses::all();
188 PreservedAnalyses PA;
189 PA.preserveSet<AllAnalysesOn<Module>>();
190 PA.preserveSet<AllAnalysesOn<Function>>();
191 PA.preserveSet<AllAnalysesOn<Loop>>();
196 "Polly - Remove dead iterations",
false,
false)
polly Polly Remove dead iterations
INITIALIZE_PASS_BEGIN(DependenceInfo, "polly-dependences", "Polly - Calculate dependences", false, false)
INITIALIZE_PASS_END(DependenceInfo, "polly-dependences", "Polly - Calculate dependences", false, false) namespace
INITIALIZE_PASS_DEPENDENCY(ScopInfoRegionPass)
llvm::cl::OptionCategory PollyCategory
isl::union_set range() const
isl::union_map reverse() const
isl::union_set domain() const
isl::union_map lexmax() const
isl::union_map apply_range(isl::union_map umap2) const
isl::union_set affine_hull() const
boolean is_subset(const isl::union_set &uset2) const
isl::union_set coalesce() const
isl::union_set intersect(isl::union_set uset2) const
isl::union_set apply(isl::union_map umap) const
isl::union_set unite(isl::union_set uset2) const
The accumulated dependence information for a SCoP.
bool hasValidDependences() const
Report if valid dependences are available.
isl::union_map getDependences(int Kinds) const
Get the dependences of type Kinds.
The legacy pass manager's analysis pass to compute scop information for a region.
ScopPass - This class adapts the RegionPass interface to allow convenient creation of passes that ope...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
virtual bool runOnScop(Scop &S)=0
runOnScop - This method must be overloaded to perform the desired Polyhedral transformation or analys...
This file contains the declaration of the PolyhedralInfo class, which will provide an interface to ex...
llvm::Pass * createDeadCodeElimWrapperPass()
AnalysisManager< Scop, ScopStandardAnalysisResults & > ScopAnalysisManager
llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM, ScopStandardAnalysisResults &SAR, SPMUpdater &U)
const Dependences & getDependences(Dependences::AnalysisLevel Level)
Return the dependence information for the current SCoP.
const Dependences & recomputeDependences(Dependences::AnalysisLevel Level)
Recompute dependences from schedule and memory accesses.