RFR: 8347405: MergeStores with reverse bytes order value [v5]
Emanuel Peter
epeter at openjdk.org
Mon Jan 20 07:36:43 UTC 2025
On Fri, 10 Jan 2025 12:51:11 GMT, kuaiwei <duke at openjdk.org> wrote:
>> src/hotspot/share/opto/memnode.cpp line 3044:
>>
>>> 3042: shift_out = 0;
>>> 3043: return true;
>>> 3044: }
>>
>> Can you tell me why you added this?
>
> 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 ;)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23030#discussion_r1921912026
More information about the hotspot-compiler-dev
mailing list