RFR: 8369002: Extract the loop->is_member(get_loop(get_ctrl(node))) pattern in a new function

Anton Seoane Ampudia aseoane at openjdk.org
Wed Nov 12 08:57:13 UTC 2025


This PR adds a "shorthand" for the common `loop->is_member(get_loop(get_ctrl(node)))` pattern in loop optimizations.

In PhaseIdealLoop, there is already an `is_member` function that checks if a node is a (nested) member of an IdealLoopTree. In a similar fashion, this changeset adds a `ctrl_is_member` that aims to simplify the common pattern of:

Node* node_ctrl = get_ctrl(node);
if (loop->is_member(get_loop(node))) { ... }


This hopes to provide a bit more readability and code conciseness in such a common operation.

**Testing:** passes tiers 1-3

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

Commit messages:
 - Small fix
 - Intial commit

Changes: https://git.openjdk.org/jdk/pull/28259/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28259&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8369002
  Stats: 39 lines in 6 files changed: 7 ins; 7 del; 25 mod
  Patch: https://git.openjdk.org/jdk/pull/28259.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28259/head:pull/28259

PR: https://git.openjdk.org/jdk/pull/28259


More information about the hotspot-compiler-dev mailing list