RFR: 8286104: use aggressive liveness for unstable_if traps [v12]

Xin Liu xliu at openjdk.org
Mon Jun 20 21:42:54 UTC 2022


On Mon, 20 Jun 2022 07:32:02 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> Xin Liu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   monior change for code style.
>
> src/hotspot/share/opto/ifnode.cpp line 842:
> 
>> 840:       if (!igvn->C->too_many_traps(dom_method, dom_bci, Deoptimization::Reason_unstable_fused_if) &&
>> 841:           !igvn->C->too_many_traps(dom_method, dom_bci, Deoptimization::Reason_range_check) &&
>> 842:           igvn->C->remove_unstable_if_trap(dom_unc)) {
> 
> This should be moved to `IfNode::merge_uncommon_traps`.

I tried that in the first place. It turns out that situation is complex. The following 3 functions take place in order. 
has_only_uncommon_traps() => fold_compares_helper() => merge_uncommon_traps()

`IfNode::has_only_uncommon_traps` is the last stop before modifying code. if we moved the predicate "remove_unstable_if_trap(dom_unc)" to `merge_uncommon_traps()`, it would be too late when it returns true. We have to rollback code change in `fold_compares_helper`.

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

PR: https://git.openjdk.org/jdk/pull/8545


More information about the hotspot-compiler-dev mailing list