RFR: 8267968: [PPC64] Use prefixed load and addi instructions for better performance in POWER10 [v2]
Kazunori Ogata
ogatak at openjdk.java.net
Wed Jun 9 02:30:13 UTC 2021
On Sun, 6 Jun 2021 20:08:41 GMT, Kazunori Ogata <ogatak at openjdk.org> wrote:
>> src/hotspot/cpu/ppc/ppc.ad line 2894:
>>
>>> 2892: if (loadConLNodes._small) nodes->push(loadConLNodes._small);
>>> 2893: if (loadConLNodes._large_hi) nodes->push(loadConLNodes._large_hi);
>>> 2894: if (loadConLNodes._large_lo) nodes->push(loadConLNodes._large_lo);
>>
>> Is removing the _last checking needed? lf it's needed, code related to _last should be removed such as in loadConLNodesTuple_create. Also, it would be better to use an if-else condition because it cannot happen both _small and _large_hi are non null.
>
> loadConLNodesTuple_create initializes loadConLNodes._last as it points to the same node that is either loadConLNodes._small or loadConLNodes._larege_lo. So loadConLNode is added twice if we don't remove _last checking. (I actually made this bug and spent a few days to fix it...)
>
> The correct code here should be either: 1) use the code before this change, i.e., don't add _small and _large_lo, and only use _last (and _large_hi), or 2) use _small and _large_lo, and remove _last, as I modified.
>
> I chose the option 2 to avoid confusion and to make the change symmetrical to change at [L.3459](https://github.com/openjdk/jdk/pull/4267/commits/403b789cc068ea74a0768406852bf79149b23e32#diff-d21a64a4949f298476bf91083d3b956face9a6393a08a706b071068898533082R3459), where adding _small is mandatory (_last points to other node here).
>
> If you (or other reviewers) think the option 1 is better, I can revert this change and add comments as a caveat.
I double checked the code and I realized we can't remove _last because the non-"ABI_ELFv2" version of postalloc_expand_java_to_runtime_call() uses _last field in more complex way. It only uses _last, and set _small, _large_hi, and _large_lo to NULL. So I think it's better to revert the changes w.r.t. _last and add comment to avoid confusion.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4267
More information about the hotspot-dev
mailing list