8386687: Regression >6% on Crypto-MLDSA.sign on x64#31686
Conversation
…th an instruction with no predicate
|
👋 Welcome back drwhite! A progress list of the required criteria for merging this PR into |
|
/label hotspot-compiler |
|
❗ This change is not yet ready to be integrated. |
|
@dwhite-intel |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
|
@dwhite-intel To determine the appropriate audience for reviewing this pull request, one or more labels corresponding to different subsystems will normally be applied automatically. However, no automatic labelling rule matches the changes in this pull request. In order to have an "RFR" email sent to the correct mailing list, you will need to add one or more applicable labels manually using the /label pull request command. Applicable Labels
|
|
Here's more detail on the regression PICKY PROBLEMS WITH PREDICATES I eventually narrowed down the regression to the removal of a predicate(!UseAPX) when running on x86 without APX support (which is approximately 100% of x86 CPUs at the moment :-). On x86 and S390, there is a "CISC SPILLING" optimization, controlled by UseCISCSpill. The optimization is that if a register has been spilled to the stack, but you need to do an operation on it, instead of restoring it back to a register, the back-end will replace the canonical In this case the instruct This all happens "magically" in generated code like Great, so far so good. The regression from my simpler AXP PR occurred because of how the matching for the replacement instruction works. I think it first looks for instruction pairs like these: But ALSO, each instruction must have equal predicates. It actually requires textually equal predicates, but that's not the problem here. Keep in mind that all of this matching happens at build time as it parses the x86.ad file and generates code that implements the C2 back end. REGRESSION - What did I do?My simpler-apx PR removed instructions for NDD with memory operands. -------------- BEFORE PR ---------------- -------------- AFTER PR ---------------- // Removed instruct So that's fine as far as normal JIT code gen is concerned, but the CISC_SPILL optimization will fail because |
The simpler APX code in PR Tune APX support in C2 backend disabled the CISC_Spilling optimization that is buried in ALDC. It replaces instructions that match on registers with instructions that operate on the stack (I think) if it knows that the register has been spilled to the stack.
The matching code in formsself.cpp insisted that both the original and replacement "instructs" have identical predicates.
This PR loosens this requirement to also allow replacing an instruct with a predicate by an instruct without a predicate - the replacement instruct is logically more general than the original instruct that only applies if the predicate is true.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31686/head:pull/31686$ git checkout pull/31686Update a local copy of the PR:
$ git checkout pull/31686$ git pull https://git.openjdk.org/jdk.git pull/31686/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 31686View PR using the GUI difftool:
$ git pr show -t 31686Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31686.diff