8266542: Remove broken -XX:-UseLoopSafepoints flag

Reviewed-by: tschatzl, kvn
This commit is contained in:
Tobias Hartmann 2021-05-06 07:36:28 +00:00
parent 7835cdbef4
commit 22ca62c2cb
5 changed files with 10 additions and 56 deletions

View File

@ -480,7 +480,7 @@ class Parse : public GraphKit {
// Insert a compiler safepoint into the graph, if there is a back-branch.
void maybe_add_safepoint(int target_bci) {
if (UseLoopSafepoints && target_bci <= bci()) {
if (target_bci <= bci()) {
add_safepoint();
}
}

View File

@ -485,7 +485,7 @@ void Parse::do_tableswitch() {
}
// Safepoint in case if backward branch observed
if (makes_backward_branch && UseLoopSafepoints) {
if (makes_backward_branch) {
add_safepoint();
}
@ -579,7 +579,7 @@ void Parse::do_lookupswitch() {
}
// Safepoint in case backward branch observed
if (makes_backward_branch && UseLoopSafepoints) {
if (makes_backward_branch) {
add_safepoint();
}
@ -2555,8 +2555,7 @@ void Parse::do_one_bytecode() {
// a SafePoint here and have it dominate and kill the safepoint added at a
// following backwards branch. At this point the JVM state merely holds 2
// longs but not the 3-way value.
if( UseLoopSafepoints ) {
switch( iter().next_bc() ) {
switch (iter().next_bc()) {
case Bytecodes::_ifgt:
case Bytecodes::_iflt:
case Bytecodes::_ifge:
@ -2567,7 +2566,6 @@ void Parse::do_one_bytecode() {
maybe_add_safepoint(iter().next_get_dest());
default:
break;
}
}
b = pop_pair();
a = pop_pair();

View File

@ -407,10 +407,11 @@ void NodeHash::operator=(const NodeHash& nh) {
//------------------------------PhaseRemoveUseless-----------------------------
// 1) Use a breadthfirst walk to collect useful nodes reachable from root.
PhaseRemoveUseless::PhaseRemoveUseless(PhaseGVN* gvn, Unique_Node_List* worklist, PhaseNumber phase_num) : Phase(phase_num) {
// Implementation requires 'UseLoopSafepoints == true' and an edge from root
// to each SafePointNode at a backward branch. Inserted in add_safepoint().
if( !UseLoopSafepoints || !OptoRemoveUseless ) return;
// Implementation requires an edge from root to each SafePointNode
// at a backward branch. Inserted in add_safepoint().
if (!OptoRemoveUseless) {
return;
}
// Identify nodes that are reachable from below, useful.
C->identify_useful_nodes(_useful);
@ -993,8 +994,7 @@ PhaseIterGVN::PhaseIterGVN(PhaseGVN* gvn) : PhaseGVN(gvn),
if(n != NULL && n != _table.sentinel() && n->outcnt() == 0) {
if( n->is_top() ) continue;
// If remove_useless_nodes() has run, we expect no such nodes left.
assert(!UseLoopSafepoints || !OptoRemoveUseless,
"remove_useless_nodes missed this node");
assert(!OptoRemoveUseless, "remove_useless_nodes missed this node");
hash_delete(n);
}
}

View File

@ -1146,9 +1146,6 @@ const intx ObjectAlignmentInBytes = 8;
notproduct(bool, CollectIndexSetStatistics, false, \
"Collect information about IndexSets") \
\
develop(bool, UseLoopSafepoints, true, \
"Generate Safepoint nodes in every loop") \
\
develop(intx, FastAllocateSizeLimit, 128*K, \
/* Note: This value is zero mod 1<<13 for a cheap sparc set. */ \
"Inline allocations larger than this in doublewords must go slow")\

View File

@ -1,41 +0,0 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 6232281
* @requires vm.debug == true & vm.compiler2.enabled
* @summary Tests that C2 does not crash trivially with a "remove_useless_nodes
* missed this node" message when UseLoopSafepoints is disabled.
* @run main/othervm -Xcomp -XX:-TieredCompilation
-XX:CompileOnly=TestDisableUseLoopSafepoints -XX:-UseLoopSafepoints
* compiler.arguments.TestDisableUseLoopSafepoints
*/
package compiler.arguments;
public class TestDisableUseLoopSafepoints {
public static void main(String[] args) {
System.out.println("Passed");
}
}