diff options
author | Tobias Grosser <grosser@fim.uni-passau.de> | 2013-03-23 00:16:05 +0000 |
---|---|---|
committer | Tobias Grosser <grosser@fim.uni-passau.de> | 2013-03-23 00:16:05 +0000 |
commit | c30d9cc67810dfd74146ec9e45743bf5fc7215b2 (patch) | |
tree | 09a511cdf4dbe6c21380495b0e56dc8b59331a7a | |
parent | 33bc2e93be3190c9526d0f2f31ac4239526f8281 (diff) | |
download | bcm5719-llvm-c30d9cc67810dfd74146ec9e45743bf5fc7215b2.tar.gz bcm5719-llvm-c30d9cc67810dfd74146ec9e45743bf5fc7215b2.zip |
DeadCodeElimination: clang-format and comment
llvm-svn: 177782
-rw-r--r-- | polly/lib/DeadCodeElimination.cpp | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/polly/lib/DeadCodeElimination.cpp b/polly/lib/DeadCodeElimination.cpp index 5456d732d2f..0ea83e0d260 100644 --- a/polly/lib/DeadCodeElimination.cpp +++ b/polly/lib/DeadCodeElimination.cpp @@ -7,8 +7,16 @@ // //===----------------------------------------------------------------------===// // -// If values calculated within an iteration are not used later on the iteration -// can be removed entirely. This pass removes such iterations. +// This is a skeleton that is meant to contain a dead code elimination pass +// later on. +// +// The idea of this pass is to loop over all statements and to remove statement +// iterations that do not calculate any value that is read later on. We need to +// make sure to forward RAR and WAR dependences. +// +// A case where this pass might be useful is +// http://llvm.org/bugs/show_bug.cgi?id=5117 +// //===----------------------------------------------------------------------===// #include "polly/Dependences.h" @@ -26,8 +34,7 @@ class DeadCodeElim : public ScopPass { public: static char ID; - explicit DeadCodeElim() : ScopPass(ID) { - } + explicit DeadCodeElim() : ScopPass(ID) {} virtual bool runOnScop(Scop &S); void printScop(llvm::raw_ostream &OS) const; @@ -40,36 +47,28 @@ char DeadCodeElim::ID = 0; bool DeadCodeElim::runOnScop(Scop &S) { Dependences *D = &getAnalysis<Dependences>(); - int Kinds = Dependences::TYPE_RAW | Dependences::TYPE_WAR | - Dependences::TYPE_WAW; + int Kinds = + Dependences::TYPE_RAW | Dependences::TYPE_WAR | Dependences::TYPE_WAW; isl_union_map *Deps = D->getDependences(Kinds); - // The idea of this pass is to loop over all statments and remove statement - // iterations that do not calculate any value that is read later on. We need - // to make sure to forward RAR and WAR dependences. - // - // A case where this pass might be useful is - // http://llvm.org/bugs/show_bug.cgi?id=5117 isl_union_map_free(Deps); return false; } -void DeadCodeElim::printScop(raw_ostream &OS) const { -} +void DeadCodeElim::printScop(raw_ostream &OS) const {} void DeadCodeElim::getAnalysisUsage(AnalysisUsage &AU) const { ScopPass::getAnalysisUsage(AU); AU.addRequired<Dependences>(); } +Pass *polly::createDeadCodeElimPass() { return new DeadCodeElim(); } + INITIALIZE_PASS_BEGIN(DeadCodeElim, "polly-dce", - "Polly - Remove dead iterations", false, false) -INITIALIZE_PASS_DEPENDENCY(Dependences) -INITIALIZE_PASS_DEPENDENCY(ScopInfo) -INITIALIZE_PASS_END(DeadCodeElim, "polly-dce", - "Polly - Remove dead iterations", false, false) - -Pass* polly::createDeadCodeElimPass() { - return new DeadCodeElim(); -} + "Polly - Remove dead iterations", false, false); +INITIALIZE_PASS_DEPENDENCY(Dependences); +INITIALIZE_PASS_DEPENDENCY(ScopInfo); +INITIALIZE_PASS_END(DeadCodeElim, "polly-dce", "Polly - Remove dead iterations", + false, false) + |