RFR: 8311125: Remove unused parameter 'phase' in AllocateNode::Ideal_allocation
Xin Liu
xliu at openjdk.org
Fri Jun 30 19:08:54 UTC 2023
On Fri, 30 Jun 2023 06:49:13 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> There are 2 overloaded AllocateNode::Idea_allocation() in graphkit.cpp.
>> One of them never uses 'phase' in the pattern-matching effort.
>>
>> C++ compiler may emit a warning for the unused parameter. We will need to take care of it if we treat
>> warning as error. It also unnecessarily couple CheckCastPP with PhaseValue. In some places, we have to
>> gain the instance for it.
>>
>> I would like to remove 'phase' as parameter. This is a pure clean-up. The other Idea_allocation() does
>> use PhaseValue* phase to get constant nodes, so leave it alone.
>
> src/hotspot/share/opto/parse1.cpp line 1014:
>
>> 1012: // then barrier introduced by allocation node can be removed.
>> 1013: if (DoEscapeAnalysis && alloc_with_final()) {
>> 1014: AllocateNode *alloc = AllocateNode::Ideal_allocation(alloc_with_final());
>
> Suggestion:
>
> AllocateNode* alloc = AllocateNode::Ideal_allocation(alloc_with_final());
Thanks. I will clean up those places.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14719#discussion_r1248202834
More information about the hotspot-compiler-dev
mailing list