RFR: JDK-8258603 c1 IR::verify is expensive [v5]

Vladimir Kozlov kvn at openjdk.java.net
Thu Dec 23 01:29:11 UTC 2021


On Thu, 23 Dec 2021 01:14:48 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>>> So the whole block of code in `c1_IR.cpp` is under `#ifndef PRODUCT`. But is it used in **optimized** build or only in debug?
>>> 
>>> I suggest to change `#ifndef PRODUCT` at line 1224 to `#ifdef ASSERT` and try to build optimized VM to see if it is used in it. I see only prints and asserts.
>> 
>> Shouldn't we leave `BlockPrinter` and `IR::print()` under `#ifndef PRODUCT`? These seem to be about printing things only which is probably good to have in optimized builds as well. We could instead just add an `#ifdef ASSERT` on L1263 for the validators and the IR verification and change the places using this code accordingly to `#ifdef ASSERT/DEBUG_ONLY()`. Then we would have everything under `ASSERT` instead of `!PRODUCT`. This would be in line with the original code which used `#ifdef ASSERT` in `IR::verify()`.
>
>> > So the whole block of code in `c1_IR.cpp` is under `#ifndef PRODUCT`. But is it used in **optimized** build or only in debug?
>> > I suggest to change `#ifndef PRODUCT` at line 1224 to `#ifdef ASSERT` and try to build optimized VM to see if it is used in it. I see only prints and asserts.
>> 
>> Shouldn't we leave `BlockPrinter` and `IR::print()` under `#ifndef PRODUCT`? These seem to be about printing things only which is probably good to have in optimized builds as well. We could instead just add an `#ifdef ASSERT` on L1263 for the validators and the IR verification and change the places using this code accordingly to `#ifdef ASSERT/DEBUG_ONLY()`. Then we would have everything under `ASSERT` instead of `!PRODUCT`. This would be in line with the original code which used `#ifdef ASSERT` in `IR::verify()`.
> 
> I agree with christian's suggestion.

> @vnkozlov I don't know what an optimized build is, you'll have to point me to some instructions if you want me to build one.


bash configure --with-conf-name=optimized --with-debug-level=optimized
make jdk-image CONF=optimized
./build/optimized/images/jdk/bin/java -XX:+PrintCFG -version

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

PR: https://git.openjdk.java.net/jdk/pull/6850


More information about the hotspot-compiler-dev mailing list