RFR: 8270459: Conflict inlining decisions by C1/C2 with the same CompileCommand [v2]
Xin Liu
xliu at openjdk.java.net
Fri Jul 16 04:05:12 UTC 2021
On Fri, 16 Jul 2021 03:52:19 GMT, Xin Liu <xliu at openjdk.org> wrote:
>>> Add comment that `option_list` lists options in reverse order. So the first option we find is the last which was specified.
>>
>> Updated.
>> Thanks.
>
> 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();
-------------
PR: https://git.openjdk.java.net/jdk/pull/4780
More information about the hotspot-compiler-dev
mailing list