-
Notifications
You must be signed in to change notification settings - Fork 55
8288467: remove memory_operand assert for spilled instructions #33
Conversation
…ory operand, only stack
👋 Welcome back epeter! 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.
Looks reasonable to me. It would be good if @jatin-bhateja could also have a look.
@eme64 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 11 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. ➡️ To integrate this PR with the above commit message to the |
fix typo Co-authored-by: Tobias Hartmann <tobias.hartmann@oracle.com>
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.
Linux x86_32 fastdebug tier1
and tier2
pass.
Hi @eme64, As you mentioned there are not many cases where an instruction accept more than one memory operand. Following patterns in x86_32.ad (which are relevant to SSE targets) are the only occurrences accepting more than one memory operand. instruct addFPR24_mem_cisc(stackSlotF dst, memory src1, memory src2) %{ And for each of these a constant -1 value is returned as memory_operand currently. const MachOper* addFPR24_mem_ciscNode::memory_operand() const { return (MachOper*)-1; } Post matcher operand array is sacrosanct, only problem here is that oper_input_base() for non-cisc counterparts are 2 since first input is memory edge. Due to this it enters the control flow having assertion check. Your fix to remove assertion, looks safe to me. Best Regards, |
Thanks @jatin-bhateja @shipilev @TobiHartmann for your reviews, and help with clarifying, verifying and even testing. |
Going to push as commit af05139.
Your commit was automatically rebased without conflicts. |
In JDK-8282555 I added this assert, because on x64 this seems to always hold. But it turns out there are instructions on x86 (32bit) that violate this assumption.
Why it holds on x64
It seems we only ever do one read or one write per instruction. Instructions with multiple memory operands are extremely rare.
Why it is violated on x86 (32bit)
We have additional cases that land in the else case. For example spilling
src1
fromaddFPR24_reg_mem
toaddFPR24_mem_cisc
.jdk19/src/hotspot/cpu/x86/x86_32.ad
Lines 10325 to 10327 in 53bf1bf
jdk19/src/hotspot/cpu/x86/x86_32.ad
Lines 10368 to 10370 in 53bf1bf
We land in the else case, because both have 2 inputs, thus
oper_input_base() == 2
.And both have memory operands, so the assert must fail.
Solutions
For now I went with 1. as it is simple and as far as I can see correct.
Running tests on x64 (should not fail). I need someone to help me with testing x86 (32bit). I only verified the reported test failure with a 32bit build.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk19 pull/33/head:pull/33
$ git checkout pull/33
Update a local copy of the PR:
$ git checkout pull/33
$ git pull https://git.openjdk.org/jdk19 pull/33/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 33
View PR using the GUI difftool:
$ git pr show -t 33
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk19/pull/33.diff