[PATCH] D16616: Avoid inlining CallSites in unreachable-terminated block

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 08:42:26 PST 2016


On Tue, Jan 26, 2016 at 5:43 PM, Jun Bum Lim via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> junbuml created this revision.
> junbuml added reviewers: mcrosier, manmanren, majnemer, hfinkel, davidxl,
> eraman.
> junbuml added a subscriber: llvm-commits.
> Herald added a subscriber: mcrosier.
>
> If the call site or the normal destination of the invoke is an
> unreachable-terminated block, 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.
>

Not quite sure I follow - wouldn't it be possible that the function is
noreturn? So the entry is hot but the exit is cold/dead? Or is this
optimization change a heuristic based on the observation that this
situation (hot entry, dead exit) doesn't happen very often in practice?


>
>
> http://reviews.llvm.org/D16616
>
> Files:
>   lib/Analysis/InlineCost.cpp
>   test/Transforms/Inline/inline_unreachable.ll
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160127/16032cb7/attachment-0001.html>


More information about the llvm-commits mailing list