diff options
author | Wenlei He <aktoon@gmail.com> | 2019-11-24 23:54:07 -0800 |
---|---|---|
committer | Wenlei He <aktoon@gmail.com> | 2019-12-05 16:07:01 -0800 |
commit | 532196d811ad4db1e522012c9d20e4a95aae2eb3 (patch) | |
tree | d0672afbf979b0ce81e899a3f805a282c24e548f /lldb/packages/Python/lldbsuite/test/python_api/thread/main2.cpp | |
parent | e503fd85d3ac9d3e1493a7a63bc43c6939e132cc (diff) | |
download | bcm5719-llvm-532196d811ad4db1e522012c9d20e4a95aae2eb3.tar.gz bcm5719-llvm-532196d811ad4db1e522012c9d20e4a95aae2eb3.zip |
[AutoFDO] Top-down Inlining for specialization with context-sensitive profile
Summary:
AutoFDO's sample profile loader processes function in arbitrary source code order, so if I change the order of two functions in source code, the inline decision can change. This also prevented the use of context-sensitive profile to do specialization while inlining. This commit enforces SCC top-down order for sample profile loader. With this change, we can now do specialization, as illustrated by the added test case:
Say if we have A->B->C and D->B->C call path, we want to inline C into B when root inliner is B, but not when root inliner is A or D, this is not possible without enforcing top-down order. E.g. Once C is inlined into B, A and D can only choose to inline (B->C) as a whole or nothing, but what we want is only inline B into A and D, not its recursive callee C. If we process functions in top-down order, this is no longer a problem, which is what this commit is doing.
This change is guarded with a new switch "-sample-profile-top-down-load" for tuning, and it depends on D70653. Eventually, top-down can be the default order for sample profile loader.
Reviewers: wmi, davidxl
Subscribers: hiraditya, llvm-commits, tejohnson
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70655
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/thread/main2.cpp')
0 files changed, 0 insertions, 0 deletions