mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8260370: C2: LoopLimit node is not eliminated
Reviewed-by: kvn, thartmann
This commit is contained in:
parent
408772c966
commit
e28e11119d
2 changed files with 9 additions and 1 deletions
|
@ -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();
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue