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

C2 can not merge trivial Ifs due to CastII

    XMLWordPrintable

Details

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

    Description

      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;
          }
        }

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: