RFR: null checks for architectures which cannot fold uncompress into address

Andrew Dinn adinn at redhat.com
Mon Jun 19 13:02:30 UTC 2017


Hi,

I just submitted a PR to fix a problem that manifests on AArch64 and,
possibly, on SPARC.

  https://github.com/graalvm/graal/pull/227

The problem on AArch64 is that null checks are still being inserted
before reads from narrow oop base addresses -- whereas on x86 the read
is used to perform an implicit null check.

This happens when UseTrappingNullChecksPhase detects a Read from an oop
base occurring within the scope of an enclosing IF IsNull(oop) test. The
IF is successfully removed but the Read fails to be recognised as
referring to the same oop as the IsNull check. So, instead of the Read
being used to trap the null case it is prefixed with a separate
NullCheck node.

The failure happens because the oop compare assumes that address
lowering has removed the intervening CompressNode which feeds the read.
Aarch64 cannot convert field addresses to the required form to achieve
this result because it does not provide a shifted register with offset
addressing mode.

The fix is to make the comparison smarter, indirecting through any
CompressionNode found as the base or index of the read address. I
suspect this will also help on SPARC since it too is not able to fold
out CompressionNode instances in its address lowering.

See the PR for full details.

regards,


Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander


More information about the graal-dev mailing list