Skip to content
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

8284848: C2: Compiler blackhole arguments should be treated as globally escaping #8228

Closed

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Apr 13, 2022

Blackholes should make the arguments to be treated as globally escaping, to match the expected behavior of legacy JMH blackholes. See more discussion in the bug.

Additional testing:

  • Linux x86_64 fastdebug tier1
  • Linux x86_64 fastdebug tier2
  • OpenJDK microbenchmark corpus sanity run

Progress

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

Issue

  • JDK-8284848: C2: Compiler blackhole arguments should be treated as globally escaping

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8228

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 13, 2022

👋 Welcome back shade! 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 openjdk bot added the rfr Pull request is ready for review label Apr 13, 2022
@openjdk
Copy link

openjdk bot commented Apr 13, 2022

@shipilev 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 hotspot-compiler-dev@openjdk.org label Apr 13, 2022
@mlbridge
Copy link

mlbridge bot commented Apr 13, 2022

Webrevs

@shipilev shipilev marked this pull request as draft April 13, 2022 17:30
@openjdk openjdk bot removed the rfr Pull request is ready for review label Apr 13, 2022
@vnkozlov
Copy link
Contributor

Yes, this looks good. And thank you for adding IR tests to verify it.

@shipilev shipilev marked this pull request as ready for review April 15, 2022 13:28
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 15, 2022
Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Looks good. Let me test it before approval.

@vnkozlov
Copy link
Contributor

Got failure in new tests when run with -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -XX:-TieredCompilation.

BlackholeSyncEATest.java failed:

Failed IR Rules (2) of Methods (1)
----------------------------------
1) Method "static void compiler.c2.irTests.blackhole.BlackholeSyncEATest.testBlackholed()" - [Failed IR rules: 2]:
   * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\\\d+(\\\\s){2}(FastLock.*)+(\\\\s){2}===.*)", "1"}, applyIfNot={})"
     - counts: Graph contains wrong number of nodes:
       * Regex 1: (\\d+(\\s){2}(FastLock.*)+(\\s){2}===.*)
         - Failed comparison: [found] 0 = 1 [given]
         - No nodes matched!
   * @IR rule 2: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\\\d+(\\\\s){2}(FastUnlock.*)+(\\\\s){2}===.*)", "1"}, applyIfNot={})"
     - counts: Graph contains wrong number of nodes:
       * Regex 1: (\\d+(\\s){2}(FastUnlock.*)+(\\s){2}===.*)
         - Failed comparison: [found] 0 = 1 [given]
         - No nodes matched!
         
Compilation(s) of failed match(es):
>>> Compilation of static void compiler.c2.irTests.blackhole.BlackholeSyncEATest.testBlackholed():
PrintIdeal:
 3  Start  ===  3  0  [[ 3  5  6  7  8  9 ]]  #{0:control, 1:abIO, 2:memory, 3:rawptr:BotPTR, 4:return_address}
 9  Parm  ===  3  [[ 105 ]] ReturnAdr !jvms: BlackholeSyncEATest::testBlackholed @ bci:-1 (line 75)
 8  Parm  ===  3  [[ 105 ]] FramePtr !jvms: BlackholeSyncEATest::testBlackholed @ bci:-1 (line 75)
 7  Parm  ===  3  [[ 105 ]] Memory  Memory: @BotPTR *+bot, idx=Bot; !orig=[34],40 !jvms: BlackholeSyncEATest::testBlackholed @ bci:-1 (line 75)
 6  Parm  ===  3  [[ 105 ]] I_O !orig=[35] !jvms: BlackholeSyncEATest::testBlackholed @ bci:-1 (line 75)
 5  Parm  ===  3  [[ 105 ]] Control !orig=[29],[38],[79],[83],[87],[91] !jvms: BlackholeSyncEATest::testBlackholed @ bci:-1 (line 75)
 105  Return  ===  5  6  7  8  9  [[ 0 ]] 
 0  Root  ===  0  105  [[ 0  1  3  20  21  22  108  107 ]] inner 

BlackholeStoreStoreEATest.java:

Failed IR Rules (1) of Methods (1)
----------------------------------
1) Method "static void compiler.c2.irTests.blackhole.BlackholeStoreStoreEATest.testBlackholed()" - [Failed IR rules: 1]:
   * @IR rule 1: "@compiler.lib.ir_framework.IR(failOn={}, applyIf={}, applyIfAnd={}, applyIfOr={}, counts={"(\\\\d+(\\\\s){2}(MemBarStoreStore.*)+(\\\\s){2}===.*)", "1"}, applyIfNot={})"
     - counts: Graph contains wrong number of nodes:
       * Regex 1: (\\d+(\\s){2}(MemBarStoreStore.*)+(\\s){2}===.*)
         - Failed comparison: [found] 0 = 1 [given]
         - No nodes matched!

Compilation(s) of failed match(es):
>>> Compilation of static void compiler.c2.irTests.blackhole.BlackholeStoreStoreEATest.testBlackholed():
PrintIdeal:
 3  Start  ===  3  0  [[ 3  5  6  7  8  9 ]]  #{0:control, 1:abIO, 2:memory, 3:rawptr:BotPTR, 4:return_address}
 9  Parm  ===  3  [[ 89 ]] ReturnAdr !jvms: BlackholeStoreStoreEATest::testBlackholed @ bci:-1 (line 55)
 8  Parm  ===  3  [[ 89 ]] FramePtr !jvms: BlackholeStoreStoreEATest::testBlackholed @ bci:-1 (line 55)
 7  Parm  ===  3  [[ 89 ]] Memory  Memory: @BotPTR *+bot, idx=Bot; !orig=[34],40 !jvms: BlackholeStoreStoreEATest::testBlackholed @ bci:-1 (line 55)
 6  Parm  ===  3  [[ 89 ]] I_O !orig=[35] !jvms: BlackholeStoreStoreEATest::testBlackholed @ bci:-1 (line 55)
 5  Parm  ===  3  [[ 89 ]] Control !orig=[29],[38] !jvms: BlackholeStoreStoreEATest::testBlackholed @ bci:-1 (line 55)
 89  Return  ===  5  6  7  8  9  [[ 0 ]] 
 0  Root  ===  0  89  [[ 0  1  3  20  21  22  91  92 ]] inner 

@shipilev
Copy link
Member Author

Got failure in new tests when run with -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -XX:-TieredCompilation.

Turns out to be a separate bug, JDK-8284848, PR #8344. Need to fix that one first.

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

Looks good.

@openjdk
Copy link

openjdk bot commented Apr 22, 2022

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

8284848: C2: Compiler blackhole arguments should be treated as globally escaping

Reviewed-by: kvn, thartmann

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 Pull request is ready to be integrated label Apr 22, 2022
@shipilev
Copy link
Member Author

Got failure in new tests when run with -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -XX:-TieredCompilation.

Turns out to be a separate bug, JDK-8284848, PR #8344. Need to fix that one first.

Merged from master, so this fix should now be in this PR base. I checked new tests work with the VM options above.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Good.

@shipilev
Copy link
Member Author

Thanks for reviews! It seems to work as expected in the benchmarks.

/integrate

@openjdk
Copy link

openjdk bot commented Apr 28, 2022

Going to push as commit 5629c75.
Since your change was applied there have been 66 commits pushed to the master branch:

  • 85f8d14: 8283994: Make Xerces DatatypeException stackless
  • 4f2e4c7: 8178969: [TESTBUG] Wrong reporting of gc/g1/humongousObjects/TestHeapCounters test.
  • 4795165: 8285696: AlgorithmConstraints:permits not throwing IllegalArgumentException when 'alg' is null
  • c1173c2: 8285493: ECC calculation error
  • 89fd6d3: 8284910: Buffer clean in PasswordCallback
  • cf1b00a: 8285683: Missing @ since 11 in java.security.spec.MGF1ParameterSpec fields
  • 3312d8c: 8285756: clean up use of bad arguments for @clean in langtools tests
  • 5c09349: 8285032: vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy008/ fails with "eventSet.suspendPolicy() != policyExpected"
  • 1f868f1: 8285658: Fix two typos in the spec of j.u.random.RandomGenerator
  • 8a16842: 8176501: Method Shape.getBounds2D() incorrectly includes Bezier control points in bounding box
  • ... and 56 more: https://git.openjdk.java.net/jdk/compare/ce8db2c40378de01ce35ca37ec315af47974d6d6...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 28, 2022
@openjdk openjdk bot closed this Apr 28, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 28, 2022
@openjdk
Copy link

openjdk bot commented Apr 28, 2022

@shipilev Pushed as commit 5629c75.

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

@shipilev shipilev deleted the JDK-8284848-blackhole-ea-args branch May 19, 2022 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
3 participants