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

C2 can not merge trivial Ifs due to CastII

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 21
    • hotspot

      C2 can not apply Split If for the following trivial case. After a quick investigation, CastII generated by Parse::sharpen_type_after_if prevents it from being optimized out, because PhiNode::Identity can not find existing Cmp if we don't allow cast(unique_input(n,false/*uncast*/))

        public static void test5(int a, int b){
       
          if( b!=0) {
            int_field = 35;
          } else {
            int_field =222;
          }

          if( b!=0) {
            int_field = 35;
          } else {
            int_field =222;
          }
        }

            yyang Yi Yang
            yyang Yi Yang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: