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

Constant fold IfNode's based on domination information

XMLWordPrintable

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

      Improve reasoning at branches so that the compiler can be more efficient at eliminating conditional jumps. This helps eliminate branches in a more rigorous manner, such as in these complex cases:

      - x < y and y < z -> x < z
      - x < z and y < z -> Phi(x, y) < z
      - 0 < x < y and 0 < x + k < y with k > 0 -> 0 < x + i < y for all 0 <= i <= k

      A possible approach is to use a truth table, representing the relationships between the variables in each control node, this table can be filled in walking down the dominator path, and be used to eliminate conditional branches which cannot be inferred from constant bounds only. This concept can be found at [Go's prove pass](https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/prove.go). I think this can be done pessimistically and optimistically along with IterGVN if the cost seems reasonable.

            qamai Quan Anh Mai
            qamai Quan Anh Mai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: