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

Vladimir Kozlov kvn at openjdk.java.net
Thu May 26 20:18:40 UTC 2022


On Thu, 26 May 2022 06:42:09 GMT, Xin Liu <xliu at openjdk.org> wrote:

> > I think you also need to call inline_incrementally_cleanup() on exit from process_for_unstable_ifs() if it made progress (found dead locals). Or do similar thing to cleanup *_late_inlines lists. Placing IF node on work list is not enough.
> 
> Hi, @vnkozlov , I don't understand why we need to call inline_incrementally_cleanup(), which combines `PhaseRemoveUseless` and IGVN. It looks for me C2 only needs `PhaseRemoveUseless` after parsing.

My concern was that `igvn.optimize()` call in `process_for_unstable_ifs()` will not clean up lists (`_late_inlines`, `_string_late_inlines`, `_boxing_late_inlines`) used by `inline_incrementally()` and following code. It is in case when `process_for_unstable_ifs()` removes uses to these calls (removes reference to result of call). You need to run  `PhaseRemoveUseless` to determine that calls are useless. I don't think `igvn.optimize()` can mark call node as dead in this case because it still connected to graph through control edges.

You need to verify that calls are removed from lists (for example call `valueOf()` from `_boxing_late_inlines` list).
If calls are indeed removed from lists by calling `igvn.optimize()` then I will be fine with your code.

> 
> I decide to only call process_for_unstable_ifs() after IGVN(1st) and before incremental inliner. we may call it after incremental inliner after we can prove it is stable.

Okay.

> 
> If `process_for_unstable_ifs` does kill a value, `igvn.replace_input_of()` puts unc and unc->in(idx) into worklist. `igvn.optimize()` in last statement should handle them properly. I just follow the recipe of `process_for_post_loop_opts_igvn()`.

`process_for_post_loop_opts_igvn()` is called when all late inlines are done and corresponding lists are empty.

> 
> thanks, --lx

Thanks, Vladimir K

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

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


More information about the hotspot-compiler-dev mailing list