diff options
author | Chris Lattner <sabre@nondot.org> | 2002-01-23 05:47:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-01-23 05:47:35 +0000 |
commit | 17643a8c9d12f029ece16741cad116b60b690662 (patch) | |
tree | 27a181da834e8110841728a26a6c30dc59c2d082 | |
parent | 80fceef49b4bd5ef8b0fa5f68cd83339d91d81d4 (diff) |
* Expose new pass DeadInstElimination
* Add comments that describe the differences between the DCE passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1553 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Transforms/Scalar/DCE.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Scalar/DCE.h b/include/llvm/Transforms/Scalar/DCE.h index bc498c34a7..712223e1d0 100644 --- a/include/llvm/Transforms/Scalar/DCE.h +++ b/include/llvm/Transforms/Scalar/DCE.h @@ -11,6 +11,26 @@ #include "llvm/Pass.h" #include "llvm/BasicBlock.h" +//===----------------------------------------------------------------------===// +// DeadInstElimination - This pass quickly removes trivially dead instructions +// without modifying the CFG of the function. It is a BasicBlockPass, so it +// runs efficiently when queued next to other BasicBlockPass's. +// +struct DeadInstElimination : public BasicBlockPass { + virtual bool runOnBasicBlock(BasicBlock *BB); +}; + + +//===----------------------------------------------------------------------===// +// DeadCodeElimination - This pass is more powerful than DeadInstElimination, +// because it will remove dead basic blocks as well as all of the instructions +// contained within them. This pass is useful to run after another pass has +// reorganized the CFG and possibly modified control flow. +// +// TODO: In addition to DCE stuff, this also merges basic blocks together and +// otherwise simplifies control flow. This should be factored out of this pass +// eventually into it's own pass. +// struct DeadCodeElimination : public MethodPass { // External Interface: // @@ -42,6 +62,11 @@ struct DeadCodeElimination : public MethodPass { +//===----------------------------------------------------------------------===// +// AgressiveDCE - This pass uses the SSA based Agressive DCE algorithm. This +// algorithm assumes instructions are dead until proven otherwise, which makes +// it more successful are removing non-obviously dead instructions. +// struct AgressiveDCE : public MethodPass { // DoADCE - Execute the Agressive Dead Code Elimination Algorithm // |