Skip to content
This repository has been archived by the owner. It is now read-only.

8269775: compiler/codegen/ClearArrayTest.java failed with "assert(false) failed: bad AD file" #199

Closed
wants to merge 2 commits into from

Conversation

sviswa7
Copy link
Contributor

@sviswa7 sviswa7 commented Jul 2, 2021

The following test failed in JDK17
compiler/codegen/ClearArrayTest.java
with assert(false) failed: bad AD file

The problem is that no match is found for platforms not supporting avx512vlbw for constant input.

Per analysis from Dean Long and Vladimir Kozlov:
This is due to rep_stos rules for small clear array which use !n->in(2)->bottom_type()->is_long()->is_con().
This prevents the rule from matching with a constant --> register conversion.
Removing !is_con() from rep_stos for small clear array fixes the issue.
We also add appropriate "ins_cost" to all ClearArray rules, so that in the case of multiple matches, we break the tie based on ins_cost.

Best Regards,
Sandhya


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8269775: compiler/codegen/ClearArrayTest.java failed with "assert(false) failed: bad AD file"

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk17 pull/199/head:pull/199
$ git checkout pull/199

Update a local copy of the PR:
$ git checkout pull/199
$ git pull https://git.openjdk.java.net/jdk17 pull/199/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 199

View PR using the GUI difftool:
$ git pr show -t 199

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk17/pull/199.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jul 2, 2021

👋 Welcome back sviswanathan! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

@openjdk openjdk bot commented Jul 2, 2021

@sviswa7 The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-compiler label Jul 2, 2021
@sviswa7 sviswa7 marked this pull request as ready for review Jul 2, 2021
@openjdk openjdk bot added the rfr label Jul 2, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 2, 2021

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

You need to fix x86_32.ad file too.

match(Set dummy (ClearArray cnt base));
effect(USE_KILL cnt, USE_KILL base, TEMP tmp, KILL zero, KILL cr);
ins_cost(125);
Copy link
Contributor

@vnkozlov vnkozlov Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need it here. There are no other ClearArray conflicting instructions for small copy and AVX <= 2.

predicate(!((ClearArrayNode*)n)->is_large() &&
UseAVX > 2 &&
!n->in(2)->bottom_type()->is_long()->is_con());
predicate(!((ClearArrayNode*)n)->is_large() && UseAVX > 2);
Copy link
Contributor

@vnkozlov vnkozlov Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add () around UseAVX > 2 as in other place.

@vnkozlov
Copy link
Contributor

@vnkozlov vnkozlov commented Jul 2, 2021

@sviswa7 Please, file separate RFE to improve this ClearArrayTest test which should include all cases we have in .ad file:

  1. large vs small
  2. constant vs variable length

@vnkozlov
Copy link
Contributor

@vnkozlov vnkozlov commented Jul 2, 2021

I verified that with this fix rep_stos_im() or rep_stos_evex() will be used depending on avx512vlbw support.
Good!

@sviswa7
Copy link
Contributor Author

@sviswa7 sviswa7 commented Jul 2, 2021

RFE for test filed: https://bugs.openjdk.java.net/browse/JDK-8269789

@sviswa7
Copy link
Contributor Author

@sviswa7 sviswa7 commented Jul 2, 2021

@vnkozlov I have implemented all your review comments. Please take a look.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Looks good.
I am currently running tests. I will approve when they pass.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Testing passed.

@openjdk
Copy link

@openjdk openjdk bot commented Jul 2, 2021

@sviswa7 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:

8269775: compiler/codegen/ClearArrayTest.java failed with "assert(false) failed: bad AD file"

Reviewed-by: kvn, dlong

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 1 new commit pushed to the master branch:

  • 5644c4f: 8265132: C2 compilation fails with assert "missing precedence edge"

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Jul 2, 2021
@sviswa7
Copy link
Contributor Author

@sviswa7 sviswa7 commented Jul 2, 2021

@vnkozlov Please let me know if I can go ahead and integrate.

@vnkozlov
Copy link
Contributor

@vnkozlov vnkozlov commented Jul 2, 2021

Wait Dean's review. It is fine if you push tomorrow.

@jatin-bhateja
Copy link
Member

@jatin-bhateja jatin-bhateja commented Jul 2, 2021

Thanks @sviswa7 , I missed putting this change in my last check-in, attaching instruction costs will resolve conflicts and select instruction with minimum cost in case of multiple matches in this BURS based instruction selection.

@sviswa7
Copy link
Contributor Author

@sviswa7 sviswa7 commented Jul 2, 2021

Thanks a lot @vnkozlov @dean-long for the review and all the help.

@sviswa7
Copy link
Contributor Author

@sviswa7 sviswa7 commented Jul 2, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Jul 2, 2021

Going to push as commit 6f0e8e7.
Since your change was applied there have been 4 commits pushed to the master branch:

  • c4ea13e: 8269543: The warning for System::setSecurityManager should only appear once for each caller
  • 2db9005: 8262017: C2: assert(n != __null) failed: Bad immediate dominator info.
  • 7bc96db: 8269771: assert(tmp == _callprojs.fallthrough_catchproj) failed: allocation control projection
  • 5644c4f: 8265132: C2 compilation fails with assert "missing precedence edge"

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jul 2, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Jul 2, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jul 2, 2021

@sviswa7 Pushed as commit 6f0e8e7.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotspot-compiler integrated
4 participants