@@ -1834,16 +1834,21 @@ void Compile::remove_from_post_loop_opts_igvn(Node* n) {
1834
1834
}
1835
1835
1836
1836
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" );
1844
1851
}
1845
- igvn.optimize ();
1846
- assert (_for_post_loop_igvn.length () == 0 , " no more delayed nodes allowed" );
1847
1852
}
1848
1853
1849
1854
// StringOpts and late inlining of string methods
@@ -2252,7 +2257,6 @@ void Compile::Optimize() {
2252
2257
}
2253
2258
if (!failing ()) {
2254
2259
// Verify that last round of loop opts produced a valid graph
2255
- TracePhase tp (" idealLoopVerify" , &timers[_t_idealLoopVerify]);
2256
2260
PhaseIdealLoop::verify (igvn);
2257
2261
}
2258
2262
}
@@ -2287,15 +2291,9 @@ void Compile::Optimize() {
2287
2291
2288
2292
if (failing ()) return ;
2289
2293
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
2292
2295
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);
2299
2297
2300
2298
#ifdef ASSERT
2301
2299
bs->verify_gc_barriers (this , BarrierSetC2::BeforeMacroExpand);
@@ -2320,10 +2318,6 @@ void Compile::Optimize() {
2320
2318
print_method (PHASE_BARRIER_EXPANSION, 2 );
2321
2319
}
2322
2320
2323
- C->set_post_loop_opts_phase (); // no more loop opts allowed
2324
-
2325
- process_for_post_loop_opts_igvn (igvn);
2326
-
2327
2321
if (C->max_vector_size () > 0 ) {
2328
2322
C->optimize_logic_cones (igvn);
2329
2323
igvn.optimize ();
0 commit comments