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)
commit53907161cc20292fd7de53e8e1f0a7ff105076a7
treee83368482d34982de95bdc96c63b775636b9a37a
parent064261da160e3a63e0c6e0b3e4402880f1475a6e
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

llvm-svn: 259403
llvm/lib/Analysis/InlineCost.cpp
llvm/test/Transforms/Inline/inline_unreachable.ll [new file with mode: 0644]
llvm/test/Transforms/JumpThreading/pr26096.ll