6394013: C2: Remove VerifyOpto
authorthartmann
Mon, 05 Aug 2019 08:03:25 +0200
changeset 57632 9c523692db7e
parent 57631 a26bc1847594
child 57633 883f5702054d
6394013: C2: Remove VerifyOpto Summary: Removed the VerifyOpto flag. Reviewed-by: kvn, thartmann Contributed-by: Christian Hagedorn <christian.hagedorn@oracle.com>
src/hotspot/share/opto/c2_globals.hpp
src/hotspot/share/opto/chaitin.cpp
src/hotspot/share/opto/ifnode.cpp
src/hotspot/share/opto/indexSet.hpp
src/hotspot/share/opto/live.cpp
src/hotspot/share/opto/loopopts.cpp
src/hotspot/share/opto/node.cpp
src/hotspot/share/opto/phaseX.cpp
src/hotspot/share/opto/phaseX.hpp
--- a/src/hotspot/share/opto/c2_globals.hpp	Fri Aug 02 13:51:34 2019 -0700
+++ b/src/hotspot/share/opto/c2_globals.hpp	Mon Aug 05 08:03:25 2019 +0200
@@ -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")          \
                                                                             \
--- a/src/hotspot/share/opto/chaitin.cpp	Fri Aug 02 13:51:34 2019 -0700
+++ b/src/hotspot/share/opto/chaitin.cpp	Mon Aug 05 08:03:25 2019 +0200
@@ -1190,7 +1190,7 @@
       while ((neighbor = elements.next()) != 0) {
         LRG *n = &lrgs(neighbor);
 #ifdef ASSERT
-        if( VerifyOpto || VerifyRegisterAllocator ) {
+        if (VerifyRegisterAllocator) {
           assert( _ifg->effective_degree(neighbor) == n->degree(), "" );
         }
 #endif
--- a/src/hotspot/share/opto/ifnode.cpp	Fri Aug 02 13:51:34 2019 -0700
+++ b/src/hotspot/share/opto/ifnode.cpp	Mon Aug 05 08:03:25 2019 +0200
@@ -1480,12 +1480,6 @@
   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
--- a/src/hotspot/share/opto/indexSet.hpp	Fri Aug 02 13:51:34 2019 -0700
+++ b/src/hotspot/share/opto/indexSet.hpp	Mon Aug 05 08:03:25 2019 +0200
@@ -211,20 +211,10 @@
   // 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 @@
 
   // 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 @@
   //-------------------------- 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 @@
   }
 
   bool insert(uint element) {
-#ifdef ASSERT
-    if( VerifyOpto )
-      check_watch("insert", element);
-#endif
     if (element == 0) {
       return 0;
     }
@@ -300,11 +278,6 @@
   }
 
   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) {
--- a/src/hotspot/share/opto/live.cpp	Fri Aug 02 13:51:34 2019 -0700
+++ b/src/hotspot/share/opto/live.cpp	Mon Aug 05 08:03:25 2019 +0200
@@ -383,7 +383,7 @@
 // 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)
--- a/src/hotspot/share/opto/loopopts.cpp	Fri Aug 02 13:51:34 2019 -0700
+++ b/src/hotspot/share/opto/loopopts.cpp	Mon Aug 05 08:03:25 2019 +0200
@@ -1427,9 +1427,8 @@
             // 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
--- a/src/hotspot/share/opto/node.cpp	Fri Aug 02 13:51:34 2019 -0700
+++ b/src/hotspot/share/opto/node.cpp	Mon Aug 05 08:03:25 2019 +0200
@@ -1308,8 +1308,7 @@
   // 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();
--- a/src/hotspot/share/opto/phaseX.cpp	Fri Aug 02 13:51:34 2019 -0700
+++ b/src/hotspot/share/opto/phaseX.cpp	Mon Aug 05 08:03:25 2019 +0200
@@ -240,12 +240,6 @@
     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 @@
   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() {
@@ -949,14 +936,6 @@
 
 //=============================================================================
 //------------------------------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),
                                                    _delay_transform(igvn->_delay_transform),
@@ -1134,24 +1113,6 @@
 #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 @@
   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 @@
     assert(i != k || is_new || (i->outcnt() > 0), "don't return dead nodes");
 #ifndef PRODUCT
     verify_step(k);
-    if (i && VerifyOpto) {
-      set_progress();
-    }
 #endif
   }
 
--- a/src/hotspot/share/opto/phaseX.hpp	Fri Aug 02 13:51:34 2019 -0700
+++ b/src/hotspot/share/opto/phaseX.hpp	Mon Aug 05 08:03:25 2019 +0200
@@ -377,7 +377,6 @@
 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 @@
 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 @@
 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 );