8168318 Use cmpdi instead of li/cmpd

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Fri Oct 21 07:19:41 UTC 2016


Hi,

Basically, the new rule looks good.

I still wonder why you observe this pattern frequently.  I think
in general there should be a CmpN.

In which compressed oops mode do you run?  You can check this with
-XX:+PrintCompressedOopsMode.
There are 4 variants, each with different code to decode/encode the oop:
Heap address: 0x00000000c0000000, size: 1024 MB, Compressed Oops mode: 32-bit
Heap address: 0x0000000100000000, size: 3016 MB, Compressed Oops mode: Zero based, Oop shift amount: 3
Heap address: 0x0000000800200000, size: 3016 MB, Compressed Oops mode: Non-zero disjoint base: 0x0000000800000000, Oop shift amount: 3
Heap address: 0x0000000840200000, size: 3016 MB, Compressed Oops mode: Non-zero based: 0x0000000840000000, Oop shift amount: 3

You can select the variants by specifying where to put the heap:  -XX:HeapBaseMinAddress=4G / 32G / 33G

Or are you running without compressed oops?

Also, which node is in[1] of the CmpP that is matched?  Is it a DecodeN?

DecodeN is usually  (narrow_oop  << 'Oop shift amount') + 'Heap base'.
If Heap base != 0, this does not preserve NULL, thus it is
Narrow_oop == 0 ? 0 : (narrow_oop  << 'Oop shift amount') + Heap base.

Also, have a look at compile.cpp, final_graph_reshaping_impl(), line 3035.
Is this code applied wrongly?  It is the preparation of the null check optimization
in lcm.cpp.

Consider that on ppc the page at address
'0' is not read protected.  The null check optimization described there
only works in 'Non-zero disjoint base' and 'Non-zero based' compressed
Oop modes.  In those modes, the first page of the heap is write protected.
(See difference between heap address and heap base address in above output.)
DecodeN_notNull(null) will result in a value that touches that page.

Also, please post RFRs to one of the official openJdk lists, in this case compiler. Anything
pushed to an official repo must be reviewed on these lists.  Ppc-aix-port-dev is
only for questions wrt. to the port.

Best regards,
  Goetz.




From: ppc-aix-port-dev [mailto:ppc-aix-port-dev-bounces at openjdk.java.net] On Behalf Of Igor Henrique Soares Nunes
Sent: Donnerstag, 20. Oktober 2016 17:37
To: ppc-aix-port-dev at openjdk.java.net
Subject: RFR: 8168318 Use cmpdi instead of li/cmpd

Hi all,

The following change, fix the issue addressed in Gustavo's previous e-mail:





=== Use cmpdi instead of li/cmpd (r14 killed after this).

3fff60240bec:      li      r14,0

3fff60240bf0:      cmpld   cr6,r3,r14



In order to fix this issue a new instruct was created to match Set crx (CmpP src1 src2) when src2 is a null pointer.



Webrev: https://igorsnunes.github.io/openjdk/webrev/8168318/

Bug: https://bugs.openjdk.java.net/browse/JDK-8168318



Thanks,



Igor Nunes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20161021/86fdd71e/attachment-0001.html>


More information about the hotspot-compiler-dev mailing list