The compilation CompLevel.WAIT_FOR_COMPILATION was originally intended to disable a compilation request by the IR framework and let the test be invoked enough times such that a compilation is normally initiated by reaching the required backedge/invocation counters.
The use-case here is that we sometimes want to have a way to normally trigger a compilation without interference of the IR framework. Using CompLevel.WAIT_FOR_COMPILATION, however, is very restricted: We normally warm up the test with the default number of warm-up iterations and then just wait for a compilation at any level. It would have been better to wait at least for a C2 compilation to be able to IR match. But even then, this does not offer the user much benefit compared to just using @Warmup with a custom value to ensure the expected profiling.
There is a more powerful way to have more control over the compilation without IR framework interference: RunMode.STANDALONE. This will invoke a @Run method exactly once, without any additional warm-up iterations, and gives full control to the user to let the test compile. The IR framework does not initiate a compilation request. If the @Run method does not compile a method, then IR matching will naturally fail because there is no compilation output.
On top of that, CompLevel.WAIT_FOR_COMPILATION is not used anywhere in mainline (except in IR framework internal tests). There are a few usages in Valhalla for inline types which could easily be replaced by RunMode.STANDALONE.
All these reasons suggest that we should remove CompLevel.WAIT_FOR_COMPILATION from the IR framework. This also simplifies the IR framework code to remove this special case handling.
The use-case here is that we sometimes want to have a way to normally trigger a compilation without interference of the IR framework. Using CompLevel.WAIT_FOR_COMPILATION, however, is very restricted: We normally warm up the test with the default number of warm-up iterations and then just wait for a compilation at any level. It would have been better to wait at least for a C2 compilation to be able to IR match. But even then, this does not offer the user much benefit compared to just using @Warmup with a custom value to ensure the expected profiling.
There is a more powerful way to have more control over the compilation without IR framework interference: RunMode.STANDALONE. This will invoke a @Run method exactly once, without any additional warm-up iterations, and gives full control to the user to let the test compile. The IR framework does not initiate a compilation request. If the @Run method does not compile a method, then IR matching will naturally fail because there is no compilation output.
On top of that, CompLevel.WAIT_FOR_COMPILATION is not used anywhere in mainline (except in IR framework internal tests). There are a few usages in Valhalla for inline types which could easily be replaced by RunMode.STANDALONE.
All these reasons suggest that we should remove CompLevel.WAIT_FOR_COMPILATION from the IR framework. This also simplifies the IR framework code to remove this special case handling.