-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8275086: compiler/c2/irTests/TestPostParseCallDevirtualization.java fails when compiler1 is disabled #5903
Conversation
…ails when compiler1 is disabled
👋 Welcome back sunny868! A progress list of the required criteria for merging this PR into |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a test for a C2 specific optimization, I would suggest to exclude the entire test if C2 is not available via a @requires vm.compiler2.enabled
.
In fact, I found this problem on the MIPS architecture. At present, we support C2 but not C1 on MIPS architecture. #Test results: no tests selected |
Sorry, I misread your original message and thought the test fails if C2 is not available. So the issue is that the test fails if C1 is not available. I would assume this is due to missing profile information. Does increasing the number of warmup iterations via |
I found the compilation info with c1 is:
here compile id 945 be called.
the compile id 254 be called |
In TestPostParseCallDevirtualization.java, use lable "applyIf=..." to disable testMethodHandleCallWithLoop and testMethodHandleCallWithCCP , other function such as testDynamicCallWithCCP testDynamicCallWithLoop can be tested normally. |
Though this issue is about excluding C1, I think the IR framework generally does not handle the case if C2 is excluded in the build (i.e. client VM). It only bails out of IR matching if C2 is excluded by command line flags. I will file a bug for it. |
What do you mean by that? IR verification fails because post-parse call devirtualization was not able to replace the |
@TobiHartmann I don't quite understand the “post-parse call devirtualization" now. so I just find some info from -XX+PrintIdeal and -XX:+PrintComplation. I have try again with -DWarmup=10000, and I set it in fileTestVMProcess.java, I`m not sure it is ok. the result is also FAILD.
|
I set -DWarmup=20000, test PASSED |
The test also fails with |
Maybe the FAIL caused by --- a/src/hotspot/share/opto/callGenerator.cpp
+++ b/src/hotspot/share/opto/callGenerator.cpp
@@ -1049,7 +1049,8 @@ CallGenerator* CallGenerator::for_method_handle_call(JVMState* jvms, ciMethod* c
ciCallProfile profile = caller->call_profile_at_bci(bci);
int call_site_count = caller->scale_count(profile.count());
- if (IncrementalInlineMH && call_site_count > 0 &&
+ if (IncrementalInlineMH && /*call_site_count > 0 &&*/
(input_not_const || !C->inlining_incrementally() || C->over_inlining_cutoff())) {
return CallGenerator::for_mh_late_inline(caller, callee, input_not_const);
} else { |
The following modifications are also OK,But I'm not sure it's a reasonable fix diff --git a/src/hotspot/share/ci/ciMethod.cpp b/src/hotspot/share/ci/ciMethod.cpp
index 862824c5b72..ff2c8ecb8e8 100644
--- a/src/hotspot/share/ci/ciMethod.cpp
+++ b/src/hotspot/share/ci/ciMethod.cpp
@@ -458,7 +458,8 @@ int ciMethod::check_overflow(int c, Bytecodes::Code code) {
ciCallProfile ciMethod::call_profile_at_bci(int bci) {
ResourceMark rm;
ciCallProfile result;
- if (method_data() != NULL && method_data()->is_mature()) {
+ if (ensure_method_data()){
ciProfileData* data = method_data()->bci_to_data(bci);
if (data != NULL && data->is_CounterData()) {
// Every profiled call site has a counter. |
Thanks for the details! I think it would be good if @iwanowww could take a look. He implemented post-parse call devirtualization. |
May be @veresov should look too. I see that I am not familiar with how many iterations the test calls compiled method. Does it uses |
Sounds like there is no MDO?
|
MDO already exists, but it is not loaded.The following modification is to use diff --git a/src/hotspot/share/ci/ciMethod.cpp b/src/hotspot/share/ci/ciMethod.cpp
index 862824c5b72..ff2c8ecb8e8 100644
--- a/src/hotspot/share/ci/ciMethod.cpp
+++ b/src/hotspot/share/ci/ciMethod.cpp
@@ -458,7 +458,8 @@ int ciMethod::check_overflow(int c, Bytecodes::Code code) {
ciCallProfile ciMethod::call_profile_at_bci(int bci) {
ResourceMark rm;
ciCallProfile result;
- if (method_data() != NULL && method_data()->is_mature()) {
+ if (ensure_method_data()){
ciProfileData* data = method_data()->bci_to_data(bci);
if (data != NULL && data->is_CounterData()) {
// Every profiled call site has a counter. |
|
Thank you for @veresov reply. There are two ways to pass this use case test:
Which way is more reasonable? |
There is a more elegant way to tweak the thresholds - |
…ails when compiler1 is disabled
Hi all, Please review the new patch, Thanks. I set |
0.14 is oddly low. I think we need to get to the root of this and figure out why it doesn't create the MDO when it should. Try running the test with -XX:+PrintTieredEvents and grep for testMethodHandleCallWithCCP. See what's happening there. Look at the mdo counters that it prints. What are the total counters when does it starts profiling (the mdo counters start increasing)? |
@veresov Through the parameter |
I think that's a pretty normal start of profiling in this configuration. We don't want to start profiling too early because it will have an adverse effect on startup. Historically, before tiered the profiling would start after 3300 invocations + back branches taken. It feels like the IR testing framework needs to be adjusted so that it warms the tests up longer (at least in this configuration). |
…ails when compiler1 is disabled
So, now 5000 warmup iterations help? You mentioned previously that it had to be 20000 ? What changed? |
Trying 20,000 before just makes the test case occasionally successful. The core problem is that the warm-up should be for function If we consider adding new IR test cases later, it might make more sense to modify the ir framework. |
@chhagedorn, how do you think this PR should proceed? Would you consider fixing the framework to increase the warmup for the C2-only configuration? |
I think for now, going with
If others agree, I will file RFEs for both of these. |
@chhagedorn, ok, let's go with the current solution for now then. |
|
@sunny868 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 282 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@TobiHartmann, @veresov) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
@veresov Could you please sponsor it for me? |
/sponsor |
Going to push as commit 87b926e.
Your commit was automatically rebased without conflicts. |
Exposing this method sounds indeed more robust than a custom special handling within the IR framework. I will also consider setting the adaptive flags for the test VM to make it more deterministic. Thanks for your input! I will file the RFE accordingly. |
Hi all,
Jtreg test case compiler/c2/irTests/TestPostParseCallDevirtualization.java fails for fastdebug mode on x86/aarch64/mips architecture when "--with-jvm-features=-compiler1" be used. the failed info is:
This is a patch to fix this problem. Please help review it.
Thanks,
Sun Guoyun
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5903/head:pull/5903
$ git checkout pull/5903
Update a local copy of the PR:
$ git checkout pull/5903
$ git pull https://git.openjdk.java.net/jdk pull/5903/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5903
View PR using the GUI difftool:
$ git pr show -t 5903
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5903.diff