CodeExtractor sort of does this.
First, it's a utility, not a pass - you'd still need to wrap it up with
pass that actually causes it to outlines what you want it to outline.
Second, it's a bit buggy. There are, as far as I know, two in-tree users of
this utility: bugpoint, and partial inlining. Both of them are fairly
specialized use-cases, and don't actually exercise the full generality of
outlining an arbitrary region. And since a lot of cases are in practice
untested - they don't quite work.
I've had some fixes for this internally, but never actually upstreamed
them, and no longer have access to that codebase. So, you'll probably run
into the same issues if you try to do anything untrivial with it.
Michael
On 12 April 2016 at 13:24, Tom Chen via llvm-dev <llvm-dev at
lists.llvm.org>
wrote:
> Does this do what you want
> http://llvm.org/docs/doxygen/html/classllvm_1_1CodeExtractor.html?
>
> 2016-04-12 14:58 GMT-05:00 Minghwa Wang via llvm-dev <
> llvm-dev at lists.llvm.org>:
>
>> Is there any support for outlining in llvm?
>>
>> As we know outlining is the opposite of inlining and while refactoring,
>> if we can outlining common code into functions, then function merge
>> (supported by llvm) can be more efficient in reducing code size.
>>
>> If llvm support outlining, how to use it? Any documentation for it?
>>
>> Thanks,
>> Ming-Hwa
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
>>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20160412/5cf11ed8/attachment.html>