OSDN Git Service

Avoid inlining call sites in unreachable-terminated block
authorJun Bum Lim <junbuml@codeaurora.org>
Mon, 1 Feb 2016 20:55:11 +0000 (20:55 +0000)
committerJun Bum Lim <junbuml@codeaurora.org>
Mon, 1 Feb 2016 20:55:11 +0000 (20:55 +0000)
commitda7cbcd8d59c107376718d88f2e47f7b2344b49a
tree72ff6b72e243f89a44887a5a0a33b7cd920f74ff
parent540a1fb656cda803b5253e147d40b98bf705b604
Avoid inlining call sites in unreachable-terminated block

Summary:
If the normal destination of the invoke or the parent block of the call site is unreachable-terminated, there is little point in inlining the call site unless there is literally zero cost. Unlike my previous change (D15289), this change specifically handle the call sites followed by unreachable in the same basic block for call or in the normal destination for the invoke. This change could be a reasonable first step to conservatively inline call sites leading to an unreachable-terminated block while BFI / BPI is not yet available in inliner.

Reviewers: manmanren, majnemer, hfinkel, davidxl, mcrosier, dblaikie, eraman

Subscribers: dblaikie, davidxl, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D16616

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259403 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InlineCost.cpp
test/Transforms/Inline/inline_unreachable.ll [new file with mode: 0644]
test/Transforms/JumpThreading/pr26096.ll