diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2016-06-20 16:03:25 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2016-06-20 16:03:25 +0000 |
| commit | c5601df9fdf0ac84cc95d65e97f7fb3423e844d7 (patch) | |
| tree | 0dd82af2117389f5a87125f980f8d42b6abbf7fe /llvm/lib/Transforms | |
| parent | 86100fc8bee7d1352e9ebc92cb354b2e938c5e4f (diff) | |
| download | bcm5719-llvm-c5601df9fdf0ac84cc95d65e97f7fb3423e844d7.tar.gz bcm5719-llvm-c5601df9fdf0ac84cc95d65e97f7fb3423e844d7.zip | |
Reapply "[LoopIdiom] Don't remove dead operands manually"
This reverts commit r273160, reapplying r273132.
RecursivelyDeleteTriviallyDeadInstructions cannot be called on a
parentless Instruction.
llvm-svn: 273162
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp index f923673484f..d75dbb47771 100644 --- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp @@ -150,17 +150,9 @@ INITIALIZE_PASS_END(LoopIdiomRecognize, "loop-idiom", "Recognize loop idioms", Pass *llvm::createLoopIdiomPass() { return new LoopIdiomRecognize(); } -/// deleteDeadInstruction - Delete this instruction. Before we do, go through -/// and zero out all the operands of this instruction. If any of them become -/// dead, delete them and the computation tree that feeds them. -/// -static void deleteDeadInstruction(Instruction *I, - const TargetLibraryInfo *TLI) { - SmallVector<Value *, 16> Operands(I->value_op_begin(), I->value_op_end()); +static void deleteDeadInstruction(Instruction *I) { I->replaceAllUsesWith(UndefValue::get(I->getType())); I->eraseFromParent(); - for (Value *Op : Operands) - RecursivelyDeleteTriviallyDeadInstructions(Op, TLI); } //===----------------------------------------------------------------------===// |

