6394013: C2: Remove VerifyOpto

Removed the VerifyOpto flag.

Reviewed-by: kvn, thartmann
This commit is contained in:
Christian Hagedorn 2019-08-05 08:03:25 +02:00 committed by Tobias Hartmann
parent e163037e31
commit a3c85f810c
9 changed files with 5 additions and 104 deletions

View File

@ -107,9 +107,6 @@
notproduct(bool, PrintOptoInlining, false, \
"Print compiler2 inlining decisions") \
\
notproduct(bool, VerifyOpto, false, \
"Apply more time consuming verification during compilation") \
\
notproduct(bool, VerifyIdealNodeCount, false, \
"Verify that tracked dead ideal node count is accurate") \
\

View File

@ -1190,7 +1190,7 @@ void PhaseChaitin::Simplify( ) {
while ((neighbor = elements.next()) != 0) {
LRG *n = &lrgs(neighbor);
#ifdef ASSERT
if( VerifyOpto || VerifyRegisterAllocator ) {
if (VerifyRegisterAllocator) {
assert( _ifg->effective_degree(neighbor) == n->degree(), "" );
}
#endif

View File

@ -1480,12 +1480,6 @@ Node* IfNode::dominated_by(Node* prev_dom, PhaseIterGVN *igvn) {
if (TraceIterativeGVN) {
tty->print(" Removing IfNode: "); this->dump();
}
if (VerifyOpto && !igvn->allow_progress()) {
// Found an equivalent dominating test,
// we can not guarantee reaching a fix-point for these during iterativeGVN
// since intervening nodes may not change.
return NULL;
}
#endif
igvn->hash_delete(this); // Remove self to prevent spurious V-N

View File

@ -211,20 +211,10 @@ class IndexSet : public ResourceObj {
// Individual IndexSets can be placed on a free list. This is done in PhaseLive.
IndexSet *next() {
#ifdef ASSERT
if( VerifyOpto ) {
check_watch("removed from free list?", ((_next == NULL) ? 0 : _next->_serial_number));
}
#endif
return _next;
}
void set_next(IndexSet *next) {
#ifdef ASSERT
if( VerifyOpto ) {
check_watch("put on free list?", ((next == NULL) ? 0 : next->_serial_number));
}
#endif
_next = next;
}
@ -239,10 +229,6 @@ class IndexSet : public ResourceObj {
// Set a block in the top level array
void set_block(uint index, BitBlock *block) {
#ifdef ASSERT
if( VerifyOpto )
check_watch("set block", index);
#endif
_blocks[index] = block;
}
@ -259,10 +245,6 @@ class IndexSet : public ResourceObj {
//-------------------------- Primitive set operations --------------------------
void clear() {
#ifdef ASSERT
if( VerifyOpto )
check_watch("clear");
#endif
_count = 0;
for (uint i = 0; i < _max_blocks; i++) {
BitBlock *block = _blocks[i];
@ -281,10 +263,6 @@ class IndexSet : public ResourceObj {
}
bool insert(uint element) {
#ifdef ASSERT
if( VerifyOpto )
check_watch("insert", element);
#endif
if (element == 0) {
return 0;
}
@ -300,11 +278,6 @@ class IndexSet : public ResourceObj {
}
bool remove(uint element) {
#ifdef ASSERT
if( VerifyOpto )
check_watch("remove", element);
#endif
BitBlock *block = get_block_containing(element);
bool present = block->remove(element);
if (present) {

View File

@ -383,7 +383,7 @@ void PhaseChaitin::verify_base_ptrs( ResourceArea *a ) const {
// Verify that graphs and base pointers are still sane.
void PhaseChaitin::verify( ResourceArea *a, bool verify_ifg ) const {
#ifdef ASSERT
if( VerifyOpto || VerifyRegisterAllocator ) {
if (VerifyRegisterAllocator) {
_cfg.verify();
verify_base_ptrs(a);
if(verify_ifg)

View File

@ -1427,9 +1427,8 @@ void PhaseIdealLoop::split_if_with_blocks_post(Node *n) {
// Some institutional knowledge is needed here: 'x' is
// yanked because if the optimizer runs GVN on it all the
// cloned x's will common up and undo this optimization and
// be forced back in the loop. This is annoying because it
// makes +VerifyOpto report false-positives on progress. I
// tried setting control edges on the x's to force them to
// be forced back in the loop.
// I tried setting control edges on the x's to force them to
// not combine, but the matching gets worried when it tries
// to fold a StoreP and an AddP together (as part of an
// address expression) and the AddP and StoreP have

View File

@ -1308,8 +1308,7 @@ static void kill_dead_code( Node *dead, PhaseIterGVN *igvn ) {
// Con's are a popular node to re-hit in the hash table again.
if( dead->is_Con() ) return;
// Can't put ResourceMark here since igvn->_worklist uses the same arena
// for verify pass with +VerifyOpto and we add/remove elements in it here.
ResourceMark rm;
Node_List nstack(Thread::current()->resource_area());
Node *top = igvn->C->top();

View File

@ -240,12 +240,6 @@ bool NodeHash::hash_delete( const Node *n ) {
k = _table[key]; // Get hashed value
if( !k ) { // Miss?
NOT_PRODUCT( _delete_misses++ );
#ifdef ASSERT
if( VerifyOpto ) {
for( uint i=0; i < _max; i++ )
assert( _table[i] != n, "changed edges with rehashing" );
}
#endif
return false; // Miss! Not in chain
}
else if( n == k ) {
@ -707,13 +701,6 @@ PhaseValues::PhaseValues( PhaseValues *ptv ) : PhaseTransform( ptv, GVN ),
NOT_PRODUCT( clear_new_values(); )
}
//------------------------------PhaseValues------------------------------------
// Used by +VerifyOpto. Clear out hash table but copy _types array.
PhaseValues::PhaseValues( PhaseValues *ptv, const char *dummy ) : PhaseTransform( ptv, GVN ),
_table(ptv->arena(),ptv->_table.size()) {
NOT_PRODUCT( clear_new_values(); )
}
//------------------------------~PhaseValues-----------------------------------
#ifndef PRODUCT
PhaseValues::~PhaseValues() {
@ -948,14 +935,6 @@ void PhaseGVN::dead_loop_check( Node *n ) {
#endif
//=============================================================================
//------------------------------PhaseIterGVN-----------------------------------
// Initialize hash table to fresh and clean for +VerifyOpto
PhaseIterGVN::PhaseIterGVN( PhaseIterGVN *igvn, const char *dummy ) : PhaseGVN(igvn,dummy),
_delay_transform(false),
_stack(C->live_nodes() >> 1),
_worklist( ) {
}
//------------------------------PhaseIterGVN-----------------------------------
// Initialize with previous PhaseIterGVN info; used by PhaseCCP
PhaseIterGVN::PhaseIterGVN( PhaseIterGVN *igvn ) : PhaseGVN(igvn),
@ -1134,24 +1113,6 @@ void PhaseIterGVN::verify_PhaseIterGVN() {
#endif
C->verify_graph_edges();
if( VerifyOpto && allow_progress() ) {
// Must turn off allow_progress to enable assert and break recursion
C->root()->verify();
{ // Check if any progress was missed using IterGVN
// Def-Use info enables transformations not attempted in wash-pass
// e.g. Region/Phi cleanup, ...
// Null-check elision -- may not have reached fixpoint
// do not propagate to dominated nodes
ResourceMark rm;
PhaseIterGVN igvn2(this,"Verify"); // Fresh and clean!
// Fill worklist completely
igvn2.init_worklist(C->root());
igvn2.set_allow_progress(false);
igvn2.optimize();
igvn2.set_allow_progress(true);
}
}
if (VerifyIterativeGVN && PrintOpto) {
if (_verify_counter == _verify_full_passes) {
tty->print_cr("VerifyIterativeGVN: %d transforms and verify passes",
@ -1276,22 +1237,6 @@ Node *PhaseIterGVN::transform_old(Node* n) {
assert(i != k || is_new || i->outcnt() > 0, "don't return dead nodes");
#ifndef PRODUCT
verify_step(k);
if (i && VerifyOpto ) {
if (!allow_progress()) {
if (i->is_Add() && (i->outcnt() == 1)) {
// Switched input to left side because this is the only use
} else if (i->is_If() && (i->in(0) == NULL)) {
// This IF is dead because it is dominated by an equivalent IF When
// dominating if changed, info is not propagated sparsely to 'this'
// Propagating this info further will spuriously identify other
// progress.
return i;
} else
set_progress();
} else {
set_progress();
}
}
#endif
while (i != NULL) {
@ -1318,9 +1263,6 @@ Node *PhaseIterGVN::transform_old(Node* n) {
assert(i != k || is_new || (i->outcnt() > 0), "don't return dead nodes");
#ifndef PRODUCT
verify_step(k);
if (i && VerifyOpto) {
set_progress();
}
#endif
}

View File

@ -377,7 +377,6 @@ protected:
public:
PhaseValues( Arena *arena, uint est_max_size );
PhaseValues( PhaseValues *pt );
PhaseValues( PhaseValues *ptv, const char *dummy );
NOT_PRODUCT( ~PhaseValues(); )
virtual PhaseIterGVN *is_IterGVN() { return 0; }
@ -418,7 +417,6 @@ protected:
public:
PhaseGVN( Arena *arena, uint est_max_size ) : PhaseValues( arena, est_max_size ) {}
PhaseGVN( PhaseGVN *gvn ) : PhaseValues( gvn ) {}
PhaseGVN( PhaseGVN *gvn, const char *dummy ) : PhaseValues( gvn, dummy ) {}
// Return a node which computes the same function as this node, but
// in a faster or cheaper fashion.
@ -474,7 +472,6 @@ protected:
public:
PhaseIterGVN( PhaseIterGVN *igvn ); // Used by CCP constructor
PhaseIterGVN( PhaseGVN *gvn ); // Used after Parser
PhaseIterGVN( PhaseIterGVN *igvn, const char *dummy ); // Used after +VerifyOpto
// Idealize new Node 'n' with respect to its inputs and its value
virtual Node *transform( Node *a_node );