[SimplifyCFG] Use a more elegant solution than r261731
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 24 Feb 2016 17:30:48 +0000 (17:30 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 24 Feb 2016 17:30:48 +0000 (17:30 +0000)
commitee0cbbbe69e51373265c293adc1a02608a8b1d7a
treee31eb90e54ae575feb00fd92b8e6bb260503806d
parentcd25a2bef02ffe03aa1e16d361eb4f871371b870
[SimplifyCFG] Use a more elegant solution than r261731

The cleanupret instruction has an invariant that it's 'from' operand be
a cleanuppad.  This invariant was violated when we removed a dead block
which removed a cleanuppad leaving behind a cleanupret with an undef
'from' operand.

This was solved in r261731 by staving off the removal of the dead block
to a later pass.

However, it occured to me that we do not need to do this.
Instead, we can simply avoid processing the cleanupret if it has an
undef 'from' operand because we know that it will be removed soon.

llvm-svn: 261754
llvm/lib/Transforms/Utils/SimplifyCFG.cpp