RFR: 8320649: C2: Optimize scoped values [v15]
Roland Westrelin
roland at openjdk.org
Thu May 2 07:18:04 UTC 2024
On Thu, 18 Apr 2024 12:47:54 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> I am wondering if it would make sense to have some `scoped_value.hpp/cpp`, where you can put all your new classes. This would also allow you to put documentation about the general approach at the top of the `scoped_value.hpp` file. Currently, the code is spread all over, and it would be hard to know where one could find a good summary of the whole optimization.
I moved most of the scoped value specific code to `scoped_value.hpp/cpp` in the new commit.
> src/hotspot/share/opto/loopnode.hpp line 703:
>
>> 701: bool policy_peeling(PhaseIdealLoop* phase, bool scoped_value_only);
>> 702:
>> 703: uint estimate_peeling(PhaseIdealLoop* phase, bool peel_only_if_has_scoped_value);
>
> Can we use the same name for `scoped_value_only` and `peel_only_if_has_scoped_value`? In `policy_peeling` you pass the value into `estimate_peeling`, so it seems to be the same.
>
> Somehow it does not sit well with me that we have such a special-case flag in such a high-level and general method. But I don't know a fix now. It just looks like not the best design. But that may not be your fault. Are there any alternatives?
I added a `policy_peeling_for_scoped_value()` method.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16966#issuecomment-2089774427
PR Review Comment: https://git.openjdk.org/jdk/pull/16966#discussion_r1587170022
More information about the hotspot-compiler-dev
mailing list