[aarch64-port-dev ] RFR: 88158361: AArch64: Address calculation missed optimizations

Zhongwei Yao zhongwei.yao at linaro.org
Fri Jun 16 04:40:01 UTC 2017


Hi, all,
A missing rule (AddExtL_sxtw_imm) to match following test Java code is
added in this patch:
    z = y + (((long)x) << 2)  // where x is int, y is long, const number
(2) can be in range [0, 4] inclusively.

C2 generated following code before applying patch below:
    sbfiz x10, x1, #2, #32
    add x0, x2, x10

So after applying this patch, C2 generates:
    add x0, x2, w1, sxtw #2

And typically, Java code involving Unsafe address calculation will match
this rule:
     x = unsafe.getAddress(mem) + (((long)i) << 3) // where i is int

By the way, the counterpart sub extension rule (like SubExtL_sxtw_imm) is
also missing. And moreover, other add/sub extension rules (like
AddExtL_uxtb_and_shift, AddExtL_uxth_and_shift etc.) are also missing. But
these rules are not hit at all in my real world benchmark tests. I feel
they are too specific to be matched. So I do not include them in my patch.

And I found JDK-8158361 fit my fixing. If you feel it may not be
appropriate, I can create a new one for this patch.

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

Webrev:
http://cr.openjdk.java.net/~njian/8158361/webrev.00/

Please help to review it.

-- 
Best regards,
Zhongwei


More information about the aarch64-port-dev mailing list