RFR: 8270459: Conflict inlining decisions by C1/C2 with the same CompileCommand [v2]

Jie Fu jiefu at openjdk.java.net
Fri Jul 16 04:09:13 UTC 2021


On Fri, 16 Jul 2021 04:01:35 GMT, Xin Liu <xliu at openjdk.org> wrote:

>> if has_inline == true && has_dnotinline == true, but v1 == false && v2 == false,  two options conflict, don't  they? 
>> in this case, you go to else, which actually bias to Inline instead of the last seen option.
>
> Maybe like this. it can cover 2 cases.
> 
> index 8464d22ef42..15e1f474227 100644
> --- a/src/hotspot/share/compiler/compilerOracle.cpp
> +++ b/src/hotspot/share/compiler/compilerOracle.cpp
> @@ -348,7 +348,7 @@ static bool resolve_inlining_predicate(enum CompileCommand option, const methodH
>    bool has_inline = CompilerOracle::has_option_value(method, CompileCommand::Inline, v1);
>    bool has_dnotinline = CompilerOracle::has_option_value(method, CompileCommand::DontInline, v2);
>    if (has_inline && has_dnotinline) {
> -    if (v1 && v2) {
> +    if (v1 == v2) {
>        // Conflict options detected
>        // Find the last one for that method and return the predicate accordingly
>        // option_list lists options in reverse order. So the first option we find is the last which was specified.
> @@ -358,7 +358,7 @@ static bool resolve_inlining_predicate(enum CompileCommand option, const methodH
>          last_one = current->option();
>          if (last_one == CompileCommand::Inline || last_one == CompileCommand::DontInline) {
>            if (current->matches(method)) {
> -            return last_one == option;
> +            return last_one == option ? v1 : !v1;
>            }
>          }
>          current = current->next();

> if has_inline == true && has_dnotinline == true, but v1 == false && v2 == false, two options conflict, don't they?

I don't think they are conflict.

This is because

-XX:CompilerCommand=inline,foo,false     ==> doesn't mean to disallow the inline of foo
-XX:CompilerCommand=dontinline,foo,false ==>  doesn't mean to force inline of foo


So if `inline` and `dontinline` options are set to false, they actually have no effect to the compiler.
Thanks.

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

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


More information about the hotspot-compiler-dev mailing list