]> granicus.if.org Git - llvm/commit
Backport of rL326666 and rL326668 for PR36607 and PR36608.
authorFlorian Hahn <florian.hahn@arm.com>
Wed, 11 Apr 2018 12:01:38 +0000 (12:01 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Wed, 11 Apr 2018 12:01:38 +0000 (12:01 +0000)
commit417182e182569ed6ccac18a64bcef7b952cd5f8d
tree5c53471710bb8b944b640a5e42a11bdc5caeb6a7
parentd88ca2927027d254931437c6f6c83f43724945af
Backport of rL326666 and rL326668 for PR36607 and PR36608.

[CallSiteSplitting] properly split musttail calls.

The original author was Fedor Indutny <fedor@indutny.com>.

`musttail` calls can't be naively splitted. The split blocks must
include not only the call instruction itself, but also (optional)
`bitcast` and `return` instructions that follow it.

Clone `bitcast` and `ret`, place them into the split blocks, and
remove the tail block when done.

Reviewers: junbuml, mcrosier, davidxl, davide, fhahn

Reviewed By: fhahn

Subscribers: JDevlieghere, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@329793 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/CallSiteSplitting.cpp
test/Transforms/CallSiteSplitting/musttail.ll [new file with mode: 0644]