OSDN Git Service

[Reassociation] Place moved instructions after landing pads
authorDavid Greene <greened@obbligato.org>
Wed, 8 May 2019 15:44:24 +0000 (15:44 +0000)
committerDavid Greene <greened@obbligato.org>
Wed, 8 May 2019 15:44:24 +0000 (15:44 +0000)
commita44ee671df955c8ddf79051ad3fb427cb0ad1149
treebbd9525e42d95975aed0bfe038daef19a1de79cb
parent87650a2cac7b176885eff9577932546e3bf6fb3f
[Reassociation] Place moved instructions after landing pads

Reassociation's NegateValue moved instructions to the beginning of
blocks (after PHIs) without checking for exception handling pads.
It's possible for reassociation to move something into an exception
handling block so we need to make sure we don't move things too early
in the block.  This change advances the insertion point past any
exception handling pads.

If the block we want to move into contains a catchswitch, we cannot
move into it.  In that case just create a new neg as if we had not
found an existing neg to move.

Differential Revision: https://reviews.llvm.org/D61089

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360262 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/Reassociate.cpp
test/Transforms/Reassociate/reassociate-catchswitch.ll [new file with mode: 0644]
test/Transforms/Reassociate/reassociate-landingpad.ll [new file with mode: 0644]