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

Optimize C2 VerifyIterativeGVN execution time

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 17
    • 17
    • hotspot
    • b24
    • generic
    • generic

    Description

      When fixing IGVN related bug JDK-8265767, try verification with -XX:+VerifyIterativeGVN and it is extremly slow ("-Xbatch -XX:-TieredCompilation -XX:+VerifyIterativeGVN"). Checking VerifyIterativeGVN implementation, there exists spaces to optimize its execution time and make running -XX:+VerifyIterativeGVN possible when changing IGVN related code.

      1. Optimize redundant verfications in PhaseIterGVN::verify_step. Nodes might verified multiple times.
          Redundant verifications between full pass and _verify_window single node process.
          Redundant verifications between different nodes in _verify_window

      2. Optimize def-use edge checking
          Skip multiple check for same input node x
          Skip redundant check for index "i" in inner loop.

      2238 for (uint i = 0; i < n->len(); i++) {
      2243
      2244 // Verify my input has a def-use edge to me
      2245 // Count use-def edges from n to x
      2246 int cnt = 0;
      2247 for (uint j = 0; j < n->len(); j++) {
      2248 if (n->in(j) == x) {
      2249 cnt++;
      2250 }
      2251 }
      2252
      2253 // Count def-use edges from x to n
      2254 uint max = x->_outcnt;
      2255 for (uint k = 0; k < max; k++) {
      2256 if (x->_out[k] == n) {
      2257 cnt--;
      2258 }
      2259 }

      3. Optimize implementation
          Replace "n->in(j)" with "n->_in[j]", similar with x->n processing, skip unuseful assert.
          

      2247 for (uint j = 0; j < n->len(); j++) {
      2248 if (n->in(j) == x) {
      2249 cnt++;
      2250 }
      2251 }
      2252
      2253 // Count def-use edges from x to n
      2254 uint max = x->_outcnt;
      2255 for (uint k = 0; k < max; k++) {
      2256 if (x->_out[k] == n) {
      2257 cnt--;
      2258 }
      2259 }

      Attachments

        Issue Links

          Activity

            People

              hshi Hui Shi
              hshi Hui Shi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: