[PATCH] Inliner Enhancement

Jiangning Liu liujiangning1 at gmail.com
Wed Mar 25 02:16:59 PDT 2015


Hi David,

Thanks a lot for your review!

1) guarded under a master flag (so that others can easily experiment with
> it)
>

Agree. I already defined a master flag called AgressiveInline. Given that
this was not caught by you, I added comment to get it highlighted in file
InlineSimple.cpp


> 2) assumes the infrastructure is ready and just make very simple changes
> to boost inlining with bonuses (similar to existing heuristics such as
> vector bonus)
>

I think, at present, we don't have incremental loop info update interface,
so it's no way to assume it unless we define it at the moment. If I'm wrong
about this, please let me know.

The heuristics for vector bonus is for callee only, and I don't think it
should be mixed with the call site context.

However, I agree to centralize all implementation of LoopAnalyzer, so it
would be easy to get it enhanced with incremental loop info update.


> 3) isolate your mock implementation of the loop info access in a
> centralized place
>

Agree. Actually my code already got all heuristics isolated in function
TuneThreshold in InlineSimple.cpp, and this is the only place to change
threshold dynamically according to control flow context.


> 4) get rid of the ordering change hack -- basically tolerate the compile
> time increase assuming it will go away (and because it is under a flag).
>

Disagree. This change itself is meaningful regardless if we use new pass
manager or not. This change will definitely reduce compile-time. And loop
info calculation just magnified the slow-down. I don't think it's a hacking
at all. On the other hand, I don't think it is acceptable to ask others to
endure the compiler slowdown. It would be quite annoying from engineering
point of view.

However, I agree to get it split out to be a separate one. So now I have
two patches as attached. One is to fix compile time issue, and the other is
to fix performance.

Thanks,
-Jiangning
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150325/5cb53a8f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline_llvm_2_fixABC.patch
Type: text/x-patch
Size: 9234 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150325/5cb53a8f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline_llvm_2_perf.patch
Type: text/x-patch
Size: 31468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150325/5cb53a8f/attachment-0001.bin>


More information about the llvm-commits mailing list