RFR: 8273277: C2: Move conditional negation into rc_predicate

Nils Eliasson neliasso at openjdk.java.net
Mon Oct 18 14:40:10 UTC 2021


Hi,

I need some feedback on this patch. This was reported from Tencent and found in internal testing about the same time. This patch is based on a a patch provided by Tencent.

In some very specific circumstances we need to negate the range checks that we create in PhaseIdealLoop::loop_predication_impl_helper. This is done in three places, but that method also calls insert_initial_skeleton_predicate where this isn't taken into account. 

To simplify things I have moved the negation logic into rc_predicate. This should prevent us from missing this check again.

I do have a concern that negating the condition of the rangecheck in the skeleton predicate, since the skeleton predicate will be used as a clone template, and some rangechecks optimizations seems to assume that range checks always have LT as the condidtion. On the other hand - it is a really uncommon scenario since we haven't failed here before.

Feedback appreciated.

Best regards,
Nils

-------------

Commit messages:
 - 8273277 fix rc_predicate

Changes: https://git.openjdk.java.net/jdk/pull/5987/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5987&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8273277
  Stats: 27 lines in 3 files changed: 3 ins; 12 del; 12 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5987.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5987/head:pull/5987

PR: https://git.openjdk.java.net/jdk/pull/5987


More information about the hotspot-compiler-dev mailing list