RFR: 8254108: ciReplay: Support incremental inlining [v2]

Dean Long dlong at openjdk.java.net
Wed Nov 17 20:44:43 UTC 2021


On Wed, 17 Nov 2021 16:12:34 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> src/hotspot/share/opto/bytecodeInfo.cpp line 609:
>> 
>>> 607:     InlineTree* callee_tree = build_inline_tree_for_callee(callee_method, jvms, caller_bci);
>>> 608:     if (should_delay || AlwaysIncrementalInline) {
>>> 609:       callee_tree->set_late_inline();
>> 
>> It took me a while to figure out why this is needed: for replay.  It bothers me a little that AlwaysIncrementalInline is check here and again in the caller.  If the replay file sets should_delay to false, then we shouldn't let AlwaysIncrementalInline to force it to true, right?  So I'm wondering if it would be better to pre-set should_delay to true in the caller if AlwaysIncrementalInline is true.
>
> I've added a comment to make it more clear. So, this code is only to record the late inlining decision to later dump it to the replay file. I think initializing `should_delay = AlwaysIncrementalInline` is a good idea. `should_delay` can only become true but not false anymore during normal compilation. 
> 
> But I think we need to leave `|| AlwaysIncrementalInline` in here https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/doCall.cpp#L192 in case someone wants to replay compile with that flag even though the replay file recorded a different late inlining decision.
> 
> I also fixed the test if run with `-XX:+AlwaysIncrementalInline`.

Shouldn't the recorded inlining decision always override flags like -XX:+AlwaysIncrementalInline?
This brings up the question of how to handle flags.  If we stored them in the replay file, then the replay compile could compare those to the current flags and if they don't match:
1) give a warning and continue, correct replay not guaranteed
2) give an error and refuse to continue
3) override current flags with saved flags (this could be implemented by having the "ci" layer cache flags settings for each compile)

-------------

PR: https://git.openjdk.java.net/jdk/pull/6413


More information about the hotspot-compiler-dev mailing list