[SimplifyCFG] Tail-merge calls with sideeffects
authorJames Molloy <james.molloy@arm.com>
Wed, 31 Aug 2016 10:46:16 +0000 (10:46 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 31 Aug 2016 10:46:16 +0000 (10:46 +0000)
commit923e98c232fe8e06fa73fba29cd789e42499df5d
treebf6f0489186a188e12475d5a63fe761b5e784d22
parent7b09af193a221fb5382d1094c134e50b31bdf7e6
[SimplifyCFG] Tail-merge calls with sideeffects

This was deliberately disabled during my rewrite of SinkIfThenToEnd to keep behaviour
at least vaguely consistent with the previous version and keep it as close to NFC as
I could.

There's no real reason not to merge sideeffect calls though, so let's do it! Small fixup
along the way to ensure we don't create indirect calls.

Should fix PR28964.

llvm-svn: 280215
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/sink-common-code.ll