A very common pattern in loop optimizations is the following:
node_ctrl = get_ctrl(node);
if (loop->is_member(get_loop(node))) { ... }
In PhaseIdealLoop, there is already:
int is_member( const IdealLoopTree *loop, Node *n ) const {
return loop->is_member(get_loop(n)); }
We should have a similar version that also takes care of the get_ctrl call, and replace the occurrences of this common pattern with the new function.
The return type of the existing PhaseIdealLoop::is_member should also be changed to bool to be consistent with IdealLoopTree::is_member.
This was originally suggested by [~roland] in this comment: https://github.com/openjdk/jdk/pull/27225#discussion_r2391684977
node_ctrl = get_ctrl(node);
if (loop->is_member(get_loop(node))) { ... }
In PhaseIdealLoop, there is already:
int is_member( const IdealLoopTree *loop, Node *n ) const {
return loop->is_member(get_loop(n)); }
We should have a similar version that also takes care of the get_ctrl call, and replace the occurrences of this common pattern with the new function.
The return type of the existing PhaseIdealLoop::is_member should also be changed to bool to be consistent with IdealLoopTree::is_member.
This was originally suggested by [~roland] in this comment: https://github.com/openjdk/jdk/pull/27225#discussion_r2391684977