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)
commitcb570f1bc9ff7488532dd3fec7ecd2b74cafb489
tree29fab039479913ddceb97d95ce9b983d273b8202
parent96e68a0c47bfb74d54c4405838c3565f23d6c66f
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.

llvm-svn: 230856
llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
llvm/test/Transforms/TailCallElim/inf-recursion.ll