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

Optimize Max and Min code generated for RCE

XMLWordPrintable

    • generic
    • generic

      I looked on code generated for Range Check Elimination and see patters which could be optimized out

      1. MaxI compare the same node. It is not optimized because no Ideal optimization done for MaxI, it does not have Ideal() method. Note, MinI has Ideal() method.

       479 MaxI === _ 454 454 [[ 442 ]] !orig=[428]

      2. When several RCE optimizations done one after an other we can get very complex expressions which use combinations of MaxI and MinI:

      MaxI(MinI(X, Y), Y) and MinI(MaxI(X, Y), Y) could be optimized to Y

      MaxI(MinI(MaxI(X, Z), Y), Z) could be optimized to MaxI(MinI(X, Y), Z)

            kvn Vladimir Kozlov
            kvn Vladimir Kozlov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: