Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk16 Public archive

Commit 0148adf

Browse files
author
Vladimir Ivanov
committed
8255120: C2: assert(outer->outcnt() >= phis + 2 && outer->outcnt() <= phis + 2 + stores + 1) failed: only phis
Reviewed-by: thartmann
1 parent 5926d75 commit 0148adf

File tree

5 files changed

+25
-26
lines changed

5 files changed

+25
-26
lines changed

src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ bool ShenandoahBarrierC2Support::expand(Compile* C, PhaseIterGVN& igvn) {
4747
ShenandoahBarrierSetC2State* state = ShenandoahBarrierSetC2::bsc2()->state();
4848
if ((state->enqueue_barriers_count() +
4949
state->load_reference_barriers_count()) > 0) {
50+
assert(C->post_loop_opts_phase(), "no loop opts allowed");
51+
C->reset_post_loop_opts_phase(); // ... but we know what we are doing
5052
bool attempt_more_loopopts = ShenandoahLoopOptsAfterExpansion;
5153
C->clear_major_progress();
5254
PhaseIdealLoop::optimize(igvn, LoopOptsShenandoahExpand);
@@ -59,7 +61,10 @@ bool ShenandoahBarrierC2Support::expand(Compile* C, PhaseIterGVN& igvn) {
5961
return false;
6062
}
6163
C->clear_major_progress();
64+
65+
C->process_for_post_loop_opts_igvn(igvn);
6266
}
67+
C->set_post_loop_opts_phase(); // now for real!
6368
}
6469
return true;
6570
}

src/hotspot/share/opto/compile.cpp

+16-22
Original file line numberDiff line numberDiff line change
@@ -1834,16 +1834,21 @@ void Compile::remove_from_post_loop_opts_igvn(Node* n) {
18341834
}
18351835

18361836
void Compile::process_for_post_loop_opts_igvn(PhaseIterGVN& igvn) {
1837-
if (_for_post_loop_igvn.length() == 0) {
1838-
return; // no work to do
1839-
}
1840-
while (_for_post_loop_igvn.length() > 0) {
1841-
Node* n = _for_post_loop_igvn.pop();
1842-
n->remove_flag(Node::NodeFlags::Flag_for_post_loop_opts_igvn);
1843-
igvn._worklist.push(n);
1837+
// Verify that all previous optimizations produced a valid graph
1838+
// at least to this point, even if no loop optimizations were done.
1839+
PhaseIdealLoop::verify(igvn);
1840+
1841+
C->set_post_loop_opts_phase(); // no more loop opts allowed
1842+
1843+
if (_for_post_loop_igvn.length() > 0) {
1844+
while (_for_post_loop_igvn.length() > 0) {
1845+
Node* n = _for_post_loop_igvn.pop();
1846+
n->remove_flag(Node::NodeFlags::Flag_for_post_loop_opts_igvn);
1847+
igvn._worklist.push(n);
1848+
}
1849+
igvn.optimize();
1850+
assert(_for_post_loop_igvn.length() == 0, "no more delayed nodes allowed");
18441851
}
1845-
igvn.optimize();
1846-
assert(_for_post_loop_igvn.length() == 0, "no more delayed nodes allowed");
18471852
}
18481853

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

22882292
if (failing()) return;
22892293

2290-
// Ensure that major progress is now clear
2291-
C->clear_major_progress();
2294+
C->clear_major_progress(); // ensure that major progress is now clear
22922295

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

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

2323-
C->set_post_loop_opts_phase(); // no more loop opts allowed
2324-
2325-
process_for_post_loop_opts_igvn(igvn);
2326-
23272321
if (C->max_vector_size() > 0) {
23282322
C->optimize_logic_cones(igvn);
23292323
igvn.optimize();

src/hotspot/share/opto/compile.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,9 @@ class Compile : public Phase {
689689
_predicate_opaqs.append(n);
690690
}
691691

692-
bool post_loop_opts_phase() { return _post_loop_opts_phase; }
693-
void set_post_loop_opts_phase() { _post_loop_opts_phase = true; }
692+
bool post_loop_opts_phase() { return _post_loop_opts_phase; }
693+
void set_post_loop_opts_phase() { _post_loop_opts_phase = true; }
694+
void reset_post_loop_opts_phase() { _post_loop_opts_phase = false; }
694695

695696
void record_for_post_loop_opts_igvn(Node* n);
696697
void remove_from_post_loop_opts_igvn(Node* n);

src/hotspot/share/opto/loopnode.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,7 @@ class PhaseIdealLoop : public PhaseTransform {
11321132
static void verify(PhaseIterGVN& igvn) {
11331133
#ifdef ASSERT
11341134
ResourceMark rm;
1135+
Compile::TracePhase tp("idealLoopVerify", &timers[_t_idealLoopVerify]);
11351136
PhaseIdealLoop v(igvn);
11361137
#endif
11371138
}

test/hotspot/jtreg/ProblemList.txt

-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java 8183263 generic-x64
6464

6565
compiler/c2/Test8004741.java 8235801 generic-all
6666

67-
compiler/loopstripmining/BackedgeNodeWithOutOfLoopControl.java 8255120 generic-all
68-
6967
#############################################################################
7068

7169
# :hotspot_gc

0 commit comments

Comments
 (0)