RFR: 8343685: C2 SuperWord: refactor VPointer with MemPointer [v14]
Emanuel Peter
epeter at openjdk.org
Sat Jan 18 05:26:46 UTC 2025
On Fri, 17 Jan 2025 12:45:02 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Batch 2 for Christian
>
> src/hotspot/share/opto/superword.hpp line 568:
>
>> 566: MemNode* _mem;
>> 567: const VPointer* _vpointer;
>> 568: int _original_index;
>
> Can also be made const:
> Suggestion:
>
> const int _original_index;
That does not work sadly:
In file included from /oracle-work/jdk-fork5/open/src/hotspot/share/classfile/classLoaderData.hpp:33,
from /oracle-work/jdk-fork5/open/src/hotspot/share/precompiled/precompiled.hpp:34:
/oracle-work/jdk-fork5/open/src/hotspot/share/utilities/growableArray.hpp: In instantiation of 'int GrowableArrayWithAllocator<E, Derived>::append(const E&) [with E = SuperWord::MemOp; Derived = GrowableArray<SuperWord::MemOp>]':
/oracle-work/jdk-fork5/open/src/hotspot/share/opto/superword.cpp:566:20: required from here
/oracle-work/jdk-fork5/open/src/hotspot/share/utilities/growableArray.hpp:414:22: error: use of deleted function 'SuperWord::MemOp& SuperWord::MemOp::operator=(const SuperWord::MemOp&)'
414 | this->_data[idx] = elem;
| ~~~~~~~~~~~~~~~~~^~~~~~
In file included from /oracle-work/jdk-fork5/open/src/hotspot/share/opto/superword.cpp:29:
/oracle-work/jdk-fork5/open/src/hotspot/share/opto/superword.hpp:564:9: note: 'SuperWord::MemOp& SuperWord::MemOp::operator=(const SuperWord::MemOp&)' is implicitly deleted because the default definition would be ill-formed:
564 | class MemOp : public StackObj {
| ^~~~~
/oracle-work/jdk-fork5/open/src/hotspot/share/opto/superword.hpp:564:9: error: non-static const member 'const int SuperWord::MemOp::_original_index', cannot use default assignment operator
It is a limitation with `GrowableArray`. But I think maybe more generally with sort: you need to be able to swap the values of different `MemOp`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21926#discussion_r1920967331
More information about the hotspot-compiler-dev
mailing list