TRE: Just erase dead BBs and tweak the iteration loop not to increment the deleted...
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 28 Feb 2015 16:47:27 +0000 (16:47 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 28 Feb 2015 16:47:27 +0000 (16:47 +0000)
commit6b7603962adaca5fd403cefd74e7fe32fdbcc8db
treec2924ff1cf1a2f13e36254df3f02514c151521c0
parentfa22cce8d765eaa52434f67ef43c842ff648e153
TRE: Just erase dead BBs and tweak the iteration loop not to increment the deleted BB iterator.

Leaving empty blocks around just opens up a can of bugs like PR22704. Deleting
them early also slightly simplifies code.

Thanks to Sanjay for the IR test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230856 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/TailRecursionElimination.cpp
test/Transforms/TailCallElim/inf-recursion.ll