[PATCH] D33694: [PartialInlining] : Partial inlining Overhead reduction: eliminate unnecessary live-out(s)

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 14:14:17 PDT 2017


davidxl created this revision.
Herald added a subscriber: eraman.

When there are multiple outgoing edges from outlined region to the return block, a new return block is created and the original return block becomes the 'pre-return block' to factor all incoming values from the outlined region to the new return. The original return block will be part of the outlined region. The original phi in the pre-return block is pruned so that it only takes incoming values from the outlined region.

There are cases when the old phi becomes trivial (all operands have the same value) -- for instance with the same constant or same live across value (from outside the region). In such cases, leaving the phi node will make the code-extractor decide that the phi's def is a live out value defined inside the outlined region -- this leads to additional runtime overhead: stack space to store the live out value, passing the address, in addition to load/store around the outlined calls.

This patch cleans it up.


https://reviews.llvm.org/D33694

Files:
  lib/Transforms/IPO/PartialInlining.cpp
  test/Transforms/CodeExtractor/PartialInlineLiveAcross.ll
  test/Transforms/CodeExtractor/PartialInlineNoLiveOut.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33694.100766.patch
Type: text/x-patch
Size: 6100 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170530/3ca3a31b/attachment.bin>


More information about the llvm-commits mailing list