Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8257197

Add additional verification code to PhaseCCP

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 16, 17
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:

      Description

      We should catch problems like JDK-8257166 during CCP by adding some verification code:

      @@ -1717,11 +1717,13 @@ void PhaseCCP::analyze() {
         // Push root onto worklist
         Unique_Node_List worklist;
         worklist.push(C->root());
      + DEBUG_ONLY(Unique_Node_List worklist_verify;)
       
         // Pull from worklist; compute new value; push changes out.
         // This loop is the meat of CCP.
         while( worklist.size() ) {
           Node *n = worklist.pop();
      + DEBUG_ONLY(worklist_verify.push(n);)
           const Type *t = n->Value(this);
           if (t != type(n)) {
             assert(ccp_type_widens(t, type(n)), "ccp type must widen");
      @@ -1813,6 +1815,21 @@ void PhaseCCP::analyze() {
             }
           }
         }
      +#ifdef ASSERT
      + while (worklist_verify.size()) {
      + Node* n = worklist_verify.pop();
      + const Type* told = type(n);
      + const Type* tnew = n->Value(this);
      + if (told != tnew) {
      + told->dump_on(tty);
      + tty->print_cr("");
      + tnew->dump_on(tty);
      + tty->print_cr("");
      + n->dump(1);
      + fatal("missed optimization opportunity");
      + }
      + }
      +#endif
       }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              thartmann Tobias Hartmann
              Reporter:
              thartmann Tobias Hartmann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: