RFR: 8355488: Add stress mode for C2 loop peeling [v3]

Marc Chevalier mchevalier at openjdk.org
Thu May 15 12:16:53 UTC 2025


On Wed, 14 May 2025 13:41:22 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:

>> src/hotspot/share/opto/compile.cpp line 666:
>> 
>>> 664:       _congraph(nullptr),
>>> 665:       NOT_PRODUCT(_igv_printer(nullptr) COMMA)
>>> 666:       NOT_PRODUCT(_peeling_rounds_of_node(comp_arena(), 8, 0, Pair<node_idx_t, uint>(0, 0)) COMMA)
>> 
>> `NOT_PRODUCT` means that it's also available in the optimized build but you only want/need it in debug.
>
> Should I use `#ifdef ASSERT`? My thinking is that I want the code to be there whenever the flag is available. This is decided here:
> https://github.com/openjdk/jdk/blob/a989245a2424d136f5d2a828eda666c3867b0f48/src/hotspot/share/runtime/flags/jvmFlag.cpp#L552-L556
> (called from `JVMFlag::find_flag` with `return_flag == false`, from `Arguments::find_jvm_flag`, from `Arguments::parse_argument` from `Arguments::process_argument`) with
> https://github.com/openjdk/jdk/blob/a989245a2424d136f5d2a828eda666c3867b0f48/src/hotspot/share/runtime/flags/jvmFlag.cpp#L60-L66
> 
> My thinking is that it's unintuitive to me to offer a flag that could have no effect. Why don't we want it in optimized non-product build? We can still stress-peel and even if we won't hit an assert, we could still observe unexpected behaviors or crashes. Does that make sense?

As discussed, I came back to `PRODUCT` for consistency.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25140#discussion_r2091034546


More information about the hotspot-compiler-dev mailing list