Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
8260370: C2: LoopLimit node is not eliminated
Reviewed-by: kvn, thartmann
  • Loading branch information
Vladimir Ivanov committed Jan 27, 2021
1 parent 408772c commit e28e111
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/hotspot/share/opto/compile.cpp
Expand Up @@ -1840,6 +1840,8 @@ void Compile::process_for_post_loop_opts_igvn(PhaseIterGVN& igvn) {

C->set_post_loop_opts_phase(); // no more loop opts allowed

assert(!C->major_progress(), "not cleared");

if (_for_post_loop_igvn.length() > 0) {
while (_for_post_loop_igvn.length() > 0) {
Node* n = _for_post_loop_igvn.pop();
Expand All @@ -1848,6 +1850,11 @@ void Compile::process_for_post_loop_opts_igvn(PhaseIterGVN& igvn) {
}
igvn.optimize();
assert(_for_post_loop_igvn.length() == 0, "no more delayed nodes allowed");

// Sometimes IGVN sets major progress (e.g., when processing loop nodes).
if (C->major_progress()) {
C->clear_major_progress(); // ensure that major progress is now clear
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/opto/loopnode.cpp
Expand Up @@ -1921,8 +1921,9 @@ Node *LoopLimitNode::Ideal(PhaseGVN *phase, bool can_reshape) {

// Delay following optimizations until all loop optimizations
// done to keep Ideal graph simple.
if (!can_reshape || phase->C->major_progress())
if (!can_reshape || !phase->C->post_loop_opts_phase()) {
return NULL;
}

const TypeInt* init_t = phase->type(in(Init) )->is_int();
const TypeInt* limit_t = phase->type(in(Limit))->is_int();
Expand Down

1 comment on commit e28e111

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.