[aarch64-port-dev ] RFR: aarch64: elide DecodeN when followed by CmpP 0
Vladimir Kozlov
vladimir.kozlov at oracle.com
Thu Sep 24 02:12:25 UTC 2015
Hi Ed,
args[0] is the load (ldr):
0x000003ff9d3e8920: ldr w11, [x1,#16]
0x000003ff9d3e8924: lsl x10, x11, #3
0x000003ff9d3e8928: cbnz x10, 0x000003ff9d3e8950
What about Andrew Dinn response few days ago? He said next change in
aarch64.ad fixed the problem:
bool Matcher::narrow_oop_use_complex_address() {
assert(UseCompressedOops, "only for compressed oops code");
return (LogMinObjAlignmentInBytes <= 3);
}
bool Matcher::narrow_klass_use_complex_address() {
assert(UseCompressedOops, "only for compressed oops code");
return (LogKlassAlignmentInBytes <= 3);
}
From what I see in aarch64.ad it support scaled memory which is
different from sparc:
operand indIndexScaledOffsetI(iRegP reg, iRegL lreg, immIScale scale,
immIU12 off)
%{
constraint(ALLOC_IN_RC(ptr_reg));
match(AddP (AddP reg (LShiftL lreg scale)) off);
Or I am missing something?
Thanks,
Vladimir
On 9/24/15 6:12 AM, Edward Nevill wrote:
>
>
> On Wed, Sep 16, 2015 at 5:06 PM, Vladimir Kozlov
> <vladimir.kozlov at oracle.com <mailto:vladimir.kozlov at oracle.com>> wrote:
>
> This is strange. Ideal graph should have CmpN in such case.
> See Compile::final_graph_reshaping_impl() case Op_CmpP:
> Please, look why CmpP is not converted in your case?
>
> Thanks,
> Vladimir
>
>
> Hi Vladimir.
>
> The reason CmpN is not generated in the case of aarch64 is the following
> test in final_graph_reshaping
>
> if (Matcher::gen_narrow_oop_implicit_null_checks())
> new_in2 = ConNode::make(TypeNarrowOop::NULL_PTR);
>
> This test converts the CmpP to CmpN if implicit null checks are being
> generated.
>
> For aarch64 the test above always returns false because
> Matcher::narrow_oop_use_complex_address() in aarch64.ad
> <http://aarch64.ad> returns false.
>
> The rational behind this seems to be that it is better to generate
>
> // Load_narrow_oop memory, narrow_oop_reg
> // Load [R12 + narrow_oop_reg<<3 + offset], val_reg
> // NullCheck narrow_oop_reg
>
> on architectures which support complex addresses (eg x86) and
>
> // Load_narrow_oop memory, narrow_oop_reg
> // decode_not_null narrow_oop_reg, base_reg
> // Load [base_reg + offset], val_reg
> // NullCheck base_reg
>
> on architectures which do not (eg aarch64, sparc, ppc).
>
> The problem is that this code assumes we are doing a load, whereas in my
> test case
>
> public class decode {
> public static void main(String[] args) {
> if (args[0] != null) {
> System.out.println("not null");
> }
> }
> }
>
> there is no load, it is just doing a check on a null pointer.
>
> All the best,
> Ed.
>
>
More information about the aarch64-port-dev
mailing list