[PartialInlining] Enable recursive partial inlining.
authorMark Lacey <mark.lacey@apple.com>
Wed, 19 Oct 2022 20:20:56 +0000 (13:20 -0700)
committerMark Lacey <mark.lacey@apple.com>
Tue, 6 Dec 2022 07:10:37 +0000 (23:10 -0800)
commite96925ce0b03268afa75538943e355603c1fe63e
tree13a4d41262bc30ba48235739fbeaef670a7efb47
parent166c8cccde010ea01fdc20945a2a25fa1971cb73
[PartialInlining] Enable recursive partial inlining.

It seems unnecessarily limiting to disallow recursive partial
inlining, and there are clearly cases where it can benefit
code by avoiding a function call and potentially enabling
other transformations like dead argument elimination
in cases where an argument is only used prior to the early-out
test at the top of the function.

The pass already properly rewrites the recursive calls
within the body of the freshly cloned function, so the only
change here is removing the bail-out when recursion is
detected.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D136383
llvm/lib/Transforms/IPO/PartialInlining.cpp
llvm/test/Transforms/PartialInlining/recursive_partial_inlining.ll [new file with mode: 0644]