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 &&