diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-27 22:57:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-27 22:57:53 +0000 |
commit | 3481f24c06b3c9de48bdd99c37547471ca8e761e (patch) | |
tree | 749781952c73d7efacd3b6b0c918c3173088629f /include/llvm | |
parent | 15678533f3c8baa6664fe9b513b614b8665f29fd (diff) | |
download | external_llvm-3481f24c06b3c9de48bdd99c37547471ca8e761e.zip external_llvm-3481f24c06b3c9de48bdd99c37547471ca8e761e.tar.gz external_llvm-3481f24c06b3c9de48bdd99c37547471ca8e761e.tar.bz2 |
remove doConstantPropagation and dceInstruction, they are just
wrappers around the interesting code and use an obscure iterator
abstraction that dates back many many years.
Move EraseDeadInstructions to Transforms/Utils and name it
RecursivelyDeleteTriviallyDeadInstructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60191 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Transforms/Utils/Local.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h index 4292729..65438aa 100644 --- a/include/llvm/Transforms/Utils/Local.h +++ b/include/llvm/Transforms/Utils/Local.h @@ -26,14 +26,9 @@ class ConstantExpr; class TargetData; //===----------------------------------------------------------------------===// -// Local constant propagation... +// Local constant propagation. // -/// doConstantPropagation - Constant prop a specific instruction. Returns true -/// and potentially moves the iterator if constant propagation was performed. -/// -bool doConstantPropagation(BasicBlock::iterator &I, const TargetData *TD = 0); - /// ConstantFoldTerminator - If a terminator instruction is predicated on a /// constant value, convert it into an unconditional branch to the constant /// destination. This is a nontrivial operation because the successors of this @@ -42,7 +37,7 @@ bool doConstantPropagation(BasicBlock::iterator &I, const TargetData *TD = 0); bool ConstantFoldTerminator(BasicBlock *BB); //===----------------------------------------------------------------------===// -// Local dead code elimination... +// Local dead code elimination. // /// isInstructionTriviallyDead - Return true if the result produced by the @@ -50,14 +45,12 @@ bool ConstantFoldTerminator(BasicBlock *BB); /// bool isInstructionTriviallyDead(Instruction *I); - -/// dceInstruction - Inspect the instruction at *BBI and figure out if it -/// isTriviallyDead. If so, remove the instruction and update the iterator to -/// point to the instruction that immediately succeeded the original -/// instruction. -/// -bool dceInstruction(BasicBlock::iterator &BBI); - + +/// RecursivelyDeleteTriviallyDeadInstructions - If the specified value is a +/// trivially dead instruction, delete it. If that makes any of its operands +/// trivially dead, delete them too, recursively. +void RecursivelyDeleteTriviallyDeadInstructions(Value *V); + //===----------------------------------------------------------------------===// // Control Flow Graph Restructuring... // |