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

Emanuel Peter epeter at openjdk.org
Wed Jan 22 07:33:44 UTC 2025


On Wed, 22 Jan 2025 07:19:04 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Adding functional verification to test points using Verify.checkEQ
>
> src/hotspot/share/opto/phaseX.cpp line 67:
> 
>> 65: //-----------------------------------------------------------------------------
>> 66: 
>> 67: bool NodeHash::check_for_collision(const Node* n, const Node* k) const {
> 
> Suggestion:
> 
> bool NodeHash::have_equivalent_inputs(const Node* n, const Node* k) const {
> 
> I think that would be a bit more explicit.

Then you have to switch the output bool values true <-> false.

> src/hotspot/share/opto/phaseX.cpp line 114:
> 
>> 112:         k->Opcode() == op ) {   // Same Opcode
>> 113:       bool collision = check_for_collision(n, k);
>> 114:       if (collision == false && n->cmp(*k)) {  // Check for any special bits
> 
> Suggestion:
> 
>       if (!collision && n->cmp(*k)) {  // Check for any special bits

A renaming of `check_for_collision` -> `have_equivalent_inputs` (with swap of true <-> false) would make this a bit more readable now, right?
Suggestion:

      if (have_equivalent_inputs(n, k) && n->cmp(*k)) {  // Check for any special bits

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

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


More information about the hotspot-compiler-dev mailing list