[unroll] Directly query for dead instructions.
authorChandler Carruth <chandlerc@gmail.com>
Fri, 13 Feb 2015 04:14:05 +0000 (04:14 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 13 Feb 2015 04:14:05 +0000 (04:14 +0000)
commit758256535ca42889f5334198480eb222c2d0e511
treec28152cb2b482da25bb3df3b9eac2b5038e099f1
parent2640fd5bae01dfdb7d07178c0a71cdbf8a519db6
[unroll] Directly query for dead instructions.

In the unroll analyzer, it is checking each user to see if that user
will become dead. However, it first checked if that user was missing
from the simplified values map, and then if was also missing from the
dead instructions set. We add everything from the simplified values map
to the dead instructions set, so the first step is completely subsumed
by the second. Moreover, the first step requires *inserting* something
into the simplified value map which isn't what we want at all.

This also replaces a dyn_cast with a cast as an instruction cannot be
used by a non-instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229057 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopUnrollPass.cpp