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

bug in C2 conditional-move - suggested fix is provided

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 5.0u11
    • hotspot
    • generic
    • generic

      ugfix for conditional-move creation, if the CMOV is getting
      created inside an inner-most loop or has inputs which are hung
      off the converted if-node.


      ==== //java/main-dev/java/hotspot5/src/share/vm/opto/loopopts.cpp#14 (text) ====
      @@ -534,8 +534,12 @@
               set_ctrl(inp, cmov_ctrl);
             }
           }
      - Node *cmov = CMoveNode::make( cmov_ctrl->in(0), iff->in(1), phi->in(1+flip), phi->in(2-flip), _igvn.type(phi) );
      - register_new_node( cmov, cmov_ctrl->in(0) );
      + Node *cmov = CMoveNode::make( region, iff->in(1), phi->in(1+flip), phi->in(2-flip), _igvn.type(phi) );
      + register_new_node( cmov, region );
      + // Since we are inside loop optimizations and just created a new node, we need to check if it belongs to innermost loop
      + // and in this case update additional structure
      + IdealLoopTree *loop = get_loop(region);
      + if (!loop->_child) loop->_body.push(cmov);
           _igvn.hash_delete(phi);
           _igvn.subsume_node( phi, cmov );
       #ifndef PRODUCT

            rasbold Chuck Rasbold
            mmma Marvin Ma (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: