RFR: 8342393: Promote commutative vector IR node sharing [v2]

Emanuel Peter epeter at openjdk.org
Wed Jan 8 13:05:41 UTC 2025


On Wed, 8 Jan 2025 10:42:03 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> src/hotspot/share/opto/vectornode.hpp line 78:
>> 
>>> 76:   virtual uint hash() const {
>>> 77:     if (is_commutative_operation()) {
>>> 78:       return (uintptr_t)in(1) + (uintptr_t)in(2) + Opcode();
>> 
>> Commutative implies the operation is binary (`req == 3`). Should there be an assert somewhere to ensure it's always the case (ideally, when marking a node as commutative during construction)?
>
> Assertion check added.

Where did you add it? I don't see it in the constructor or `add_flag`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22863#discussion_r1907132372


More information about the hotspot-compiler-dev mailing list