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

Strenghten the Ideal Verification in PhaseIterGVN::verify_Ideal_for by comparing the hash of a node before and after Ideal

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 26
    • hotspot
    • In Review

      In PhaseIterGVN::verify_Ideal_for, the Ideal method is called for a given node to assert that no further optimization can be done. According to the comments in node.cpp, if any change is made by Ideal, it must return the root of the reshaped graph.

      For this reason, we check the return value of Ideal and only flag a missed optimization if it is not nullptr. However, since this runs in a verification context, we should not fully rely on the assumption that Ideal always adheres to this contract and we should also verify it.

      To strengthen the verification, we could compute the hash of the node before calling Ideal, then recompute and compare it afterward to detect any unexpected changes to the structure of the graph.

            bmaillard Benoît Maillard
            bmaillard Benoît Maillard
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: