Mercurial > hg > graal-compiler
comparison src/share/vm/opto/compile.cpp @ 921:046932b72aa2
6862956: PhaseIdealLoop should have a CFG verification mode
Reviewed-by: kvn, twisti
author | never |
---|---|
date | Fri, 14 Aug 2009 00:02:12 -0700 |
parents | ea3f9723b5cf |
children | cd18bd5e667c |
comparison
equal
deleted
inserted
replaced
910:10d8c0d0d60e | 921:046932b72aa2 |
---|---|
1543 // Set loop opts counter | 1543 // Set loop opts counter |
1544 loop_opts_cnt = num_loop_opts(); | 1544 loop_opts_cnt = num_loop_opts(); |
1545 if((loop_opts_cnt > 0) && (has_loops() || has_split_ifs())) { | 1545 if((loop_opts_cnt > 0) && (has_loops() || has_split_ifs())) { |
1546 { | 1546 { |
1547 TracePhase t2("idealLoop", &_t_idealLoop, true); | 1547 TracePhase t2("idealLoop", &_t_idealLoop, true); |
1548 PhaseIdealLoop ideal_loop( igvn, NULL, true ); | 1548 PhaseIdealLoop ideal_loop( igvn, true ); |
1549 loop_opts_cnt--; | 1549 loop_opts_cnt--; |
1550 if (major_progress()) print_method("PhaseIdealLoop 1", 2); | 1550 if (major_progress()) print_method("PhaseIdealLoop 1", 2); |
1551 if (failing()) return; | 1551 if (failing()) return; |
1552 } | 1552 } |
1553 // Loop opts pass if partial peeling occurred in previous pass | 1553 // Loop opts pass if partial peeling occurred in previous pass |
1554 if(PartialPeelLoop && major_progress() && (loop_opts_cnt > 0)) { | 1554 if(PartialPeelLoop && major_progress() && (loop_opts_cnt > 0)) { |
1555 TracePhase t3("idealLoop", &_t_idealLoop, true); | 1555 TracePhase t3("idealLoop", &_t_idealLoop, true); |
1556 PhaseIdealLoop ideal_loop( igvn, NULL, false ); | 1556 PhaseIdealLoop ideal_loop( igvn, false ); |
1557 loop_opts_cnt--; | 1557 loop_opts_cnt--; |
1558 if (major_progress()) print_method("PhaseIdealLoop 2", 2); | 1558 if (major_progress()) print_method("PhaseIdealLoop 2", 2); |
1559 if (failing()) return; | 1559 if (failing()) return; |
1560 } | 1560 } |
1561 // Loop opts pass for loop-unrolling before CCP | 1561 // Loop opts pass for loop-unrolling before CCP |
1562 if(major_progress() && (loop_opts_cnt > 0)) { | 1562 if(major_progress() && (loop_opts_cnt > 0)) { |
1563 TracePhase t4("idealLoop", &_t_idealLoop, true); | 1563 TracePhase t4("idealLoop", &_t_idealLoop, true); |
1564 PhaseIdealLoop ideal_loop( igvn, NULL, false ); | 1564 PhaseIdealLoop ideal_loop( igvn, false ); |
1565 loop_opts_cnt--; | 1565 loop_opts_cnt--; |
1566 if (major_progress()) print_method("PhaseIdealLoop 3", 2); | 1566 if (major_progress()) print_method("PhaseIdealLoop 3", 2); |
1567 } | |
1568 if (!failing()) { | |
1569 // Verify that last round of loop opts produced a valid graph | |
1570 NOT_PRODUCT( TracePhase t2("idealLoopVerify", &_t_idealLoopVerify, TimeCompiler); ) | |
1571 PhaseIdealLoop::verify(igvn); | |
1567 } | 1572 } |
1568 } | 1573 } |
1569 if (failing()) return; | 1574 if (failing()) return; |
1570 | 1575 |
1571 // Conditional Constant Propagation; | 1576 // Conditional Constant Propagation; |
1595 if(loop_opts_cnt > 0) { | 1600 if(loop_opts_cnt > 0) { |
1596 debug_only( int cnt = 0; ); | 1601 debug_only( int cnt = 0; ); |
1597 while(major_progress() && (loop_opts_cnt > 0)) { | 1602 while(major_progress() && (loop_opts_cnt > 0)) { |
1598 TracePhase t2("idealLoop", &_t_idealLoop, true); | 1603 TracePhase t2("idealLoop", &_t_idealLoop, true); |
1599 assert( cnt++ < 40, "infinite cycle in loop optimization" ); | 1604 assert( cnt++ < 40, "infinite cycle in loop optimization" ); |
1600 PhaseIdealLoop ideal_loop( igvn, NULL, true ); | 1605 PhaseIdealLoop ideal_loop( igvn, true ); |
1601 loop_opts_cnt--; | 1606 loop_opts_cnt--; |
1602 if (major_progress()) print_method("PhaseIdealLoop iterations", 2); | 1607 if (major_progress()) print_method("PhaseIdealLoop iterations", 2); |
1603 if (failing()) return; | 1608 if (failing()) return; |
1604 } | 1609 } |
1605 } | 1610 } |
1611 | |
1612 { | |
1613 // Verify that all previous optimizations produced a valid graph | |
1614 // at least to this point, even if no loop optimizations were done. | |
1615 NOT_PRODUCT( TracePhase t2("idealLoopVerify", &_t_idealLoopVerify, TimeCompiler); ) | |
1616 PhaseIdealLoop::verify(igvn); | |
1617 } | |
1618 | |
1606 { | 1619 { |
1607 NOT_PRODUCT( TracePhase t2("macroExpand", &_t_macroExpand, TimeCompiler); ) | 1620 NOT_PRODUCT( TracePhase t2("macroExpand", &_t_macroExpand, TimeCompiler); ) |
1608 PhaseMacroExpand mex(igvn); | 1621 PhaseMacroExpand mex(igvn); |
1609 if (mex.expand_macro_nodes()) { | 1622 if (mex.expand_macro_nodes()) { |
1610 assert(failing(), "must bail out w/ explicit message"); | 1623 assert(failing(), "must bail out w/ explicit message"); |