RFR: 8347405: MergeStores with reverse bytes order value [v5]

kuaiwei duke at openjdk.org
Tue Jan 21 06:28:43 UTC 2025


On Mon, 20 Jan 2025 07:28:59 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> When I debug a case, I found a base node is a LoadNode, and the rest shift nodes are derived from it. Because the LoadNode is not recognized as a shift node, all of them can not be merged.  Here I parse node with Int or Long type as "base << 0".
>
> Ah, I see. Can you add a comment in the code for that?
> `// (base << 0)`
> 
> Actually, I was wondering why we did not discover this before....
> And found this code:
> 
>   Node const* base_n1;
>   jint shift_n1;
>   if (n1 == base_n2) {
>     // n1 = base = base >> 0
>     base_n1 = n1;
>     shift_n1 = 0;
> 
> Do we still need this, or could we now remove that section with your change here? Just don't want to patternmatch the same in multiple places if not necessary ;)

Yes, I think we can remove this. It's already checked in is_con_RShift(). 
And I also checked the code which look through ConvL2I.
```c++
    if (n1->Opcode() == Op_ConvL2I) {
      // look through
      n1 = n1->in(1);
    }


May I remove them too?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23030#discussion_r1923134409


More information about the hotspot-compiler-dev mailing list