[SLSR] garbage-collect unused instructions
authorJingyue Wu <jingyue@google.com>
Tue, 21 Apr 2015 19:56:18 +0000 (19:56 +0000)
committerJingyue Wu <jingyue@google.com>
Tue, 21 Apr 2015 19:56:18 +0000 (19:56 +0000)
commit423476d899034075c2e1c6a03b8d1894bcfe0ff1
tree08cbf2b3815fe0d23e314664ae392cc2507cee23
parent412b6fc7b9cd7b331ec032aaedd8dcd337b0a111
[SLSR] garbage-collect unused instructions

Summary:
After we rewrite a candidate, the instructions used by the old form may
become unused. This patch cleans up these unused instructions so that we
needn't run DCE after SLSR.

Test Plan: removed -dce in all the SLSR tests

Reviewers: broune, meheff

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9101

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235410 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
test/Transforms/StraightLineStrengthReduce/X86/no-slsr.ll
test/Transforms/StraightLineStrengthReduce/slsr-add.ll
test/Transforms/StraightLineStrengthReduce/slsr-gep.ll
test/Transforms/StraightLineStrengthReduce/slsr-mul.ll