8302681: [IR Framework] Only allow cpuFeatures from a verified list#12669
8302681: [IR Framework] Only allow cpuFeatures from a verified list#12669eme64 wants to merge 10 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back epeter! A progress list of the required criteria for merging this PR into |
|
@fg1417 Could you tell me if Update |
Webrevs
|
TobiHartmann
left a comment
There was a problem hiding this comment.
[TODO: some failures because of sse3. That may be another issue I need to fix.]
sse3 is missing from your list, right?
Should we simply use the CPU features detected by the VM? For example:
jdk/src/hotspot/cpu/x86/vm_version_x86.hpp
Lines 322 to 327 in f12710e
jdk/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
Lines 105 to 110 in f12710e
This test does that too:
jdk/test/lib-test/jdk/test/whitebox/CPUInfoTest.java
Lines 53 to 68 in f12710e
|
@TobiHartmann I was actually missing a few cpu features. And a test needed to be corrected. I am running the tests again now. I would like to keep the list small, and separate from other lists. It has to be clear that this list is verified, and if one adds something one has to be very sure that it is not a typo or non-existent. If people need an additional feature, it can easily be verified and added. |
TobiHartmann
left a comment
There was a problem hiding this comment.
I would like to keep the list small, and separate from other lists. It has to be clear that this list is verified, and if one adds something one has to be very sure that it is not a typo or non-existent.
Okay, fine with me.
TestPreconditions.java needs a copyright update.
test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPreconditions.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPreconditions.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/lib/ir_framework/test/IREncodingPrinter.java
Outdated
Show resolved
Hide resolved
| // on this list, we will ignore tests and never execute them. | ||
| List<String> verifiedCPUFeatures = new ArrayList<String>( Arrays.asList( | ||
| // General | ||
| "sha3", |
There was a problem hiding this comment.
Isn't sha3 AArch64 specific?
| List<String> verifiedCPUFeatures = new ArrayList<String>( Arrays.asList( | ||
| // General | ||
| "sha3", | ||
| "fma", |
There was a problem hiding this comment.
I would put this under x86 or something.
There was a problem hiding this comment.
Please add
// Consult CPU_FEATURE_FLAGS in corresponding vm_version_.hpp file to find correct cpu feature's name.
Co-authored-by: Tobias Hartmann <tobias.hartmann@oracle.com>
TobiHartmann
left a comment
There was a problem hiding this comment.
Thanks for making these changes. Looks good to me.
|
@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 75 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 |
pfustc
left a comment
There was a problem hiding this comment.
Thank you for fixing this. LGTM
chhagedorn
left a comment
There was a problem hiding this comment.
Otherwise, looks good to me, too!
| // Please verify new CPU features before adding them. If we allow non-existent features | ||
| // on this list, we will ignore tests and never execute them. Consult CPU_FEATURE_FLAGS | ||
| // in corresponding vm_version_.hpp file to find correct cpu feature's name. | ||
| List<String> verifiedCPUFeatures = new ArrayList<String>( Arrays.asList( |
There was a problem hiding this comment.
I suggest to convert this local variable to a private static final field.
|
@pfustc @chhagedorn @TobiHartmann @vnkozlov thanks for the reviews and suggestions! |
|
Going to push as commit 1794f49.
Your commit was automatically rebased without conflicts. |
Wrongly typed cpuFeatures can lead to an IR rule being ignored.
Example: #12601 JDK-8302668
We should have a list of verified cpuFeatures, and assert if one is used that is not in that list. That way, typos and bad copies can be avoided, and we make sure the tests run when intended.
I verified the
intelcpuFeatures by hand on my laptop. And forasimdandsveI asked @tobiasholenstein and @nick-arm .sve1seems to have been a typo, and I am changing it tosve.Note: cpu-features can be displayed like this:
./java -Xlog:os+cpu --versionOn my machine, I get:
@nick-arm got this on one of his machines:
@tobiasholenstein got this:
I had to adapt a test that used a non-existent cpu feature. I replaced it with an impossible combination.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12669/head:pull/12669$ git checkout pull/12669Update a local copy of the PR:
$ git checkout pull/12669$ git pull https://git.openjdk.org/jdk pull/12669/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 12669View PR using the GUI difftool:
$ git pr show -t 12669Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12669.diff