RFR: 8308869: C2: use profile data in subtype checks when profile has more than one class [v6]

Roland Westrelin roland at openjdk.org
Thu Jun 22 07:02:05 UTC 2023


On Wed, 21 Jun 2023 14:33:10 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> Speaking of alternative ways to pass profile info around, you could just embed `ciCallProfile` in `SubTypeCheck`. Any particular reasons not to do so?

One thing to consider is that we don't necessarily want to common 2 `SubTypeCheck` nodes with the same object/super kass inputs. If we have something like:


if (...) {
  if (o instanceof C) {
  }
} else {
  if (o instanceof C) {
  }
}


There are 2 `SubTypeCheck` nodes with possibly different profile data. In order to common them, we would have to decide what profile data to keep (or drop profile data entirely) which could lead to less performant subtype checks. I think we want to decide on a case by case basis whether 2 `SubTypeCheck` nodes need to be commoned or not which is essentially what the logic I added does. Having extra edges makes that fairly straightforward.

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

PR Comment: https://git.openjdk.org/jdk/pull/14375#issuecomment-1602108426


More information about the hotspot-compiler-dev mailing list