RFR: 8293491: Avoid unexpected deoptimization in loop exit due to incorrect branch profiling [v2]
Jie Fu
jiefu at openjdk.org
Mon Sep 12 03:50:47 UTC 2022
On Thu, 8 Sep 2022 10:55:13 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> Jie Fu has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>>
>> - Address review comments
>> - Merge branch 'master' into JDK-8293491
>> - Merge branch 'master' into JDK-8293491
>> - 8293491: Avoid unexpected deoptimization in loop exit due to incorrect branch profiling
>
> Do these deoptimizations really affect performance of your program or did you just spot them when looking at the logs?
>
> Such surprising deopts are actually expected with optimistic, profile guided optimizations and happen in many other scenarios as well. They are usually harmless. Also, the profile information is not necessarily incorrect but might just be outdated because we stop profiling once we reach C2. Marking all loop exits as taken seems hacky and might have unexpected side effects.
>
> Also, wouldn't C2 still insert a `Deoptimization::Reason_unreached` or `Deoptimization::Reason_unstable_if` trap for subsequent instructions after the loop exit for which profiling also suggests that they were never executed?
Hi @TobiHartmann and @cl4es , patch had been updated.
Any comments?
Thanks.
-------------
PR: https://git.openjdk.org/jdk/pull/10200
More information about the hotspot-compiler-dev
mailing list