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

Obsolete DoReserveCopyInSuperWord

XMLWordPrintable

    • behavioral
    • minimal
    • Hide
      DoReserveCopyInSuperWord is an obscure flag with minimal impact. Users which disabled it would have done this for performance (avoid cloning) for the risk of crashing instead. After this change, we will neither clone/copy, nor crash. Users will simply have to remove the flag from their configurations.
      Show
      DoReserveCopyInSuperWord is an obscure flag with minimal impact. Users which disabled it would have done this for performance (avoid cloning) for the risk of crashing instead. After this change, we will neither clone/copy, nor crash. Users will simply have to remove the flag from their configurations.
    • add/remove/modify command line option
    • JDK

      Summary

      In JDK-8309204, we would like to remove all functionality of DoReserveCopyInSuperWord, after which this product flag becomes useless.

      I already have a PR for JDK-8309204.

      Problem

      Currently, the flag DoReserveCopyInSuperWord (on by default) creates a copy of the loop at the beginning of SuperWord::output, so that if anything goes wrong while modifying the graph, we can revert to a unmodified copy. If a user explicitly disables the flag, we would instead hit a ShouldNotReachHere and crash.

      But these are absolute edge cases: only when we hit asserts in debug mode. Hence, it is not justified to have the extra computational overhead of cloning/copying the loop, and the code complexity of CountedLoopReserveKit.

      Solution

      Instead of copy / revert, we simply bail out and recompile without SuperWord.

      Remove CountedLoopReserveKit.

      Obsolete DoReserveCopyInSuperWord. Simply deprecating it would not allow for the removal of the functionality, hence we want to go for obsoletion directly.

      Specification

      The changes to argument handling:

      --- a/src/hotspot/share/opto/c2_globals.hpp
      +++ b/src/hotspot/share/opto/c2_globals.hpp
      @@ -341,9 +341,6 @@
         product(bool, UseCMoveUnconditionally, false,                             \
                 "Use CMove (scalar and vector) ignoring profitability test.")     \
                                                                                   \
      -  product(bool, DoReserveCopyInSuperWord, true,                             \
      -          "Create reserve copy of graph in SuperWord.")                     \
      -                                                                            \
         notproduct(bool, TraceSuperWord, false,                                   \
                 "Trace superword transforms")                                     \
                                                                                   \
      
      --- a/src/hotspot/share/runtime/arguments.cpp
      +++ b/src/hotspot/share/runtime/arguments.cpp
      @@ -524,6 +524,7 @@ static SpecialFlag const special_jvm_flags[] = {
         { "G1ConcRSHotCardLimit",         JDK_Version::undefined(), JDK_Version::jdk(21), JDK_Version::undefined() },
         { "RefDiscoveryPolicy",           JDK_Version::undefined(), JDK_Version::jdk(21), JDK_Version::undefined() },
         { "MetaspaceReclaimPolicy",       JDK_Version::undefined(), JDK_Version::jdk(21), JDK_Version::undefined() },
      +  { "DoReserveCopyInSuperWord",     JDK_Version::undefined(), JDK_Version::jdk(22), JDK_Version::jdk(23) },
      
       #ifdef ASSERT
         { "DummyObsoleteTestFlag",        JDK_Version::undefined(), JDK_Version::jdk(18), JDK_Version::undefined() },

      Further, all uses of DoReserveCopyInSuperWord are removed.

            epeter Emanuel Peter
            epeter Emanuel Peter
            Tobias Hartmann, Vladimir Kozlov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: