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
8255120: C2: assert(outer->outcnt() >= phis + 2 && outer->outcnt() <=…
… phis + 2 + stores + 1) failed: only phis

Reviewed-by: thartmann
  • Loading branch information
Vladimir Ivanov committed Jan 14, 2021
1 parent 5926d75 commit 0148adf
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 26 deletions.
5 changes: 5 additions & 0 deletions src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp
Expand Up @@ -47,6 +47,8 @@ bool ShenandoahBarrierC2Support::expand(Compile* C, PhaseIterGVN& igvn) {
ShenandoahBarrierSetC2State* state = ShenandoahBarrierSetC2::bsc2()->state();
if ((state->enqueue_barriers_count() +
state->load_reference_barriers_count()) > 0) {
assert(C->post_loop_opts_phase(), "no loop opts allowed");
C->reset_post_loop_opts_phase(); // ... but we know what we are doing
bool attempt_more_loopopts = ShenandoahLoopOptsAfterExpansion;
C->clear_major_progress();
PhaseIdealLoop::optimize(igvn, LoopOptsShenandoahExpand);
Expand All @@ -59,7 +61,10 @@ bool ShenandoahBarrierC2Support::expand(Compile* C, PhaseIterGVN& igvn) {
return false;
}
C->clear_major_progress();

C->process_for_post_loop_opts_igvn(igvn);
}
C->set_post_loop_opts_phase(); // now for real!
}
return true;
}
Expand Down
38 changes: 16 additions & 22 deletions src/hotspot/share/opto/compile.cpp
Expand Up @@ -1834,16 +1834,21 @@ void Compile::remove_from_post_loop_opts_igvn(Node* n) {
}

void Compile::process_for_post_loop_opts_igvn(PhaseIterGVN& igvn) {
if (_for_post_loop_igvn.length() == 0) {
return; // no work to do
}
while (_for_post_loop_igvn.length() > 0) {
Node* n = _for_post_loop_igvn.pop();
n->remove_flag(Node::NodeFlags::Flag_for_post_loop_opts_igvn);
igvn._worklist.push(n);
// Verify that all previous optimizations produced a valid graph
// at least to this point, even if no loop optimizations were done.
PhaseIdealLoop::verify(igvn);

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

if (_for_post_loop_igvn.length() > 0) {
while (_for_post_loop_igvn.length() > 0) {
Node* n = _for_post_loop_igvn.pop();
n->remove_flag(Node::NodeFlags::Flag_for_post_loop_opts_igvn);
igvn._worklist.push(n);
}
igvn.optimize();
assert(_for_post_loop_igvn.length() == 0, "no more delayed nodes allowed");
}
igvn.optimize();
assert(_for_post_loop_igvn.length() == 0, "no more delayed nodes allowed");
}

// StringOpts and late inlining of string methods
Expand Down Expand Up @@ -2252,7 +2257,6 @@ void Compile::Optimize() {
}
if (!failing()) {
// Verify that last round of loop opts produced a valid graph
TracePhase tp("idealLoopVerify", &timers[_t_idealLoopVerify]);
PhaseIdealLoop::verify(igvn);
}
}
Expand Down Expand Up @@ -2287,15 +2291,9 @@ void Compile::Optimize() {

if (failing()) return;

// Ensure that major progress is now clear
C->clear_major_progress();
C->clear_major_progress(); // ensure that major progress is now clear

{
// Verify that all previous optimizations produced a valid graph
// at least to this point, even if no loop optimizations were done.
TracePhase tp("idealLoopVerify", &timers[_t_idealLoopVerify]);
PhaseIdealLoop::verify(igvn);
}
process_for_post_loop_opts_igvn(igvn);

#ifdef ASSERT
bs->verify_gc_barriers(this, BarrierSetC2::BeforeMacroExpand);
Expand All @@ -2320,10 +2318,6 @@ void Compile::Optimize() {
print_method(PHASE_BARRIER_EXPANSION, 2);
}

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

process_for_post_loop_opts_igvn(igvn);

if (C->max_vector_size() > 0) {
C->optimize_logic_cones(igvn);
igvn.optimize();
Expand Down
5 changes: 3 additions & 2 deletions src/hotspot/share/opto/compile.hpp
Expand Up @@ -689,8 +689,9 @@ class Compile : public Phase {
_predicate_opaqs.append(n);
}

bool post_loop_opts_phase() { return _post_loop_opts_phase; }
void set_post_loop_opts_phase() { _post_loop_opts_phase = true; }
bool post_loop_opts_phase() { return _post_loop_opts_phase; }
void set_post_loop_opts_phase() { _post_loop_opts_phase = true; }
void reset_post_loop_opts_phase() { _post_loop_opts_phase = false; }

void record_for_post_loop_opts_igvn(Node* n);
void remove_from_post_loop_opts_igvn(Node* n);
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/opto/loopnode.hpp
Expand Up @@ -1132,6 +1132,7 @@ class PhaseIdealLoop : public PhaseTransform {
static void verify(PhaseIterGVN& igvn) {
#ifdef ASSERT
ResourceMark rm;
Compile::TracePhase tp("idealLoopVerify", &timers[_t_idealLoopVerify]);
PhaseIdealLoop v(igvn);
#endif
}
Expand Down
2 changes: 0 additions & 2 deletions test/hotspot/jtreg/ProblemList.txt
Expand Up @@ -64,8 +64,6 @@ compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java 8183263 generic-x64

compiler/c2/Test8004741.java 8235801 generic-all

compiler/loopstripmining/BackedgeNodeWithOutOfLoopControl.java 8255120 generic-all

#############################################################################

# :hotspot_gc
Expand Down

1 comment on commit 0148adf

@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.