JDK-8320668 : Remove CompileCommand option VectorizeDebug
  • Type: CSR
  • Component: hotspot
  • Sub-Component: compiler
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 23
  • Submitted: 2023-11-23
  • Updated: 2023-11-27
  • Resolved: 2023-11-27
Related Reports
CSR :  
Description
Summary
-------

With JDK-8315361, I want to refactor and clean up the C2 auto-vectorizer. Part of this is the removal of the CompileCommand option VectorizeDebug. It is a product flag, even though its name implies that it is only for debugging. Its product build effects can still be achieved with CompileCommand option Vectorize, and its debug build effects are only printing/tracing, which is to be replaced by a new CompileCommand option TraceAutoVectorization.

Problem
-------

Currently, VectorizeDebug has two effects:

In the product build, it does the same as CompileCommand option Vectorize (it enables the CloneMap as a hint for SuperWord).

In the debug build, it traces / prints debug information about SuperWord. There are bit-flags that can be individually enabled / disabled.

The mixing of debug printing and product effects on SuperWord is confusing and concerning. The flag is not at all documented, and hence users are most likely not aware of its effect.

Solution
--------

Remove CompileCommand option VectorizeDebug.

The product effects can still be achieved with CompileCommand option Vectorize.

The debug printing is to be taken up by a debug only CompileCommand option TraceAutoVectorization.

Specification
-------------

The changes to argument handling:

    diff --git a/src/hotspot/share/compiler/compilerDirectives.hpp b/src/hotspot/share/compiler/compilerDirectives.hpp
    index 4c9b51724f9..430a5356ed8 100644
    --- a/src/hotspot/share/compiler/compilerDirectives.hpp
    +++ b/src/hotspot/share/compiler/compilerDirectives.hpp
    @@ -87,10 +87,10 @@ NOT_PRODUCT(cflags(PrintIdeal,          bool, PrintIdeal, PrintIdeal)) \
         cflags(Vectorize,               bool, false, Vectorize) \
         cflags(CloneMapDebug,           bool, false, CloneMapDebug) \
     NOT_PRODUCT(cflags(IGVPrintLevel,       intx, PrintIdealGraphLevel, IGVPrintLevel)) \
    -    cflags(VectorizeDebug,          uintx, 0, VectorizeDebug) \
         cflags(IncrementalInlineForceCleanup, bool, IncrementalInlineForceCleanup, IncrementalInlineForceCleanup) \
         cflags(MaxNodeLimit,            intx, MaxNodeLimit, MaxNodeLimit)
     #define compilerdirectives_c2_string_flags(cflags) \

    --- a/src/hotspot/share/compiler/compilerOracle.hpp
    +++ b/src/hotspot/share/compiler/compilerOracle.hpp
    @@ -86,8 +86,8 @@ NOT_PRODUCT(option(TraceEscapeAnalysis, "TraceEscapeAnalysis", Bool)) \
     NOT_PRODUCT(option(PrintIdeal, "PrintIdeal", Bool))  \
     NOT_PRODUCT(option(PrintIdealPhase, "PrintIdealPhase", Ccstrlist)) \
     NOT_PRODUCT(option(IGVPrintLevel, "IGVPrintLevel", Intx)) \
       option(Vectorize, "Vectorize", Bool) \
    -  option(VectorizeDebug, "VectorizeDebug", Uintx) \
       option(CloneMapDebug, "CloneMapDebug", Bool) \
       option(IncrementalInlineForceCleanup, "IncrementalInlineForceCleanup", Bool) \
       option(MaxNodeLimit, "MaxNodeLimit", Intx)  \

    --- a/src/hotspot/share/opto/compile.cpp
    +++ b/src/hotspot/share/opto/compile.cpp
    @@ -1052,7 +1052,7 @@ void Compile::Init(bool aliasing) {
       set_has_monitors(false);

       if (AllowVectorizeOnDemand) {
    -    if (has_method() && (_directive->VectorizeOption || _directive->VectorizeDebugOption)) {
    +    if (has_method() && _directive->VectorizeOption) {
           set_do_vector_loop(true);
           NOT_PRODUCT(if (do_vector_loop() && Verbose) {tty->print("Compile::Init: do vectorized loops (SIMD like) for method %s\n",  method()->name()->as_quoted_ascii());})
         } else if (has_method() && method()->name() != 0 &&


Comments
Moving to Approved for JDK 23.
27-11-2023

[~epeter] The CSR has been finalized with fixVersion=tbd. The description in the PR suggests JDK 23 so I think set the fixVersion on the CSR so that it's clear which release it is targeted to.
26-11-2023

Looks good to me (corrected a little typo). Although I don't think anyone is using this option, we might want to add a release node explaining the alternative of using the Vectorize compile command.
24-11-2023

I created this CSR from JDK-8315361, which was reporded by [~pli]. Somehow JIRA now thinks that it was [~pli] who reported this CSR. But it was me.
23-11-2023