[CallSiteSplitting] Support splitting of blocks with instrs before call.
authorFlorian Hahn <florian.hahn@arm.com>
Tue, 13 Feb 2018 12:00:48 +0000 (12:00 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Tue, 13 Feb 2018 12:00:48 +0000 (12:00 +0000)
commitb0884b644355a3847eaf30b1d6a2f0c49782dad5
tree820dffcc9676a9d8c0f1bb1913d6b303ce47378e
parentf00234c0bfe875ccdcbcb49115aefe8a8dff4bf6
[CallSiteSplitting] Support splitting of blocks with instrs before call.

For basic blocks with instructions between the beginning of the block
and a call we have to duplicate the instructions before the call in all
split blocks and add PHI nodes for uses of the duplicated instructions
after the call.

Currently, the threshold for the number of instructions before a call
is quite low, to keep the impact on binary size low.

Reviewers: junbuml, mcrosier, davidxl, davide

Reviewed By: junbuml

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

llvm-svn: 325001
llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
llvm/test/Transforms/CallSiteSplitting/callsite-instructions-before-call.ll [new file with mode: 0644]
llvm/test/Transforms/CallSiteSplitting/callsite-no-or-structure.ll
llvm/test/Transforms/CallSiteSplitting/callsite-split-debug.ll
llvm/test/Transforms/CallSiteSplitting/callsite-split-or-phi.ll
llvm/test/Transforms/CallSiteSplitting/callsite-split.ll