From jiefu at openjdk.java.net Tue Mar 1 00:12:06 2022 From: jiefu at openjdk.java.net (Jie Fu) Date: Tue, 1 Mar 2022 00:12:06 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v6] In-Reply-To: <2OyaRp6UdLYtDJSJQash1i6Nfo4jriWELQA30ITrwIY=.ab68593c-de96-493f-a215-0be40cb69a36@github.com> References: <2OyaRp6UdLYtDJSJQash1i6Nfo4jriWELQA30ITrwIY=.ab68593c-de96-493f-a215-0be40cb69a36@github.com> Message-ID: On Mon, 28 Feb 2022 23:42:13 GMT, Quan Anh Mai wrote: > The tool measures the throughput of the operations, which is the number of cycles per iteration. Because the processor can execute multiple instructions at the same time, to measure the latency, you should create a dependency chain between the output of the instruction and its input in the next iteration. The technique used by uops.info is to `movsx` (which is an instruction that is not elided) from the output operand back to the input operand, so that the processor must wait for the result of the previous iteration before executing the next one, instead of executing multiple iterations concurrently when there is a lack of dependencies. > > A simple `lea rax, [rbp + rcx + 0x8]; movsx rbp, eax` gives the throughput of 4 cycles, minus the latency of the `movsx` which is 1 gives you the documented latency of 3 (this is the latency between the output and the base operand, similar experiment will give the same answer for the latency between the output and the index operand). > > Thanks. Thanks for your clarification. I will try it later today. I would suggest reverting unnecessary changes of the other register operand definitions in the AD file. ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From sviswanathan at openjdk.java.net Tue Mar 1 01:57:09 2022 From: sviswanathan at openjdk.java.net (Sandhya Viswanathan) Date: Tue, 1 Mar 2022 01:57:09 GMT Subject: RFR: 8281375: Accelerate bitCount operation for AVX2 and AVX512 target. [v6] In-Reply-To: References: Message-ID: On Fri, 25 Feb 2022 01:11:41 GMT, Jatin Bhateja wrote: >> Summary of changes: >> >> - Patch extends existing vectorized bitCount optimization added with [JDK-8278868](https://bugs.openjdk.java.net/browse/JDK-8278868) and emits optimized JIT sequence for AVX2 and other AVX512 targets which do not support avx512_vpopcntdq feature. >> - Since PopCountVI/PopCountVL node emit different instruction sequence based on the target features hence a rudimentary cost mode has been added which influences the SLP unrolling factor to prevent generating bloated main loops. >> - Following are the performance results of an existing [JMH micro](https://github.com/jatin-bhateja/jdk/blob/master/test/micro/org/openjdk/bench/vm/compiler/VectorBitCount.java) over various X86 targets. >> >> >> Benchmark | SIZE | Baseline AVX2 (ns/op) | Withopt AVX2 (ns/op) | Gain % | Baseline AVX3 (ns/op) | Withopt AVX3 (ns/op) | Gain % | Baseline AVX3 (VPOPCOUNTDQ) | Withopt AVX3 (VPOCOUNTDQ) | Gain % >> -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- >> VectorBitCount.WithSuperword.intBitCount | 1024 | 1089.799 | 420.156 | 159.3796114 | 1083.92 | 203.958 | 431.442748 | 88.958 | 60.096 | 48.02649095 >> VectorBitCount.WithSuperword.longBitCount | 1024 | 417.458 | 413.859 | 0.869619846 | 417.203 | 214.949 | 94.09394787 | 105.954 | 117.019 | -9.455729411 >> >> Please review and share your feedback. >> >> Best Regards, >> Jatin > > Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: > > 8281375: Fix a typo. src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 4363: > 4361: movl(rtmp, 0x0F0F0F0F); > 4362: evpbroadcastd(xtmp1, rtmp, vec_enc); > 4363: evmovdqul(xtmp2, k0, ExternalAddress(StubRoutines::x86::vector_popcount_lut()), true, vec_enc, rtmp); In general merge can be set to false for all the instructions in this algorithm as the mask is always all true. src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 4375: > 4373: evpunpckldq(xtmp2, k0, xtmp3, xtmp1, true, vec_enc); > 4374: evpsadbw(xtmp2, k0, xtmp2, xtmp1, true, vec_enc); > 4375: vpackuswb(dst, xtmp2, dst, vec_enc); This doesn't look correct for say 512 bit vector length. At this point, the xtmp2 has 64-bit popcount results for lower 8 integers and dst has 64-bit popcount results for upper 8 integers. The vpackuswb does interleaving between xtmp2 and dst at 128 bit lanes so the result is not in correct order. src/hotspot/cpu/x86/x86.ad line 1871: > 1869: if ((vlen == 16) && !VM_Version::supports_avx512vlbw()) { > 1870: return false; > 1871: } This restriction was not there before this patch. This extra check should be only when supports_avx512_vpopcntdq() is false. src/hotspot/cpu/x86/x86.ad line 1876: > 1874: if ((vlen <= 4) || ((vlen == 8) && !VM_Version::supports_avx512vlbw())) { > 1875: return false; > 1876: } This restriction was not there before this patch. This extra check should be only when supports_avx512_vpopcntdq() is false. ------------- PR: https://git.openjdk.java.net/jdk/pull/7373 From duke at openjdk.java.net Tue Mar 1 02:28:00 2022 From: duke at openjdk.java.net (Quan Anh Mai) Date: Tue, 1 Mar 2022 02:28:00 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v7] In-Reply-To: References: Message-ID: > Hi, > > This patch adds several matching rules for x86_64 backend to use `lea` instructions for several fused arithmetic operations. Also, `lea`s don't kill flags and allow different `dst` and `src`, so it is preferred over `sll` if possible, too. > > Thank you very much. Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: remove irrelevent changes ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7560/files - new: https://git.openjdk.java.net/jdk/pull/7560/files/a866de71..31f23261 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7560&range=06 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7560&range=05-06 Stats: 6 lines in 2 files changed: 1 ins; 3 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/7560.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7560/head:pull/7560 PR: https://git.openjdk.java.net/jdk/pull/7560 From duke at openjdk.java.net Tue Mar 1 02:29:38 2022 From: duke at openjdk.java.net (Quan Anh Mai) Date: Tue, 1 Mar 2022 02:29:38 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v5] In-Reply-To: References: Message-ID: On Mon, 28 Feb 2022 15:02:25 GMT, Jie Fu wrote: >> Mostly for completeness only, do you think I should revert this? Thank you very much. > >> Mostly for completeness only, do you think I should revert this? Thank you very much. > > Yes. > I would suggest not touching unnecessary part of code. Thanks, I have removed irrelevant changes. ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From dlong at openjdk.java.net Tue Mar 1 03:55:31 2022 From: dlong at openjdk.java.net (Dean Long) Date: Tue, 1 Mar 2022 03:55:31 GMT Subject: RFR: 8282467: add extra diagnostics for JDK-8268184 Message-ID: Add more info to the assert to help diagnose what went wrong the next time it fails. ------------- Commit messages: - add extra info to assert Changes: https://git.openjdk.java.net/jdk/pull/7642/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7642&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8282467 Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/7642.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7642/head:pull/7642 PR: https://git.openjdk.java.net/jdk/pull/7642 From jbhateja at openjdk.java.net Tue Mar 1 04:43:00 2022 From: jbhateja at openjdk.java.net (Jatin Bhateja) Date: Tue, 1 Mar 2022 04:43:00 GMT Subject: RFR: 8281375: Accelerate bitCount operation for AVX2 and AVX512 target. [v6] In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 01:52:59 GMT, Sandhya Viswanathan wrote: >> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: >> >> 8281375: Fix a typo. > > src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 4375: > >> 4373: evpunpckldq(xtmp2, k0, xtmp3, xtmp1, true, vec_enc); >> 4374: evpsadbw(xtmp2, k0, xtmp2, xtmp1, true, vec_enc); >> 4375: vpackuswb(dst, xtmp2, dst, vec_enc); > > This doesn't look correct for say 512 bit vector length. At this point, the xtmp2 has 64-bit popcount results for lower 8 integers and dst has 64-bit popcount results for upper 8 integers. The vpackuswb does interleaving between xtmp2 and dst at 128 bit lanes so the result is not in correct order. original vector of integer = [ a3 a2 a1 a0] unpackldq = [0, a1, 0, a0] unpackhdq = [ 0, a3 , 0 , a2] perform sum of absolute difference and store the result into LSB 16 bits of each quad word. packuswb packs at lane granularity i.e, 128 bits packed. 128 bit 128 bit [0, sa3, 0, sa2] [ 0, sa1, 0, sa0 ] => [ sa3, sa2 , sa1, sa0] ------------- PR: https://git.openjdk.java.net/jdk/pull/7373 From darcy at openjdk.java.net Tue Mar 1 06:20:07 2022 From: darcy at openjdk.java.net (Joe Darcy) Date: Tue, 1 Mar 2022 06:20:07 GMT Subject: RFR: 8279508: Auto-vectorize Math.round API [v9] In-Reply-To: References: Message-ID: On Fri, 25 Feb 2022 06:22:42 GMT, Jatin Bhateja wrote: >> Summary of changes: >> - Intrinsify Math.round(float) and Math.round(double) APIs. >> - Extend auto-vectorizer to infer vector operations on encountering scalar IR nodes for above intrinsics. >> - Test creation using new IR testing framework. >> >> Following are the performance number of a JMH micro included with the patch >> >> Test System: Intel(R) Xeon(R) Platinum 8380 CPU @ 2.30GHz (Icelake Server) >> >> >> Benchmark | TESTSIZE | Baseline AVX3 (ops/ms) | Withopt AVX3 (ops/ms) | Gain ratio | Baseline AVX2 (ops/ms) | Withopt AVX2 (ops/ms) | Gain ratio >> -- | -- | -- | -- | -- | -- | -- | -- >> FpRoundingBenchmark.test_round_double | 1024.00 | 504.15 | 2209.54 | 4.38 | 510.36 | 548.39 | 1.07 >> FpRoundingBenchmark.test_round_double | 2048.00 | 293.64 | 1271.98 | 4.33 | 293.48 | 274.01 | 0.93 >> FpRoundingBenchmark.test_round_float | 1024.00 | 825.99 | 4754.66 | 5.76 | 751.83 | 2274.13 | 3.02 >> FpRoundingBenchmark.test_round_float | 2048.00 | 412.22 | 2490.09 | 6.04 | 388.52 | 1334.18 | 3.43 >> >> >> Kindly review and share your feedback. >> >> Best Regards, >> Jatin > > Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: > > 8279508: Adding descriptive comments. test/jdk/java/lang/Math/RoundTests.java line 32: > 30: public static void main(String... args) { > 31: int failures = 0; > 32: for (int i = 0; i < 100000; i++) { Is there an idiom to trigger the auto-vectorization, perhaps using command line arguments, that doesn't bloat the running time of this test? ------------- PR: https://git.openjdk.java.net/jdk/pull/7094 From stuefe at openjdk.java.net Tue Mar 1 08:28:05 2022 From: stuefe at openjdk.java.net (Thomas Stuefe) Date: Tue, 1 Mar 2022 08:28:05 GMT Subject: RFR: 8282467: add extra diagnostics for JDK-8268184 In-Reply-To: References: Message-ID: <53j8D0ipIn7lyqJVEoLniuEH7k8E-IANIxh4-92Y1ug=.b1155585-13e0-4b56-9be2-9e0c89390174@github.com> On Tue, 1 Mar 2022 03:48:00 GMT, Dean Long wrote: > Add more info to the assert to help diagnose what went wrong the next time it fails. Looks good (and trivial). Cheers, Thomas ------------- Marked as reviewed by stuefe (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7642 From dlong at openjdk.java.net Tue Mar 1 08:28:06 2022 From: dlong at openjdk.java.net (Dean Long) Date: Tue, 1 Mar 2022 08:28:06 GMT Subject: RFR: 8282467: add extra diagnostics for JDK-8268184 In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 03:48:00 GMT, Dean Long wrote: > Add more info to the assert to help diagnose what went wrong the next time it fails. Thanks Thomas! ------------- PR: https://git.openjdk.java.net/jdk/pull/7642 From dlong at openjdk.java.net Tue Mar 1 08:28:06 2022 From: dlong at openjdk.java.net (Dean Long) Date: Tue, 1 Mar 2022 08:28:06 GMT Subject: Integrated: 8282467: add extra diagnostics for JDK-8268184 In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 03:48:00 GMT, Dean Long wrote: > Add more info to the assert to help diagnose what went wrong the next time it fails. This pull request has now been integrated. Changeset: d3022f87 Author: Dean Long URL: https://git.openjdk.java.net/jdk/commit/d3022f87b598398d7130e984088ede6ffc9f48e1 Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod 8282467: add extra diagnostics for JDK-8268184 Reviewed-by: stuefe ------------- PR: https://git.openjdk.java.net/jdk/pull/7642 From thartmann at openjdk.java.net Tue Mar 1 11:24:12 2022 From: thartmann at openjdk.java.net (Tobias Hartmann) Date: Tue, 1 Mar 2022 11:24:12 GMT Subject: RFR: 8280003: C1: Reconsider uses of logical_and immediates in LIRGenerator::do_getObjectSize [v5] In-Reply-To: References: <4wfmxqeneC0qL6x2cFaMVp-AWoQVbognQdKjV_nx4_U=.40d443e8-d900-472c-857d-841efabebc3d@github.com> Message-ID: <9l1WUJNoCCvcqzyi1qUjpBrHwPx_oGnkMSUwcv6mU3k=.23606457-c298-42bc-a57b-359ae8c60209@github.com> On Tue, 8 Feb 2022 07:20:19 GMT, Aleksey Shipilev wrote: >> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: >> >> Revert ARM32 checks > > This needs attention of compiler/C1 reviewer :) @shipilev Looks like this is good to go in? ------------- PR: https://git.openjdk.java.net/jdk/pull/7080 From roland at openjdk.java.net Tue Mar 1 12:05:05 2022 From: roland at openjdk.java.net (Roland Westrelin) Date: Tue, 1 Mar 2022 12:05:05 GMT Subject: RFR: 8277055: Assert "missing inlining msg" with -XX:+PrintIntrinsics In-Reply-To: <4O-VnRkcKYv4jHhr1XXsDudUMnhEebv-_ocX0stgqqE=.2f9d8be0-2105-4de0-bbca-ba06936e121e@github.com> References: <4O-VnRkcKYv4jHhr1XXsDudUMnhEebv-_ocX0stgqqE=.2f9d8be0-2105-4de0-bbca-ba06936e121e@github.com> Message-ID: <98x5pksGgRh2Qf1v35Yy4XCcoFC2EfOuAMf5zQ0HSDA=.a19a393e-e123-4f54-a186-9958a86bd986@github.com> On Tue, 8 Feb 2022 16:57:20 GMT, Tobias Holenstein wrote: > in `CallGenerator::do_late_inline_helper()` we hit an assert `"missing inlining msg"` when calling `C->print_inlining_update_delayed(this)`. The reason is that not all implementations of do_late_inline_check() print an inline message. The fix is to add an inline message for the two `return false` in `LateInlineVirtualCallGenerator::do_late_inline_check(...)` where we do not print an inline message. > > Tier1-3 passed Looks good to me. ------------- Marked as reviewed by roland (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7385 From chagedorn at openjdk.java.net Tue Mar 1 13:10:33 2022 From: chagedorn at openjdk.java.net (Christian Hagedorn) Date: Tue, 1 Mar 2022 13:10:33 GMT Subject: RFR: 8282480: IGV: Use description instead of enum name for phases Message-ID: [JDK-8281505](https://bugs.openjdk.java.net/browse/JDK-8281505) changed the `PrintIdeal` output to use the enum name of a phase when used with `PrintIdealPhase` instead of the description. However, it also changed the phase name shown in the IGV to the enum name. This should be reverted back for a better readability. IGV after JDK-8281505: ![Screenshot from 2022-03-01 13-59-15](https://user-images.githubusercontent.com/17833009/156173248-7f6450cb-9816-437a-b5fa-816a2e214ad9.png) IGV before JDK-8281505/with this patch: ![Screenshot from 2022-03-01 13-58-36](https://user-images.githubusercontent.com/17833009/156173243-0a0f975a-a44d-46a6-a48a-5183ff7600e1.png) Thanks, Christian ------------- Commit messages: - 8282480: IGV: Use description instead of enum name for phases Changes: https://git.openjdk.java.net/jdk/pull/7645/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7645&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8282480 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/7645.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7645/head:pull/7645 PR: https://git.openjdk.java.net/jdk/pull/7645 From redestad at openjdk.java.net Tue Mar 1 13:32:58 2022 From: redestad at openjdk.java.net (Claes Redestad) Date: Tue, 1 Mar 2022 13:32:58 GMT Subject: RFR: 8282480: IGV: Use description instead of enum name for phases In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 13:03:50 GMT, Christian Hagedorn wrote: > [JDK-8281505](https://bugs.openjdk.java.net/browse/JDK-8281505) changed the `PrintIdeal` output to use the enum name of a phase when used with `PrintIdealPhase` instead of the description. However, it also changed the phase name shown in the IGV to the enum name. This should be reverted back for a better readability. > > IGV after JDK-8281505: > ![Screenshot from 2022-03-01 13-59-15](https://user-images.githubusercontent.com/17833009/156173248-7f6450cb-9816-437a-b5fa-816a2e214ad9.png) > > IGV before JDK-8281505/with this patch: > ![Screenshot from 2022-03-01 13-58-36](https://user-images.githubusercontent.com/17833009/156173243-0a0f975a-a44d-46a6-a48a-5183ff7600e1.png) > > Thanks, > Christian Marked as reviewed by redestad (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/7645 From thartmann at openjdk.java.net Tue Mar 1 13:55:05 2022 From: thartmann at openjdk.java.net (Tobias Hartmann) Date: Tue, 1 Mar 2022 13:55:05 GMT Subject: RFR: 8282480: IGV: Use description instead of enum name for phases In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 13:03:50 GMT, Christian Hagedorn wrote: > [JDK-8281505](https://bugs.openjdk.java.net/browse/JDK-8281505) changed the `PrintIdeal` output to use the enum name of a phase when used with `PrintIdealPhase` instead of the description. However, it also changed the phase name shown in the IGV to the enum name. This should be reverted back for a better readability. > > IGV after JDK-8281505: > ![Screenshot from 2022-03-01 13-59-15](https://user-images.githubusercontent.com/17833009/156173248-7f6450cb-9816-437a-b5fa-816a2e214ad9.png) > > IGV before JDK-8281505/with this patch: > ![Screenshot from 2022-03-01 13-58-36](https://user-images.githubusercontent.com/17833009/156173243-0a0f975a-a44d-46a6-a48a-5183ff7600e1.png) > > Thanks, > Christian Looks good and trivial. ------------- Marked as reviewed by thartmann (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7645 From thartmann at openjdk.java.net Tue Mar 1 14:01:05 2022 From: thartmann at openjdk.java.net (Tobias Hartmann) Date: Tue, 1 Mar 2022 14:01:05 GMT Subject: RFR: 8281811: assert(_base == Tuple) failed: Not a Tuple after JDK-8280799 [v3] In-Reply-To: <5cPXKQx_MBcV8TVASmC1CziX6khVGMIPePn0qa0nplU=.2c0621ea-b24b-4ef4-877f-b42d2977d330@github.com> References: <5cPXKQx_MBcV8TVASmC1CziX6khVGMIPePn0qa0nplU=.2c0621ea-b24b-4ef4-877f-b42d2977d330@github.com> Message-ID: On Mon, 28 Feb 2022 12:42:28 GMT, Roland Westrelin wrote: >> The crash occurs because a Shenandoah barrier is expanded between the >> Start node and its control projection. One of the test cases I added >> also shows the same failure with a barrier expansion between a MemBar >> and its control projection. The barrier is expanded at the control >> that PhaseIdealLoop assigns to it. >> >> This code: >> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/loopnode.cpp#L5756 >> I added back with JDK-8280799 is what's causing the incorrect >> placement of the barrier. >> >> The fix I propose is to skip that logic if the loop opts pass is for >> barrier expansion as there's no range check elimination then. > > Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision: > > merge error Okay, thanks for the explanation. Looks good to me. ------------- Marked as reviewed by thartmann (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7494 From thartmann at openjdk.java.net Tue Mar 1 14:03:08 2022 From: thartmann at openjdk.java.net (Tobias Hartmann) Date: Tue, 1 Mar 2022 14:03:08 GMT Subject: RFR: 8282045: When loop strip mining fails, safepoints are removed from loop anyway [v2] In-Reply-To: References: Message-ID: On Mon, 28 Feb 2022 13:20:41 GMT, Roland Westrelin wrote: >> I noticed that if loop strip mining fails because a safepoint is not >> found right above the exit test (following partial peel for instance), >> all safepoints are removed from the loop anyway. That's fixed by the >> change in IdealLoopTree::counted_loop() where rather than test if loop >> strip mining is enabled, the check now verifies that loop strip mining >> was successful. >> >> With that change, >> compiler/c2/irTests/TestAutoVectorization2DArray.java fails. The loop >> is not converted into a strip mined loop because there's no safepoint >> above the exit test after partial peeling. The loop strip mining logic >> is too strict when it comes to the safepoint location. Any safepoint >> that dominates the exit and is in the loop as long as there's no side >> effect between the safepoint and the exit can be used. The patch >> implements that change as well. TestAutoVectorization2DArray.java >> passes as a result. >> >> The existing requirement to have no safepoint on the backedge is too >> strict as well. If the loop has another safepoint that can be used for >> strip mining, then the safepoint on the backedge can safely be >> dropped. That's also implemented by the patch. > > Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: > > - review > - Merge branch 'master' into JDK-8282045 > - whitespaces > - fix & test Thanks, looks good to me. Also, I executed some testing and it all passed. ------------- Marked as reviewed by thartmann (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7513 From roland at openjdk.java.net Tue Mar 1 14:13:06 2022 From: roland at openjdk.java.net (Roland Westrelin) Date: Tue, 1 Mar 2022 14:13:06 GMT Subject: RFR: 8281811: assert(_base == Tuple) failed: Not a Tuple after JDK-8280799 [v3] In-Reply-To: References: Message-ID: On Wed, 16 Feb 2022 19:02:27 GMT, Vladimir Kozlov wrote: >> Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision: >> >> merge error > > Good. @vnkozlov @TobiHartmann thanks for the reviews. ------------- PR: https://git.openjdk.java.net/jdk/pull/7494 From roland at openjdk.java.net Tue Mar 1 14:13:08 2022 From: roland at openjdk.java.net (Roland Westrelin) Date: Tue, 1 Mar 2022 14:13:08 GMT Subject: Integrated: 8281811: assert(_base == Tuple) failed: Not a Tuple after JDK-8280799 In-Reply-To: References: Message-ID: On Wed, 16 Feb 2022 13:28:48 GMT, Roland Westrelin wrote: > The crash occurs because a Shenandoah barrier is expanded between the > Start node and its control projection. One of the test cases I added > also shows the same failure with a barrier expansion between a MemBar > and its control projection. The barrier is expanded at the control > that PhaseIdealLoop assigns to it. > > This code: > https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/loopnode.cpp#L5756 > I added back with JDK-8280799 is what's causing the incorrect > placement of the barrier. > > The fix I propose is to skip that logic if the loop opts pass is for > barrier expansion as there's no range check elimination then. This pull request has now been integrated. Changeset: fcce24c5 Author: Roland Westrelin URL: https://git.openjdk.java.net/jdk/commit/fcce24c5b3cd1dab755fd9b6779af71f4dd78773 Stats: 88 lines in 3 files changed: 74 ins; 0 del; 14 mod 8281811: assert(_base == Tuple) failed: Not a Tuple after JDK-8280799 Reviewed-by: kvn, thartmann ------------- PR: https://git.openjdk.java.net/jdk/pull/7494 From duke at openjdk.java.net Tue Mar 1 14:13:50 2022 From: duke at openjdk.java.net (Tobias Holenstein) Date: Tue, 1 Mar 2022 14:13:50 GMT Subject: RFR: 8277055: Assert "missing inlining msg" with -XX:+PrintIntrinsics [v2] In-Reply-To: <4O-VnRkcKYv4jHhr1XXsDudUMnhEebv-_ocX0stgqqE=.2f9d8be0-2105-4de0-bbca-ba06936e121e@github.com> References: <4O-VnRkcKYv4jHhr1XXsDudUMnhEebv-_ocX0stgqqE=.2f9d8be0-2105-4de0-bbca-ba06936e121e@github.com> Message-ID: > in `CallGenerator::do_late_inline_helper()` we hit an assert `"missing inlining msg"` when calling `C->print_inlining_update_delayed(this)`. The reason is that not all implementations of do_late_inline_check() print an inline message. The fix is to add an inline message for the two `return false` in `LateInlineVirtualCallGenerator::do_late_inline_check(...)` where we do not print an inline message. > > Tier1-3 passed Tobias Holenstein has updated the pull request incrementally with one additional commit since the last revision: more detailed message ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7385/files - new: https://git.openjdk.java.net/jdk/pull/7385/files/162e97aa..deae1189 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7385&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7385&range=00-01 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/7385.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7385/head:pull/7385 PR: https://git.openjdk.java.net/jdk/pull/7385 From thartmann at openjdk.java.net Tue Mar 1 14:13:51 2022 From: thartmann at openjdk.java.net (Tobias Hartmann) Date: Tue, 1 Mar 2022 14:13:51 GMT Subject: RFR: 8277055: Assert "missing inlining msg" with -XX:+PrintIntrinsics [v2] In-Reply-To: References: <4O-VnRkcKYv4jHhr1XXsDudUMnhEebv-_ocX0stgqqE=.2f9d8be0-2105-4de0-bbca-ba06936e121e@github.com> Message-ID: <74tdeSabkBWUN8o7TbaTAvPMlWsze-e9T9AavG0X3rQ=.13d080af-adb6-4bbd-b076-677807ce36a2@github.com> On Tue, 1 Mar 2022 14:09:38 GMT, Tobias Holenstein wrote: >> in `CallGenerator::do_late_inline_helper()` we hit an assert `"missing inlining msg"` when calling `C->print_inlining_update_delayed(this)`. The reason is that not all implementations of do_late_inline_check() print an inline message. The fix is to add an inline message for the two `return false` in `LateInlineVirtualCallGenerator::do_late_inline_check(...)` where we do not print an inline message. >> >> Tier1-3 passed > > Tobias Holenstein has updated the pull request incrementally with one additional commit since the last revision: > > more detailed message Looks good to me too. Thanks for updating the inlining message to include the reason. ------------- Marked as reviewed by thartmann (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7385 From chagedorn at openjdk.java.net Tue Mar 1 14:27:02 2022 From: chagedorn at openjdk.java.net (Christian Hagedorn) Date: Tue, 1 Mar 2022 14:27:02 GMT Subject: RFR: 8282480: IGV: Use description instead of enum name for phases In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 13:03:50 GMT, Christian Hagedorn wrote: > [JDK-8281505](https://bugs.openjdk.java.net/browse/JDK-8281505) changed the `PrintIdeal` output to use the enum name of a phase when used with `PrintIdealPhase` instead of the description. However, it also changed the phase name shown in the IGV to the enum name. This should be reverted back for a better readability. > > IGV after JDK-8281505: > ![Screenshot from 2022-03-01 13-59-15](https://user-images.githubusercontent.com/17833009/156173248-7f6450cb-9816-437a-b5fa-816a2e214ad9.png) > > IGV before JDK-8281505/with this patch: > ![Screenshot from 2022-03-01 13-58-36](https://user-images.githubusercontent.com/17833009/156173243-0a0f975a-a44d-46a6-a48a-5183ff7600e1.png) > > Thanks, > Christian Thanks Claes and Tobias for your reviews! ------------- PR: https://git.openjdk.java.net/jdk/pull/7645 From chagedorn at openjdk.java.net Tue Mar 1 14:37:08 2022 From: chagedorn at openjdk.java.net (Christian Hagedorn) Date: Tue, 1 Mar 2022 14:37:08 GMT Subject: RFR: 8282045: When loop strip mining fails, safepoints are removed from loop anyway [v2] In-Reply-To: References: Message-ID: On Mon, 28 Feb 2022 13:20:41 GMT, Roland Westrelin wrote: >> I noticed that if loop strip mining fails because a safepoint is not >> found right above the exit test (following partial peel for instance), >> all safepoints are removed from the loop anyway. That's fixed by the >> change in IdealLoopTree::counted_loop() where rather than test if loop >> strip mining is enabled, the check now verifies that loop strip mining >> was successful. >> >> With that change, >> compiler/c2/irTests/TestAutoVectorization2DArray.java fails. The loop >> is not converted into a strip mined loop because there's no safepoint >> above the exit test after partial peeling. The loop strip mining logic >> is too strict when it comes to the safepoint location. Any safepoint >> that dominates the exit and is in the loop as long as there's no side >> effect between the safepoint and the exit can be used. The patch >> implements that change as well. TestAutoVectorization2DArray.java >> passes as a result. >> >> The existing requirement to have no safepoint on the backedge is too >> strict as well. If the loop has another safepoint that can be used for >> strip mining, then the safepoint on the backedge can safely be >> dropped. That's also implemented by the patch. > > Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: > > - review > - Merge branch 'master' into JDK-8282045 > - whitespaces > - fix & test Looks good to me! ------------- Marked as reviewed by chagedorn (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7513 From roland at openjdk.java.net Tue Mar 1 14:47:07 2022 From: roland at openjdk.java.net (Roland Westrelin) Date: Tue, 1 Mar 2022 14:47:07 GMT Subject: RFR: 8282045: When loop strip mining fails, safepoints are removed from loop anyway [v2] In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 13:59:31 GMT, Tobias Hartmann wrote: >> Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: >> >> - review >> - Merge branch 'master' into JDK-8282045 >> - whitespaces >> - fix & test > > Also, I executed some testing and it all passed. @TobiHartmann @chhagedorn thanks for the reviews. ------------- PR: https://git.openjdk.java.net/jdk/pull/7513 From roland at openjdk.java.net Tue Mar 1 14:47:09 2022 From: roland at openjdk.java.net (Roland Westrelin) Date: Tue, 1 Mar 2022 14:47:09 GMT Subject: Integrated: 8282045: When loop strip mining fails, safepoints are removed from loop anyway In-Reply-To: References: Message-ID: On Thu, 17 Feb 2022 10:00:32 GMT, Roland Westrelin wrote: > I noticed that if loop strip mining fails because a safepoint is not > found right above the exit test (following partial peel for instance), > all safepoints are removed from the loop anyway. That's fixed by the > change in IdealLoopTree::counted_loop() where rather than test if loop > strip mining is enabled, the check now verifies that loop strip mining > was successful. > > With that change, > compiler/c2/irTests/TestAutoVectorization2DArray.java fails. The loop > is not converted into a strip mined loop because there's no safepoint > above the exit test after partial peeling. The loop strip mining logic > is too strict when it comes to the safepoint location. Any safepoint > that dominates the exit and is in the loop as long as there's no side > effect between the safepoint and the exit can be used. The patch > implements that change as well. TestAutoVectorization2DArray.java > passes as a result. > > The existing requirement to have no safepoint on the backedge is too > strict as well. If the loop has another safepoint that can be used for > strip mining, then the safepoint on the backedge can safely be > dropped. That's also implemented by the patch. This pull request has now been integrated. Changeset: 2c5d266f Author: Roland Westrelin URL: https://git.openjdk.java.net/jdk/commit/2c5d266f9f20005bc2a6c30dcaa95b059ea59d74 Stats: 203 lines in 3 files changed: 165 ins; 25 del; 13 mod 8282045: When loop strip mining fails, safepoints are removed from loop anyway Reviewed-by: thartmann, chagedorn ------------- PR: https://git.openjdk.java.net/jdk/pull/7513 From thartmann at openjdk.java.net Tue Mar 1 15:40:04 2022 From: thartmann at openjdk.java.net (Tobias Hartmann) Date: Tue, 1 Mar 2022 15:40:04 GMT Subject: RFR: 8281548: Add escape analysis tracing flag [v6] In-Reply-To: References: <2dtKKhSjWC-V6rTVyrtDJBD0srUUWy5BDdAJjsoTaac=.68a0d585-4931-4114-ae72-1e9fbbfe32d8@github.com> Message-ID: <01jKztyIoud-G62fKKAjCGrhBZuJeD5Nr8ZkHYOyTFA=.20ef8440-00f9-45cb-a107-805f88b477b4@github.com> On Fri, 25 Feb 2022 12:57:46 GMT, Jorn Vernee wrote: >> Hi, >> >> This PR adds `TraceEscapeAnalysis` as a compiler directive and compile command (but not as global flag). The flag is intended to be used to track down the source of an object's escape, or why it is disqualified from scalar replacement for another reason. >> >> It starts by dumping the inital EA worklist, and then has individual trace messages for when a node's escape state is updated, or when it is marked as not scalar replaceable. I've already succesfully used this to track down a failure to scalar replace an allocation myself (see sample output), so it seemed useful to upstream. >> >> There were also 2 instances where I couldn't quite figure out the reason for a state update from the surrounding code. I've left the reason string as "reason unknown" in those cases, for now. Maybe someone could point out a better reason string for those cases? >> >>
>> Sample output (click to unfold) >> >> The object I'm interested in is represented by node JavaObject(22). From the messages under `+++++ Calculating escapse states and scalar replaceability` it can be traced back like: JavaObject(22) ->LocalVar(46) -> LocalVar(55) -> LocalVar(60) -> escapes as argument to call. >> >> >> +++++ Initial worklist for static jint main.PtrPass.panama_call_as_address(jobject) (ea_inv=0) >> JavaObject(0) GlobalEscape(GlobalEscape) NSR [ [ 66 255 248 241 246 ]] 1 Con === 0 [[]] #top >> JavaObject(2) GlobalEscape(GlobalEscape) NSR [ [ ]] 88 ConP === 0 [[ 162 44 42 154 57 43 ]] #java/lang/invoke/BoundMethodHandle$Species_L:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_L:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(3) GlobalEscape(GlobalEscape) NSR [ [ ]] 65 ConP === 0 [[ 106 36 41 40 38 39 ]] #java/lang/invoke/BoundMethodHandle$Species_LLLLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLLLL:exact * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(1) NoEscape(NoEscape) [ [ ]] 62 ConP === 0 [[ 215 34 217 37 260 ]] #NULL !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(4) GlobalEscape(GlobalEscape) NSR [ [ ]] 242 ConP === 0 [[ 216 ]] #precise jdk/internal/foreign/NativeMemorySegmentImpl: 0x00000281c0ebb790:Constant:exact * Klass:precise jdk/internal/foreign/NativeMemorySegmentImpl: 0x00000281c0ebb790:Constant:exact * !jvms: ConfinedScope::isAlive @ bci:6 (line 60) ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(5) GlobalEscape(GlobalEscape) NSR [ [ ]] 89 ConP === 0 [[ 154 42 ]] #java/lang/invoke/BoundMethodHandle$Species_LLLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLLL:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(6) GlobalEscape(GlobalEscape) NSR [ [ ]] 126 ConP === 0 [[ 54 ]] #java/lang/invoke/BoundMethodHandle$Species_LLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLL:exact * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(7) GlobalEscape(GlobalEscape) NSR [ [ ]] 132 ConP === 0 [[ 57 ]] #jdk/internal/invoke/NativeEntryPoint:exact * Oop:jdk/internal/invoke/NativeEntryPoint:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(8) GlobalEscape(GlobalEscape) NSR [ [ ]] 98 ConP === 0 [[ 43 57 44 ]] #jdk/internal/foreign/abi/Binding$Context$3:exact * Oop:jdk/internal/foreign/abi/Binding$Context$3:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(9) ArgEscape(ArgEscape) NSR [ 183F [ ]] 221 ThreadLocal === 0 [[ 183 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(10) GlobalEscape(GlobalEscape) NSR [ [ ]] 270 ConP === 0 [[ 263 ]] #precise jdk/internal/foreign/ResourceScopeImpl$GlobalScopeImpl: 0x00000281c09d2ae0:Constant:exact * Klass:precise jdk/internal/foreign/ResourceScopeImpl$GlobalScopeImpl: 0x00000281c09d2ae0:Constant:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(11) GlobalEscape(GlobalEscape) NSR [ [ ]] 247 ConP === 0 [[ 224 ]] #precise jdk/internal/foreign/ConfinedScope: 0x00000281c09d2ba8:Constant:exact * Klass:precise jdk/internal/foreign/ConfinedScope: 0x00000281c09d2ba8:Constant:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(12) GlobalEscape(GlobalEscape) NSR [ [ ]] 161 ConP === 0 [[ 106 237 229 ]] #precise jdk/internal/foreign/MemoryAddressImpl: 0x00000281c0ebb858:Constant:exact * Klass:precise jdk/internal/foreign/MemoryAddressImpl: 0x00000281c0ebb858:Constant:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(13) GlobalEscape(GlobalEscape) NSR [ [ ]] 170 ConN === 0 [[ 118 235 ]] #narrowoop: jdk/internal/foreign/NativeSymbolImpl:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(14) GlobalEscape(GlobalEscape) NSR [ [ ]] 123 ConP === 0 [[ 154 54 ]] #precise [jdk/internal/foreign/Scoped: 0x00000281c0ee6438 *: :Constant:exact * Klass:precise [jdk/internal/foreign/Scoped: 0x00000281c0ee6438 *: :Constant:exact * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(15) GlobalEscape(GlobalEscape) NSR [ [ ]] 128 ConP === 0 [[ 54 154 ]] #java/lang/invoke/BoundMethodHandle$Species_LLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLL:exact * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(16) GlobalEscape(GlobalEscape) NSR [ [ ]] 87 ConP === 0 [[ 54 162 42 57 44 43 42 154 154 154 42 ]] #jdk/internal/foreign/NativeSymbolImpl:exact * Oop:jdk/internal/foreign/NativeSymbolImpl:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(17) GlobalEscape(GlobalEscape) NSR [ [ ]] 93 ConP === 0 [[ 42 ]] #java/lang/invoke/MemberName:exact * Oop:java/lang/invoke/MemberName:exact * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(18) GlobalEscape(GlobalEscape) NSR [ [ ]] 92 ConP === 0 [[ 42 ]] #java/lang/Class:exact * Oop:java/lang/Class:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(19) GlobalEscape(GlobalEscape) NSR [ [ ]] 91 ConP === 0 [[ 42 ]] #java/lang/invoke/BoundMethodHandle$Species_LL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LL:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(20) GlobalEscape(GlobalEscape) NSR [ [ ]] 90 ConP === 0 [[ 154 42 ]] #java/lang/invoke/BoundMethodHandle$Species_LLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLL:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(1) NoEscape(NoEscape) [ [ ]] 62 ConP === 0 [[ 215 34 217 37 260 ]] #NULL !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(21) NoEscape(NoEscape) [ [ 234 ]] 154 AllocateArray === 174 83 84 15 1 ( 122 123 124 125 1 1 1 1 1 86 87 1 88 1 1 1 1 1 1 89 87 86 1 1 1 1 90 1 1 1 1 1 1 1 1 1 87 127 1 1 128 1 1 1 1 1 1 1 1 1 1 1 ) [[ 258 257 209 252 95 234 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, int ) Array::newInstance @ bci:2 (line 78) 0x0000000800c05c00::invokeStatic @ bci:11 0x0000000800c06800::invoke @ bci:21 0x0000000800c15800::collector @ bci:13 0x0000000800c1c000::invoke @ bci:44 0x0000000800c1c400::invoke @ bci:16 0x0000000800c21c00::invoke @ bci:46 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) >> JavaObject(22) NoEscape(NoEscape) [ [ 198 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(23) NoEscape(NoEscape) +8 ( )[ [ ]] 269 AddP === _ 66 66 274 [[ 259 ]] Interface:java/lang/foreign/MemorySegment:NotNull+8 * [narrowklass] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(24) NoEscape(NoEscape) +8 ( )[ [ ]] 273 AddP === _ 101 101 274 [[ 268 ]] Interface:java/lang/foreign/MemoryAddress:NotNull+8 * [narrowklass] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(25) NoEscape(NoEscape) +8 ( )[ [ ]] 272 AddP === _ 86 86 274 [[ 265 ]] Interface:java/lang/foreign/MemoryAddress:NotNull+8 * [narrowklass] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(26) NoEscape(NoEscape) +8 ( )[ [ ]] 271 AddP === _ 71 71 274 [[ 264 ]] Oop:jdk/internal/foreign/ResourceScopeImpl:NotNull+8 * [narrowklass] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(27) NoEscape(NoEscape) [ [ 117 ]] 54 AllocateArray === 120 121 55 15 1 ( 122 123 124 125 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 33 1 1 1 126 1 1 1 1 1 1 1 1 1 87 127 1 1 128 1 1 1 1 1 1 1 1 1 1 1 ) [[ 203 164 107 168 31 117 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, int ) Array::newInstance @ bci:2 (line 78) 0x0000000800c05c00::invokeStatic @ bci:11 0x0000000800c06800::invoke @ bci:21 0x0000000800c15800::collector @ bci:13 0x0000000800c1c000::invoke @ bci:44 0x0000000800c1c800::invoke @ bci:17 0x0000000800c21c00::invoke @ bci:61 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(28) NoEscape(NoEscape) oop +24 ( )[ [ 182 ]] 220 AddP === _ 70 70 122 [[ 182 ]] Oop:jdk/internal/foreign/NativeMemorySegmentImpl:NotNull:exact+24 * [narrow] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(29) NoEscape(NoEscape) oop +24 ( )[ [ 143 ]] 184 AddP === _ 71 71 122 [[ 143 ]] Oop:jdk/internal/foreign/ResourceScopeImpl:NotNull+24 * [narrow] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(30) NoEscape(NoEscape) oop ( 221P )[ [ 142 ]] 183 AddP === _ 1 221 222 [[ 142 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(31) NoEscape(NoEscape) +12 ( )[ [ ]] 146 AddP === _ 189 189 190 [[ 77 ]] Oop:jdk/internal/foreign/ConfinedScope:NotNull:exact+12 * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(32) NoEscape(NoEscape) oop +20 ( )[ [ ]] 171 AddP === _ 1 117 212 [[ 119 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(33) NoEscape(NoEscape) oop +20 ( )[ [ ]] 254 AddP === _ 1 234 212 [[ 236 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(34) NoEscape(NoEscape) +32 ( )[ [ ]] 148 AddP === _ 70 70 193 [[ 80 ]] Oop:jdk/internal/foreign/NativeMemorySegmentImpl:NotNull:exact+32 * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(35) NoEscape(NoEscape) oop +16 ( )[ [ ]] 169 AddP === _ 1 117 211 [[ 118 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(36) NoEscape(NoEscape) +16 ( )[ [ ]] 267 AddP === _ 1 198 211 [[ 251 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(37) NoEscape(NoEscape) +16 ( )[ [ ]] 175 AddP === _ 214 214 211 [[ 131 ]] Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact+16 * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(38) NoEscape(NoEscape) oop +16 ( )[ [ ]] 253 AddP === _ 1 234 211 [[ 235 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(39) NoEscape(NoEscape) [ [ ]] 72 LoadP === _ 60 142 [[ 38 219 ]] @rawptr:NotNull, idx=Raw; #java/lang/Thread:NotNull * Oop:java/lang/Thread:NotNull * >> LocalVar(40) NoEscape(NoEscape) [ 183F [ ]] 142 LoadP === _ 60 183 [[ 72 ]] @rawptr:BotPTR, idx=Raw; #rawptr:NotNull (does not depend only on test) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(41) NoEscape(NoEscape) [ 184F [ 73 ]] 143 LoadN === _ 60 184 [[ 73 ]] @jdk/internal/foreign/ResourceScopeImpl+24 * [narrow], name=owner, idx=6; #narrowoop: java/lang/Thread * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(42) NoEscape(NoEscape) [ 220F [ 141 ]] 182 LoadN === _ 60 220 [[ 141 ]] @jdk/internal/foreign/AbstractMemorySegmentImpl+24 * [narrow], name=scope, idx=5; #narrowoop: jdk/internal/foreign/ResourceScopeImpl * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(43) GlobalEscape(GlobalEscape) [ [ ]] 12 Rethrow === 25 26 27 15 28 exception 29 [[ 0 ]] >> LocalVar(44) NoEscape(NoEscape) [ 1P [ 70 ]] 66 CastPP === 135 136 [[ 36 269 269 70 ]] #java/lang/foreign/MemorySegment:NotNull * Interface:java/lang/foreign/MemorySegment:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(45) NoEscape(NoEscape) [ 154P [ ]] 234 Proj === 154 [[ 200 254 253 ]] #5 !jvms: ConfinedScope::isAlive @ bci:6 (line 60) ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(46) NoEscape(NoEscape) [ 106P [ 152 ]] 198 Proj === 106 [[ 230 152 267 ]] #5 >> LocalVar(47) NoEscape(NoEscape) [ 54P [ ]] 117 Proj === 54 [[ 53 171 169 ]] #5 !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(48) NoEscape(NoEscape) [ 1P [ ]] 255 DecodeNKlass === _ 268 [[ 237 ]] #java/lang/foreign/MemoryAddress: 0x00000281c0ebd120 * Interface:java/lang/foreign/MemoryAddress: 0x00000281c0ebd120 * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(49) NoEscape(NoEscape) [ 1P [ ]] 248 DecodeNKlass === _ 265 [[ 229 ]] #java/lang/foreign/MemoryAddress: 0x00000281c0ebd120 * Interface:java/lang/foreign/MemoryAddress: 0x00000281c0ebd120 * >> LocalVar(50) NoEscape(NoEscape) [ 1P [ ]] 241 DecodeNKlass === _ 259 [[ 216 ]] #java/lang/foreign/MemorySegment: 0x00000281c0ebad38 * Interface:java/lang/foreign/MemorySegment: 0x00000281c0ebad38 * !jvms: ConfinedScope::isAlive @ bci:6 (line 60) ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(51) NoEscape(NoEscape) [ 143 [ ]] 73 DecodeN === _ 143 [[ 219 260 38 ]] #java/lang/Thread * Oop:java/lang/Thread * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(52) NoEscape(NoEscape) [ 1P [ ]] 246 DecodeNKlass === _ 264 [[ 263 224 ]] #jdk/internal/foreign/ResourceScopeImpl: 0x00000281c0ec1c38 * Klass:jdk/internal/foreign/ResourceScopeImpl: 0x00000281c0ec1c38 * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(53) NoEscape(NoEscape) [ 182 [ 71 ]] 141 DecodeN === _ 182 [[ 71 217 ]] #jdk/internal/foreign/ResourceScopeImpl * Oop:jdk/internal/foreign/ResourceScopeImpl * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(54) NoEscape(NoEscape) [ 66 [ ]] 70 CheckCastPP === 139 66 [[ 148 148 40 39 38 220 220 ]] #jdk/internal/foreign/NativeMemorySegmentImpl:NotNull:exact * Oop:jdk/internal/foreign/NativeMemorySegmentImpl:NotNull:exact * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(55) NoEscape(NoEscape) [ 198 [ 86 ]] 152 CheckCastPP === 196 198 [[ 151 86 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(56) NoEscape(NoEscape) [ 141 [ 189 ]] 71 CastPP === 140 141 [[ 39 189 271 271 184 184 38 ]] #jdk/internal/foreign/ResourceScopeImpl:NotNull * Oop:jdk/internal/foreign/ResourceScopeImpl:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(57) NoEscape(NoEscape) [ [ ]] 52 Phi === 46 112 113 114 [[ 29 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * >> LocalVar(58) NoEscape(NoEscape) [ [ ]] 114 Phi === 165 166 167 [[ 52 162 162 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * !orig=2293 !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(59) NoEscape(NoEscape) [ [ ]] 29 Phi === 25 51 52 [[ 12 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(60) NoEscape(NoEscape) [ 152 [ 127 ]] 86 CheckCastPP === _ 152 [[ 162 272 272 42 42 42 154 154 43 43 44 57 127 ]] #java/lang/foreign/MemoryAddress:NotNull * Interface:java/lang/foreign/MemoryAddress:NotNull * !orig=[431],2290 !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(61) NoEscape(NoEscape) [ 71 [ ]] 189 CheckCastPP === 187 71 [[ 146 146 ]] #jdk/internal/foreign/ConfinedScope:NotNull:exact * Oop:jdk/internal/foreign/ConfinedScope:NotNull:exact * >> LocalVar(62) NoEscape(NoEscape) [ 86 [ 101 172 ]] 127 CheckCastPP === 174 86 [[ 54 101 154 172 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(63) NoEscape(NoEscape) [ [ ]] 214 CheckCastPP === 129 101 [[ 175 175 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(64) NoEscape(NoEscape) [ 127 [ ]] 101 CheckCastPP === _ 127 [[ 214 44 273 273 ]] #java/lang/foreign/MemoryAddress:NotNull * Interface:java/lang/foreign/MemoryAddress:NotNull * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:-1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(65) NoEscape(NoEscape) [ 127 [ ]] 172 EncodeP === _ 127 [[ 119 236 ]] #narrowoop: jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> +++++ Calculating escapse states and scalar replaceability >> LocalVar(58) NoEscape(NoEscape) -> GlobalEscape(NoEscape) escapes as arg to: 162 CallStaticJava === 165 205 206 15 1 ( 88 114 124 87 86 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 114 ) [[ 204 108 163 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(LILL)I int ( java/lang/invoke/MethodHandle:NotNull *, java/lang/Object *, int, java/lang/Object *, java/lang/Object * ) 0x0000000800c21c00::invoke @ bci:77 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(58) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) escapes as arg to: 162 CallStaticJava === 165 205 206 15 1 ( 88 114 124 87 86 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 114 ) [[ 204 108 163 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(LILL)I int ( java/lang/invoke/MethodHandle:NotNull *, java/lang/Object *, int, java/lang/Object *, java/lang/Object * ) 0x0000000800c21c00::invoke @ bci:77 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(60) NoEscape(NoEscape) -> GlobalEscape(NoEscape) escapes as arg to: 162 CallStaticJava === 165 205 206 15 1 ( 88 114 124 87 86 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 114 ) [[ 204 108 163 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(LILL)I int ( java/lang/invoke/MethodHandle:NotNull *, java/lang/Object *, int, java/lang/Object *, java/lang/Object * ) 0x0000000800c21c00::invoke @ bci:77 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(60) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) escapes as arg to: 162 CallStaticJava === 165 205 206 15 1 ( 88 114 124 87 86 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 114 ) [[ 204 108 163 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(LILL)I int ( java/lang/invoke/MethodHandle:NotNull *, java/lang/Object *, int, java/lang/Object *, java/lang/Object * ) 0x0000000800c21c00::invoke @ bci:77 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(55) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(60) GlobalEscape(GlobalEscape) [ 152 [ 127 272b ]] 86 CheckCastPP === _ 152 [[ 162 272 272 42 42 42 154 154 43 43 44 57 127 ]] #java/lang/foreign/MemoryAddress:NotNull * Interface:java/lang/foreign/MemoryAddress:NotNull * !orig=[431],2290 !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(55) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(60) GlobalEscape(GlobalEscape) [ 152 [ 127 272b ]] 86 CheckCastPP === _ 152 [[ 162 272 272 42 42 42 154 154 43 43 44 57 127 ]] #java/lang/foreign/MemoryAddress:NotNull * Interface:java/lang/foreign/MemoryAddress:NotNull * !orig=[431],2290 !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(46) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(55) GlobalEscape(GlobalEscape) [ 198 [ 86 ]] 152 CheckCastPP === 196 198 [[ 151 86 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(46) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(55) GlobalEscape(GlobalEscape) [ 198 [ 86 ]] 152 CheckCastPP === 196 198 [[ 151 86 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(22) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(46) GlobalEscape(GlobalEscape) [ 106P [ 152 267b ]] 198 Proj === 106 [[ 230 152 267 ]] #5 >> JavaObject(22) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(46) GlobalEscape(GlobalEscape) [ 106P [ 152 267b ]] 198 Proj === 106 [[ 230 152 267 ]] #5 >> LocalVar(59) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(43) GlobalEscape(GlobalEscape) [ 29 [ ]] 12 Rethrow === 25 26 27 15 28 exception 29 [[ 0 ]] >> LocalVar(59) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(43) GlobalEscape(GlobalEscape) [ 29 [ ]] 12 Rethrow === 25 26 27 15 28 exception 29 [[ 0 ]] >> LocalVar(57) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(59) GlobalEscape(GlobalEscape) [ 1P 52 [ 12 ]] 29 Phi === 25 51 52 [[ 12 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(57) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(59) GlobalEscape(GlobalEscape) [ 1P 52 [ 12 ]] 29 Phi === 25 51 52 [[ 12 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(30) NoEscape(NoEscape) -> ArgEscape(NoEscape) propagated from: JavaObject(9) ArgEscape(ArgEscape) NSR [ 183F [ ]] 221 ThreadLocal === 0 [[ 183 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(30) ArgEscape(NoEscape) -> ArgEscape(ArgEscape) propagated from: JavaObject(9) ArgEscape(ArgEscape) NSR [ 183F [ ]] 221 ThreadLocal === 0 [[ 183 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(36) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(36) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(25) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(25) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(24) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(24) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(37) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(37) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(23) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top >> Field(23) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top >> Field(28) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top >> Field(28) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top >> Field(34) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top >> Field(34) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top >> Field(26) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top >> Field(26) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top >> Field(29) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top >> Field(29) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top >> Field(31) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top >> Field(31) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top >> >>
>> >> Testing: >> - Manually running hotspot compiler tests with `-XX:CompileCommand=TraceEscapeAnalysis,*::*` >> - Tier1-4 >> >> Thanks, >> Jorn > > Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: > > Reduce indentation > > Co-authored-by: Tobias Hartmann Marked as reviewed by thartmann (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/7428 From iveresov at openjdk.java.net Tue Mar 1 15:50:24 2022 From: iveresov at openjdk.java.net (Igor Veresov) Date: Tue, 1 Mar 2022 15:50:24 GMT Subject: RFR: 8279886: C1: Turn off SelectivePhiFunctions in presence of irreducible loops [v2] In-Reply-To: <9hUbaevqiNT2GmsBxLbGYHYFmSMeDZZDaBkUpuJFBHk=.b7da7542-844d-4d8c-8f61-ee0eca5a3500@github.com> References: <9hUbaevqiNT2GmsBxLbGYHYFmSMeDZZDaBkUpuJFBHk=.b7da7542-844d-4d8c-8f61-ee0eca5a3500@github.com> Message-ID: > This change add irreducible loops detection to `BlockListBuilder::mark_loops()` - a loop marking routine necessary for the SSA conversion. Here is brief description of the algorithm (copy-pasted from the comments I left in the code). > > The loop detection algorithm works as follows: > > - We maintain the `_loop_map`, where for each block we have a bitmap indicating which loops contain this block. > - The CFG is recursively traversed (depth-first) and if we detect a loop, we assign the loop a unique number that is stored in the bitmap associated with the loop header block. Until we return back through that loop header the bitmap contains only a single bit corresponding to the loop number. > - The bit is then propagated for all the blocks in the loop after we exit them (post-order). There could be multiple bits of course in case of nested loops. > - When we exit the loop header we remove that single bit and assign the real loop state for it. > - Now, the tricky part here is how we detect irriducible loops. In the algorithm above the loop state bits are propagated to the predecessors. If we encounter an irreducible loop (a loop with multiple heads) we would see a node with some loop bit set that would then propagate back and be never cleared because we would never go back through the original loop header. Therefore if there are any irreducible loops the bits in the states for these loops are going to propagate back to the root. > > Testing is clean: hs-tier{1-7} Igor Veresov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits: - Add comments - Detect irreducible loops during parsing/phi insertion. ------------- Changes: https://git.openjdk.java.net/jdk/pull/7636/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7636&range=01 Stats: 63 lines in 5 files changed: 27 ins; 7 del; 29 mod Patch: https://git.openjdk.java.net/jdk/pull/7636.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7636/head:pull/7636 PR: https://git.openjdk.java.net/jdk/pull/7636 From kvn at openjdk.java.net Tue Mar 1 16:10:10 2022 From: kvn at openjdk.java.net (Vladimir Kozlov) Date: Tue, 1 Mar 2022 16:10:10 GMT Subject: RFR: 8281548: Add escape analysis tracing flag [v6] In-Reply-To: References: <2dtKKhSjWC-V6rTVyrtDJBD0srUUWy5BDdAJjsoTaac=.68a0d585-4931-4114-ae72-1e9fbbfe32d8@github.com> Message-ID: On Fri, 25 Feb 2022 12:57:46 GMT, Jorn Vernee wrote: >> Hi, >> >> This PR adds `TraceEscapeAnalysis` as a compiler directive and compile command (but not as global flag). The flag is intended to be used to track down the source of an object's escape, or why it is disqualified from scalar replacement for another reason. >> >> It starts by dumping the inital EA worklist, and then has individual trace messages for when a node's escape state is updated, or when it is marked as not scalar replaceable. I've already succesfully used this to track down a failure to scalar replace an allocation myself (see sample output), so it seemed useful to upstream. >> >> There were also 2 instances where I couldn't quite figure out the reason for a state update from the surrounding code. I've left the reason string as "reason unknown" in those cases, for now. Maybe someone could point out a better reason string for those cases? >> >>
>> Sample output (click to unfold) >> >> The object I'm interested in is represented by node JavaObject(22). From the messages under `+++++ Calculating escapse states and scalar replaceability` it can be traced back like: JavaObject(22) ->LocalVar(46) -> LocalVar(55) -> LocalVar(60) -> escapes as argument to call. >> >> >> +++++ Initial worklist for static jint main.PtrPass.panama_call_as_address(jobject) (ea_inv=0) >> JavaObject(0) GlobalEscape(GlobalEscape) NSR [ [ 66 255 248 241 246 ]] 1 Con === 0 [[]] #top >> JavaObject(2) GlobalEscape(GlobalEscape) NSR [ [ ]] 88 ConP === 0 [[ 162 44 42 154 57 43 ]] #java/lang/invoke/BoundMethodHandle$Species_L:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_L:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(3) GlobalEscape(GlobalEscape) NSR [ [ ]] 65 ConP === 0 [[ 106 36 41 40 38 39 ]] #java/lang/invoke/BoundMethodHandle$Species_LLLLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLLLL:exact * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(1) NoEscape(NoEscape) [ [ ]] 62 ConP === 0 [[ 215 34 217 37 260 ]] #NULL !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(4) GlobalEscape(GlobalEscape) NSR [ [ ]] 242 ConP === 0 [[ 216 ]] #precise jdk/internal/foreign/NativeMemorySegmentImpl: 0x00000281c0ebb790:Constant:exact * Klass:precise jdk/internal/foreign/NativeMemorySegmentImpl: 0x00000281c0ebb790:Constant:exact * !jvms: ConfinedScope::isAlive @ bci:6 (line 60) ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(5) GlobalEscape(GlobalEscape) NSR [ [ ]] 89 ConP === 0 [[ 154 42 ]] #java/lang/invoke/BoundMethodHandle$Species_LLLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLLL:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(6) GlobalEscape(GlobalEscape) NSR [ [ ]] 126 ConP === 0 [[ 54 ]] #java/lang/invoke/BoundMethodHandle$Species_LLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLL:exact * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(7) GlobalEscape(GlobalEscape) NSR [ [ ]] 132 ConP === 0 [[ 57 ]] #jdk/internal/invoke/NativeEntryPoint:exact * Oop:jdk/internal/invoke/NativeEntryPoint:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(8) GlobalEscape(GlobalEscape) NSR [ [ ]] 98 ConP === 0 [[ 43 57 44 ]] #jdk/internal/foreign/abi/Binding$Context$3:exact * Oop:jdk/internal/foreign/abi/Binding$Context$3:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(9) ArgEscape(ArgEscape) NSR [ 183F [ ]] 221 ThreadLocal === 0 [[ 183 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(10) GlobalEscape(GlobalEscape) NSR [ [ ]] 270 ConP === 0 [[ 263 ]] #precise jdk/internal/foreign/ResourceScopeImpl$GlobalScopeImpl: 0x00000281c09d2ae0:Constant:exact * Klass:precise jdk/internal/foreign/ResourceScopeImpl$GlobalScopeImpl: 0x00000281c09d2ae0:Constant:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(11) GlobalEscape(GlobalEscape) NSR [ [ ]] 247 ConP === 0 [[ 224 ]] #precise jdk/internal/foreign/ConfinedScope: 0x00000281c09d2ba8:Constant:exact * Klass:precise jdk/internal/foreign/ConfinedScope: 0x00000281c09d2ba8:Constant:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(12) GlobalEscape(GlobalEscape) NSR [ [ ]] 161 ConP === 0 [[ 106 237 229 ]] #precise jdk/internal/foreign/MemoryAddressImpl: 0x00000281c0ebb858:Constant:exact * Klass:precise jdk/internal/foreign/MemoryAddressImpl: 0x00000281c0ebb858:Constant:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(13) GlobalEscape(GlobalEscape) NSR [ [ ]] 170 ConN === 0 [[ 118 235 ]] #narrowoop: jdk/internal/foreign/NativeSymbolImpl:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(14) GlobalEscape(GlobalEscape) NSR [ [ ]] 123 ConP === 0 [[ 154 54 ]] #precise [jdk/internal/foreign/Scoped: 0x00000281c0ee6438 *: :Constant:exact * Klass:precise [jdk/internal/foreign/Scoped: 0x00000281c0ee6438 *: :Constant:exact * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(15) GlobalEscape(GlobalEscape) NSR [ [ ]] 128 ConP === 0 [[ 54 154 ]] #java/lang/invoke/BoundMethodHandle$Species_LLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLL:exact * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(16) GlobalEscape(GlobalEscape) NSR [ [ ]] 87 ConP === 0 [[ 54 162 42 57 44 43 42 154 154 154 42 ]] #jdk/internal/foreign/NativeSymbolImpl:exact * Oop:jdk/internal/foreign/NativeSymbolImpl:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(17) GlobalEscape(GlobalEscape) NSR [ [ ]] 93 ConP === 0 [[ 42 ]] #java/lang/invoke/MemberName:exact * Oop:java/lang/invoke/MemberName:exact * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(18) GlobalEscape(GlobalEscape) NSR [ [ ]] 92 ConP === 0 [[ 42 ]] #java/lang/Class:exact * Oop:java/lang/Class:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(19) GlobalEscape(GlobalEscape) NSR [ [ ]] 91 ConP === 0 [[ 42 ]] #java/lang/invoke/BoundMethodHandle$Species_LL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LL:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(20) GlobalEscape(GlobalEscape) NSR [ [ ]] 90 ConP === 0 [[ 154 42 ]] #java/lang/invoke/BoundMethodHandle$Species_LLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLL:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(1) NoEscape(NoEscape) [ [ ]] 62 ConP === 0 [[ 215 34 217 37 260 ]] #NULL !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(21) NoEscape(NoEscape) [ [ 234 ]] 154 AllocateArray === 174 83 84 15 1 ( 122 123 124 125 1 1 1 1 1 86 87 1 88 1 1 1 1 1 1 89 87 86 1 1 1 1 90 1 1 1 1 1 1 1 1 1 87 127 1 1 128 1 1 1 1 1 1 1 1 1 1 1 ) [[ 258 257 209 252 95 234 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, int ) Array::newInstance @ bci:2 (line 78) 0x0000000800c05c00::invokeStatic @ bci:11 0x0000000800c06800::invoke @ bci:21 0x0000000800c15800::collector @ bci:13 0x0000000800c1c000::invoke @ bci:44 0x0000000800c1c400::invoke @ bci:16 0x0000000800c21c00::invoke @ bci:46 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) >> JavaObject(22) NoEscape(NoEscape) [ [ 198 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(23) NoEscape(NoEscape) +8 ( )[ [ ]] 269 AddP === _ 66 66 274 [[ 259 ]] Interface:java/lang/foreign/MemorySegment:NotNull+8 * [narrowklass] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(24) NoEscape(NoEscape) +8 ( )[ [ ]] 273 AddP === _ 101 101 274 [[ 268 ]] Interface:java/lang/foreign/MemoryAddress:NotNull+8 * [narrowklass] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(25) NoEscape(NoEscape) +8 ( )[ [ ]] 272 AddP === _ 86 86 274 [[ 265 ]] Interface:java/lang/foreign/MemoryAddress:NotNull+8 * [narrowklass] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(26) NoEscape(NoEscape) +8 ( )[ [ ]] 271 AddP === _ 71 71 274 [[ 264 ]] Oop:jdk/internal/foreign/ResourceScopeImpl:NotNull+8 * [narrowklass] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(27) NoEscape(NoEscape) [ [ 117 ]] 54 AllocateArray === 120 121 55 15 1 ( 122 123 124 125 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 33 1 1 1 126 1 1 1 1 1 1 1 1 1 87 127 1 1 128 1 1 1 1 1 1 1 1 1 1 1 ) [[ 203 164 107 168 31 117 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, int ) Array::newInstance @ bci:2 (line 78) 0x0000000800c05c00::invokeStatic @ bci:11 0x0000000800c06800::invoke @ bci:21 0x0000000800c15800::collector @ bci:13 0x0000000800c1c000::invoke @ bci:44 0x0000000800c1c800::invoke @ bci:17 0x0000000800c21c00::invoke @ bci:61 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(28) NoEscape(NoEscape) oop +24 ( )[ [ 182 ]] 220 AddP === _ 70 70 122 [[ 182 ]] Oop:jdk/internal/foreign/NativeMemorySegmentImpl:NotNull:exact+24 * [narrow] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(29) NoEscape(NoEscape) oop +24 ( )[ [ 143 ]] 184 AddP === _ 71 71 122 [[ 143 ]] Oop:jdk/internal/foreign/ResourceScopeImpl:NotNull+24 * [narrow] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(30) NoEscape(NoEscape) oop ( 221P )[ [ 142 ]] 183 AddP === _ 1 221 222 [[ 142 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(31) NoEscape(NoEscape) +12 ( )[ [ ]] 146 AddP === _ 189 189 190 [[ 77 ]] Oop:jdk/internal/foreign/ConfinedScope:NotNull:exact+12 * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(32) NoEscape(NoEscape) oop +20 ( )[ [ ]] 171 AddP === _ 1 117 212 [[ 119 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(33) NoEscape(NoEscape) oop +20 ( )[ [ ]] 254 AddP === _ 1 234 212 [[ 236 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(34) NoEscape(NoEscape) +32 ( )[ [ ]] 148 AddP === _ 70 70 193 [[ 80 ]] Oop:jdk/internal/foreign/NativeMemorySegmentImpl:NotNull:exact+32 * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(35) NoEscape(NoEscape) oop +16 ( )[ [ ]] 169 AddP === _ 1 117 211 [[ 118 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(36) NoEscape(NoEscape) +16 ( )[ [ ]] 267 AddP === _ 1 198 211 [[ 251 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(37) NoEscape(NoEscape) +16 ( )[ [ ]] 175 AddP === _ 214 214 211 [[ 131 ]] Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact+16 * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(38) NoEscape(NoEscape) oop +16 ( )[ [ ]] 253 AddP === _ 1 234 211 [[ 235 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(39) NoEscape(NoEscape) [ [ ]] 72 LoadP === _ 60 142 [[ 38 219 ]] @rawptr:NotNull, idx=Raw; #java/lang/Thread:NotNull * Oop:java/lang/Thread:NotNull * >> LocalVar(40) NoEscape(NoEscape) [ 183F [ ]] 142 LoadP === _ 60 183 [[ 72 ]] @rawptr:BotPTR, idx=Raw; #rawptr:NotNull (does not depend only on test) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(41) NoEscape(NoEscape) [ 184F [ 73 ]] 143 LoadN === _ 60 184 [[ 73 ]] @jdk/internal/foreign/ResourceScopeImpl+24 * [narrow], name=owner, idx=6; #narrowoop: java/lang/Thread * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(42) NoEscape(NoEscape) [ 220F [ 141 ]] 182 LoadN === _ 60 220 [[ 141 ]] @jdk/internal/foreign/AbstractMemorySegmentImpl+24 * [narrow], name=scope, idx=5; #narrowoop: jdk/internal/foreign/ResourceScopeImpl * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(43) GlobalEscape(GlobalEscape) [ [ ]] 12 Rethrow === 25 26 27 15 28 exception 29 [[ 0 ]] >> LocalVar(44) NoEscape(NoEscape) [ 1P [ 70 ]] 66 CastPP === 135 136 [[ 36 269 269 70 ]] #java/lang/foreign/MemorySegment:NotNull * Interface:java/lang/foreign/MemorySegment:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(45) NoEscape(NoEscape) [ 154P [ ]] 234 Proj === 154 [[ 200 254 253 ]] #5 !jvms: ConfinedScope::isAlive @ bci:6 (line 60) ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(46) NoEscape(NoEscape) [ 106P [ 152 ]] 198 Proj === 106 [[ 230 152 267 ]] #5 >> LocalVar(47) NoEscape(NoEscape) [ 54P [ ]] 117 Proj === 54 [[ 53 171 169 ]] #5 !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(48) NoEscape(NoEscape) [ 1P [ ]] 255 DecodeNKlass === _ 268 [[ 237 ]] #java/lang/foreign/MemoryAddress: 0x00000281c0ebd120 * Interface:java/lang/foreign/MemoryAddress: 0x00000281c0ebd120 * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(49) NoEscape(NoEscape) [ 1P [ ]] 248 DecodeNKlass === _ 265 [[ 229 ]] #java/lang/foreign/MemoryAddress: 0x00000281c0ebd120 * Interface:java/lang/foreign/MemoryAddress: 0x00000281c0ebd120 * >> LocalVar(50) NoEscape(NoEscape) [ 1P [ ]] 241 DecodeNKlass === _ 259 [[ 216 ]] #java/lang/foreign/MemorySegment: 0x00000281c0ebad38 * Interface:java/lang/foreign/MemorySegment: 0x00000281c0ebad38 * !jvms: ConfinedScope::isAlive @ bci:6 (line 60) ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(51) NoEscape(NoEscape) [ 143 [ ]] 73 DecodeN === _ 143 [[ 219 260 38 ]] #java/lang/Thread * Oop:java/lang/Thread * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(52) NoEscape(NoEscape) [ 1P [ ]] 246 DecodeNKlass === _ 264 [[ 263 224 ]] #jdk/internal/foreign/ResourceScopeImpl: 0x00000281c0ec1c38 * Klass:jdk/internal/foreign/ResourceScopeImpl: 0x00000281c0ec1c38 * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(53) NoEscape(NoEscape) [ 182 [ 71 ]] 141 DecodeN === _ 182 [[ 71 217 ]] #jdk/internal/foreign/ResourceScopeImpl * Oop:jdk/internal/foreign/ResourceScopeImpl * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(54) NoEscape(NoEscape) [ 66 [ ]] 70 CheckCastPP === 139 66 [[ 148 148 40 39 38 220 220 ]] #jdk/internal/foreign/NativeMemorySegmentImpl:NotNull:exact * Oop:jdk/internal/foreign/NativeMemorySegmentImpl:NotNull:exact * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(55) NoEscape(NoEscape) [ 198 [ 86 ]] 152 CheckCastPP === 196 198 [[ 151 86 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(56) NoEscape(NoEscape) [ 141 [ 189 ]] 71 CastPP === 140 141 [[ 39 189 271 271 184 184 38 ]] #jdk/internal/foreign/ResourceScopeImpl:NotNull * Oop:jdk/internal/foreign/ResourceScopeImpl:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(57) NoEscape(NoEscape) [ [ ]] 52 Phi === 46 112 113 114 [[ 29 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * >> LocalVar(58) NoEscape(NoEscape) [ [ ]] 114 Phi === 165 166 167 [[ 52 162 162 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * !orig=2293 !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(59) NoEscape(NoEscape) [ [ ]] 29 Phi === 25 51 52 [[ 12 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(60) NoEscape(NoEscape) [ 152 [ 127 ]] 86 CheckCastPP === _ 152 [[ 162 272 272 42 42 42 154 154 43 43 44 57 127 ]] #java/lang/foreign/MemoryAddress:NotNull * Interface:java/lang/foreign/MemoryAddress:NotNull * !orig=[431],2290 !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(61) NoEscape(NoEscape) [ 71 [ ]] 189 CheckCastPP === 187 71 [[ 146 146 ]] #jdk/internal/foreign/ConfinedScope:NotNull:exact * Oop:jdk/internal/foreign/ConfinedScope:NotNull:exact * >> LocalVar(62) NoEscape(NoEscape) [ 86 [ 101 172 ]] 127 CheckCastPP === 174 86 [[ 54 101 154 172 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(63) NoEscape(NoEscape) [ [ ]] 214 CheckCastPP === 129 101 [[ 175 175 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(64) NoEscape(NoEscape) [ 127 [ ]] 101 CheckCastPP === _ 127 [[ 214 44 273 273 ]] #java/lang/foreign/MemoryAddress:NotNull * Interface:java/lang/foreign/MemoryAddress:NotNull * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:-1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(65) NoEscape(NoEscape) [ 127 [ ]] 172 EncodeP === _ 127 [[ 119 236 ]] #narrowoop: jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> +++++ Calculating escapse states and scalar replaceability >> LocalVar(58) NoEscape(NoEscape) -> GlobalEscape(NoEscape) escapes as arg to: 162 CallStaticJava === 165 205 206 15 1 ( 88 114 124 87 86 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 114 ) [[ 204 108 163 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(LILL)I int ( java/lang/invoke/MethodHandle:NotNull *, java/lang/Object *, int, java/lang/Object *, java/lang/Object * ) 0x0000000800c21c00::invoke @ bci:77 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(58) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) escapes as arg to: 162 CallStaticJava === 165 205 206 15 1 ( 88 114 124 87 86 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 114 ) [[ 204 108 163 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(LILL)I int ( java/lang/invoke/MethodHandle:NotNull *, java/lang/Object *, int, java/lang/Object *, java/lang/Object * ) 0x0000000800c21c00::invoke @ bci:77 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(60) NoEscape(NoEscape) -> GlobalEscape(NoEscape) escapes as arg to: 162 CallStaticJava === 165 205 206 15 1 ( 88 114 124 87 86 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 114 ) [[ 204 108 163 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(LILL)I int ( java/lang/invoke/MethodHandle:NotNull *, java/lang/Object *, int, java/lang/Object *, java/lang/Object * ) 0x0000000800c21c00::invoke @ bci:77 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(60) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) escapes as arg to: 162 CallStaticJava === 165 205 206 15 1 ( 88 114 124 87 86 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 114 ) [[ 204 108 163 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(LILL)I int ( java/lang/invoke/MethodHandle:NotNull *, java/lang/Object *, int, java/lang/Object *, java/lang/Object * ) 0x0000000800c21c00::invoke @ bci:77 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(55) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(60) GlobalEscape(GlobalEscape) [ 152 [ 127 272b ]] 86 CheckCastPP === _ 152 [[ 162 272 272 42 42 42 154 154 43 43 44 57 127 ]] #java/lang/foreign/MemoryAddress:NotNull * Interface:java/lang/foreign/MemoryAddress:NotNull * !orig=[431],2290 !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(55) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(60) GlobalEscape(GlobalEscape) [ 152 [ 127 272b ]] 86 CheckCastPP === _ 152 [[ 162 272 272 42 42 42 154 154 43 43 44 57 127 ]] #java/lang/foreign/MemoryAddress:NotNull * Interface:java/lang/foreign/MemoryAddress:NotNull * !orig=[431],2290 !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(46) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(55) GlobalEscape(GlobalEscape) [ 198 [ 86 ]] 152 CheckCastPP === 196 198 [[ 151 86 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(46) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(55) GlobalEscape(GlobalEscape) [ 198 [ 86 ]] 152 CheckCastPP === 196 198 [[ 151 86 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> JavaObject(22) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(46) GlobalEscape(GlobalEscape) [ 106P [ 152 267b ]] 198 Proj === 106 [[ 230 152 267 ]] #5 >> JavaObject(22) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(46) GlobalEscape(GlobalEscape) [ 106P [ 152 267b ]] 198 Proj === 106 [[ 230 152 267 ]] #5 >> LocalVar(59) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(43) GlobalEscape(GlobalEscape) [ 29 [ ]] 12 Rethrow === 25 26 27 15 28 exception 29 [[ 0 ]] >> LocalVar(59) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(43) GlobalEscape(GlobalEscape) [ 29 [ ]] 12 Rethrow === 25 26 27 15 28 exception 29 [[ 0 ]] >> LocalVar(57) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(59) GlobalEscape(GlobalEscape) [ 1P 52 [ 12 ]] 29 Phi === 25 51 52 [[ 12 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> LocalVar(57) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(59) GlobalEscape(GlobalEscape) [ 1P 52 [ 12 ]] 29 Phi === 25 51 52 [[ 12 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(30) NoEscape(NoEscape) -> ArgEscape(NoEscape) propagated from: JavaObject(9) ArgEscape(ArgEscape) NSR [ 183F [ ]] 221 ThreadLocal === 0 [[ 183 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(30) ArgEscape(NoEscape) -> ArgEscape(ArgEscape) propagated from: JavaObject(9) ArgEscape(ArgEscape) NSR [ 183F [ ]] 221 ThreadLocal === 0 [[ 183 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(36) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(36) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(25) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(25) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(24) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(24) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(37) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(37) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) >> Field(23) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top >> Field(23) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top >> Field(28) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top >> Field(28) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top >> Field(34) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top >> Field(34) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top >> Field(26) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top >> Field(26) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top >> Field(29) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top >> Field(29) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top >> Field(31) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top >> Field(31) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top >> >>
>> >> Testing: >> - Manually running hotspot compiler tests with `-XX:CompileCommand=TraceEscapeAnalysis,*::*` >> - Tier1-4 >> >> Thanks, >> Jorn > > Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: > > Reduce indentation > > Co-authored-by: Tobias Hartmann Good ------------- Marked as reviewed by kvn (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7428 From jvernee at openjdk.java.net Tue Mar 1 16:31:05 2022 From: jvernee at openjdk.java.net (Jorn Vernee) Date: Tue, 1 Mar 2022 16:31:05 GMT Subject: Integrated: 8281548: Add escape analysis tracing flag In-Reply-To: <2dtKKhSjWC-V6rTVyrtDJBD0srUUWy5BDdAJjsoTaac=.68a0d585-4931-4114-ae72-1e9fbbfe32d8@github.com> References: <2dtKKhSjWC-V6rTVyrtDJBD0srUUWy5BDdAJjsoTaac=.68a0d585-4931-4114-ae72-1e9fbbfe32d8@github.com> Message-ID: On Thu, 10 Feb 2022 16:41:09 GMT, Jorn Vernee wrote: > Hi, > > This PR adds `TraceEscapeAnalysis` as a compiler directive and compile command (but not as global flag). The flag is intended to be used to track down the source of an object's escape, or why it is disqualified from scalar replacement for another reason. > > It starts by dumping the inital EA worklist, and then has individual trace messages for when a node's escape state is updated, or when it is marked as not scalar replaceable. I've already succesfully used this to track down a failure to scalar replace an allocation myself (see sample output), so it seemed useful to upstream. > > There were also 2 instances where I couldn't quite figure out the reason for a state update from the surrounding code. I've left the reason string as "reason unknown" in those cases, for now. Maybe someone could point out a better reason string for those cases? > >
> Sample output (click to unfold) > > The object I'm interested in is represented by node JavaObject(22). From the messages under `+++++ Calculating escapse states and scalar replaceability` it can be traced back like: JavaObject(22) ->LocalVar(46) -> LocalVar(55) -> LocalVar(60) -> escapes as argument to call. > > > +++++ Initial worklist for static jint main.PtrPass.panama_call_as_address(jobject) (ea_inv=0) > JavaObject(0) GlobalEscape(GlobalEscape) NSR [ [ 66 255 248 241 246 ]] 1 Con === 0 [[]] #top > JavaObject(2) GlobalEscape(GlobalEscape) NSR [ [ ]] 88 ConP === 0 [[ 162 44 42 154 57 43 ]] #java/lang/invoke/BoundMethodHandle$Species_L:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_L:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(3) GlobalEscape(GlobalEscape) NSR [ [ ]] 65 ConP === 0 [[ 106 36 41 40 38 39 ]] #java/lang/invoke/BoundMethodHandle$Species_LLLLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLLLL:exact * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(1) NoEscape(NoEscape) [ [ ]] 62 ConP === 0 [[ 215 34 217 37 260 ]] #NULL !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(4) GlobalEscape(GlobalEscape) NSR [ [ ]] 242 ConP === 0 [[ 216 ]] #precise jdk/internal/foreign/NativeMemorySegmentImpl: 0x00000281c0ebb790:Constant:exact * Klass:precise jdk/internal/foreign/NativeMemorySegmentImpl: 0x00000281c0ebb790:Constant:exact * !jvms: ConfinedScope::isAlive @ bci:6 (line 60) ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(5) GlobalEscape(GlobalEscape) NSR [ [ ]] 89 ConP === 0 [[ 154 42 ]] #java/lang/invoke/BoundMethodHandle$Species_LLLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLLL:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(6) GlobalEscape(GlobalEscape) NSR [ [ ]] 126 ConP === 0 [[ 54 ]] #java/lang/invoke/BoundMethodHandle$Species_LLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLL:exact * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(7) GlobalEscape(GlobalEscape) NSR [ [ ]] 132 ConP === 0 [[ 57 ]] #jdk/internal/invoke/NativeEntryPoint:exact * Oop:jdk/internal/invoke/NativeEntryPoint:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(8) GlobalEscape(GlobalEscape) NSR [ [ ]] 98 ConP === 0 [[ 43 57 44 ]] #jdk/internal/foreign/abi/Binding$Context$3:exact * Oop:jdk/internal/foreign/abi/Binding$Context$3:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(9) ArgEscape(ArgEscape) NSR [ 183F [ ]] 221 ThreadLocal === 0 [[ 183 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(10) GlobalEscape(GlobalEscape) NSR [ [ ]] 270 ConP === 0 [[ 263 ]] #precise jdk/internal/foreign/ResourceScopeImpl$GlobalScopeImpl: 0x00000281c09d2ae0:Constant:exact * Klass:precise jdk/internal/foreign/ResourceScopeImpl$GlobalScopeImpl: 0x00000281c09d2ae0:Constant:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(11) GlobalEscape(GlobalEscape) NSR [ [ ]] 247 ConP === 0 [[ 224 ]] #precise jdk/internal/foreign/ConfinedScope: 0x00000281c09d2ba8:Constant:exact * Klass:precise jdk/internal/foreign/ConfinedScope: 0x00000281c09d2ba8:Constant:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(12) GlobalEscape(GlobalEscape) NSR [ [ ]] 161 ConP === 0 [[ 106 237 229 ]] #precise jdk/internal/foreign/MemoryAddressImpl: 0x00000281c0ebb858:Constant:exact * Klass:precise jdk/internal/foreign/MemoryAddressImpl: 0x00000281c0ebb858:Constant:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(13) GlobalEscape(GlobalEscape) NSR [ [ ]] 170 ConN === 0 [[ 118 235 ]] #narrowoop: jdk/internal/foreign/NativeSymbolImpl:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(14) GlobalEscape(GlobalEscape) NSR [ [ ]] 123 ConP === 0 [[ 154 54 ]] #precise [jdk/internal/foreign/Scoped: 0x00000281c0ee6438 *: :Constant:exact * Klass:precise [jdk/internal/foreign/Scoped: 0x00000281c0ee6438 *: :Constant:exact * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(15) GlobalEscape(GlobalEscape) NSR [ [ ]] 128 ConP === 0 [[ 54 154 ]] #java/lang/invoke/BoundMethodHandle$Species_LLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLL:exact * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(16) GlobalEscape(GlobalEscape) NSR [ [ ]] 87 ConP === 0 [[ 54 162 42 57 44 43 42 154 154 154 42 ]] #jdk/internal/foreign/NativeSymbolImpl:exact * Oop:jdk/internal/foreign/NativeSymbolImpl:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(17) GlobalEscape(GlobalEscape) NSR [ [ ]] 93 ConP === 0 [[ 42 ]] #java/lang/invoke/MemberName:exact * Oop:java/lang/invoke/MemberName:exact * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(18) GlobalEscape(GlobalEscape) NSR [ [ ]] 92 ConP === 0 [[ 42 ]] #java/lang/Class:exact * Oop:java/lang/Class:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(19) GlobalEscape(GlobalEscape) NSR [ [ ]] 91 ConP === 0 [[ 42 ]] #java/lang/invoke/BoundMethodHandle$Species_LL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LL:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(20) GlobalEscape(GlobalEscape) NSR [ [ ]] 90 ConP === 0 [[ 154 42 ]] #java/lang/invoke/BoundMethodHandle$Species_LLL:exact * Oop:java/lang/invoke/BoundMethodHandle$Species_LLL:exact * !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(1) NoEscape(NoEscape) [ [ ]] 62 ConP === 0 [[ 215 34 217 37 260 ]] #NULL !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(21) NoEscape(NoEscape) [ [ 234 ]] 154 AllocateArray === 174 83 84 15 1 ( 122 123 124 125 1 1 1 1 1 86 87 1 88 1 1 1 1 1 1 89 87 86 1 1 1 1 90 1 1 1 1 1 1 1 1 1 87 127 1 1 128 1 1 1 1 1 1 1 1 1 1 1 ) [[ 258 257 209 252 95 234 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, int ) Array::newInstance @ bci:2 (line 78) 0x0000000800c05c00::invokeStatic @ bci:11 0x0000000800c06800::invoke @ bci:21 0x0000000800c15800::collector @ bci:13 0x0000000800c1c000::invoke @ bci:44 0x0000000800c1c400::invoke @ bci:16 0x0000000800c21c00::invoke @ bci:46 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) > JavaObject(22) NoEscape(NoEscape) [ [ 198 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(23) NoEscape(NoEscape) +8 ( )[ [ ]] 269 AddP === _ 66 66 274 [[ 259 ]] Interface:java/lang/foreign/MemorySegment:NotNull+8 * [narrowklass] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(24) NoEscape(NoEscape) +8 ( )[ [ ]] 273 AddP === _ 101 101 274 [[ 268 ]] Interface:java/lang/foreign/MemoryAddress:NotNull+8 * [narrowklass] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(25) NoEscape(NoEscape) +8 ( )[ [ ]] 272 AddP === _ 86 86 274 [[ 265 ]] Interface:java/lang/foreign/MemoryAddress:NotNull+8 * [narrowklass] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(26) NoEscape(NoEscape) +8 ( )[ [ ]] 271 AddP === _ 71 71 274 [[ 264 ]] Oop:jdk/internal/foreign/ResourceScopeImpl:NotNull+8 * [narrowklass] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:31 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(27) NoEscape(NoEscape) [ [ 117 ]] 54 AllocateArray === 120 121 55 15 1 ( 122 123 124 125 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 33 1 1 1 126 1 1 1 1 1 1 1 1 1 87 127 1 1 128 1 1 1 1 1 1 1 1 1 1 1 ) [[ 203 164 107 168 31 117 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, int ) Array::newInstance @ bci:2 (line 78) 0x0000000800c05c00::invokeStatic @ bci:11 0x0000000800c06800::invoke @ bci:21 0x0000000800c15800::collector @ bci:13 0x0000000800c1c000::invoke @ bci:44 0x0000000800c1c800::invoke @ bci:17 0x0000000800c21c00::invoke @ bci:61 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(28) NoEscape(NoEscape) oop +24 ( )[ [ 182 ]] 220 AddP === _ 70 70 122 [[ 182 ]] Oop:jdk/internal/foreign/NativeMemorySegmentImpl:NotNull:exact+24 * [narrow] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(29) NoEscape(NoEscape) oop +24 ( )[ [ 143 ]] 184 AddP === _ 71 71 122 [[ 143 ]] Oop:jdk/internal/foreign/ResourceScopeImpl:NotNull+24 * [narrow] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(30) NoEscape(NoEscape) oop ( 221P )[ [ 142 ]] 183 AddP === _ 1 221 222 [[ 142 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(31) NoEscape(NoEscape) +12 ( )[ [ ]] 146 AddP === _ 189 189 190 [[ 77 ]] Oop:jdk/internal/foreign/ConfinedScope:NotNull:exact+12 * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(32) NoEscape(NoEscape) oop +20 ( )[ [ ]] 171 AddP === _ 1 117 212 [[ 119 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(33) NoEscape(NoEscape) oop +20 ( )[ [ ]] 254 AddP === _ 1 234 212 [[ 236 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(34) NoEscape(NoEscape) +32 ( )[ [ ]] 148 AddP === _ 70 70 193 [[ 80 ]] Oop:jdk/internal/foreign/NativeMemorySegmentImpl:NotNull:exact+32 * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(35) NoEscape(NoEscape) oop +16 ( )[ [ ]] 169 AddP === _ 1 117 211 [[ 118 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(36) NoEscape(NoEscape) +16 ( )[ [ ]] 267 AddP === _ 1 198 211 [[ 251 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(37) NoEscape(NoEscape) +16 ( )[ [ ]] 175 AddP === _ 214 214 211 [[ 131 ]] Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact+16 * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(38) NoEscape(NoEscape) oop +16 ( )[ [ ]] 253 AddP === _ 1 234 211 [[ 235 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(39) NoEscape(NoEscape) [ [ ]] 72 LoadP === _ 60 142 [[ 38 219 ]] @rawptr:NotNull, idx=Raw; #java/lang/Thread:NotNull * Oop:java/lang/Thread:NotNull * > LocalVar(40) NoEscape(NoEscape) [ 183F [ ]] 142 LoadP === _ 60 183 [[ 72 ]] @rawptr:BotPTR, idx=Raw; #rawptr:NotNull (does not depend only on test) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(41) NoEscape(NoEscape) [ 184F [ 73 ]] 143 LoadN === _ 60 184 [[ 73 ]] @jdk/internal/foreign/ResourceScopeImpl+24 * [narrow], name=owner, idx=6; #narrowoop: java/lang/Thread * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(42) NoEscape(NoEscape) [ 220F [ 141 ]] 182 LoadN === _ 60 220 [[ 141 ]] @jdk/internal/foreign/AbstractMemorySegmentImpl+24 * [narrow], name=scope, idx=5; #narrowoop: jdk/internal/foreign/ResourceScopeImpl * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(43) GlobalEscape(GlobalEscape) [ [ ]] 12 Rethrow === 25 26 27 15 28 exception 29 [[ 0 ]] > LocalVar(44) NoEscape(NoEscape) [ 1P [ 70 ]] 66 CastPP === 135 136 [[ 36 269 269 70 ]] #java/lang/foreign/MemorySegment:NotNull * Interface:java/lang/foreign/MemorySegment:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(45) NoEscape(NoEscape) [ 154P [ ]] 234 Proj === 154 [[ 200 254 253 ]] #5 !jvms: ConfinedScope::isAlive @ bci:6 (line 60) ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(46) NoEscape(NoEscape) [ 106P [ 152 ]] 198 Proj === 106 [[ 230 152 267 ]] #5 > LocalVar(47) NoEscape(NoEscape) [ 54P [ ]] 117 Proj === 54 [[ 53 171 169 ]] #5 !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(48) NoEscape(NoEscape) [ 1P [ ]] 255 DecodeNKlass === _ 268 [[ 237 ]] #java/lang/foreign/MemoryAddress: 0x00000281c0ebd120 * Interface:java/lang/foreign/MemoryAddress: 0x00000281c0ebd120 * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(49) NoEscape(NoEscape) [ 1P [ ]] 248 DecodeNKlass === _ 265 [[ 229 ]] #java/lang/foreign/MemoryAddress: 0x00000281c0ebd120 * Interface:java/lang/foreign/MemoryAddress: 0x00000281c0ebd120 * > LocalVar(50) NoEscape(NoEscape) [ 1P [ ]] 241 DecodeNKlass === _ 259 [[ 216 ]] #java/lang/foreign/MemorySegment: 0x00000281c0ebad38 * Interface:java/lang/foreign/MemorySegment: 0x00000281c0ebad38 * !jvms: ConfinedScope::isAlive @ bci:6 (line 60) ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(51) NoEscape(NoEscape) [ 143 [ ]] 73 DecodeN === _ 143 [[ 219 260 38 ]] #java/lang/Thread * Oop:java/lang/Thread * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(52) NoEscape(NoEscape) [ 1P [ ]] 246 DecodeNKlass === _ 264 [[ 263 224 ]] #jdk/internal/foreign/ResourceScopeImpl: 0x00000281c0ec1c38 * Klass:jdk/internal/foreign/ResourceScopeImpl: 0x00000281c0ec1c38 * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:-1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(53) NoEscape(NoEscape) [ 182 [ 71 ]] 141 DecodeN === _ 182 [[ 71 217 ]] #jdk/internal/foreign/ResourceScopeImpl * Oop:jdk/internal/foreign/ResourceScopeImpl * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:1 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(54) NoEscape(NoEscape) [ 66 [ ]] 70 CheckCastPP === 139 66 [[ 148 148 40 39 38 220 220 ]] #jdk/internal/foreign/NativeMemorySegmentImpl:NotNull:exact * Oop:jdk/internal/foreign/NativeMemorySegmentImpl:NotNull:exact * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(55) NoEscape(NoEscape) [ 198 [ 86 ]] 152 CheckCastPP === 196 198 [[ 151 86 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(56) NoEscape(NoEscape) [ 141 [ 189 ]] 71 CastPP === 140 141 [[ 39 189 271 271 184 184 38 ]] #jdk/internal/foreign/ResourceScopeImpl:NotNull * Oop:jdk/internal/foreign/ResourceScopeImpl:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(57) NoEscape(NoEscape) [ [ ]] 52 Phi === 46 112 113 114 [[ 29 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * > LocalVar(58) NoEscape(NoEscape) [ [ ]] 114 Phi === 165 166 167 [[ 52 162 162 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * !orig=2293 !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(59) NoEscape(NoEscape) [ [ ]] 29 Phi === 25 51 52 [[ 12 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(60) NoEscape(NoEscape) [ 152 [ 127 ]] 86 CheckCastPP === _ 152 [[ 162 272 272 42 42 42 154 154 43 43 44 57 127 ]] #java/lang/foreign/MemoryAddress:NotNull * Interface:java/lang/foreign/MemoryAddress:NotNull * !orig=[431],2290 !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(61) NoEscape(NoEscape) [ 71 [ ]] 189 CheckCastPP === 187 71 [[ 146 146 ]] #jdk/internal/foreign/ConfinedScope:NotNull:exact * Oop:jdk/internal/foreign/ConfinedScope:NotNull:exact * > LocalVar(62) NoEscape(NoEscape) [ 86 [ 101 172 ]] 127 CheckCastPP === 174 86 [[ 54 101 154 172 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(63) NoEscape(NoEscape) [ [ ]] 214 CheckCastPP === 129 101 [[ 175 175 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(64) NoEscape(NoEscape) [ 127 [ ]] 101 CheckCastPP === _ 127 [[ 214 44 273 273 ]] #java/lang/foreign/MemoryAddress:NotNull * Interface:java/lang/foreign/MemoryAddress:NotNull * !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:-1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(65) NoEscape(NoEscape) [ 127 [ ]] 172 EncodeP === _ 127 [[ 119 236 ]] #narrowoop: jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > +++++ Calculating escapse states and scalar replaceability > LocalVar(58) NoEscape(NoEscape) -> GlobalEscape(NoEscape) escapes as arg to: 162 CallStaticJava === 165 205 206 15 1 ( 88 114 124 87 86 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 114 ) [[ 204 108 163 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(LILL)I int ( java/lang/invoke/MethodHandle:NotNull *, java/lang/Object *, int, java/lang/Object *, java/lang/Object * ) 0x0000000800c21c00::invoke @ bci:77 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(58) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) escapes as arg to: 162 CallStaticJava === 165 205 206 15 1 ( 88 114 124 87 86 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 114 ) [[ 204 108 163 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(LILL)I int ( java/lang/invoke/MethodHandle:NotNull *, java/lang/Object *, int, java/lang/Object *, java/lang/Object * ) 0x0000000800c21c00::invoke @ bci:77 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(60) NoEscape(NoEscape) -> GlobalEscape(NoEscape) escapes as arg to: 162 CallStaticJava === 165 205 206 15 1 ( 88 114 124 87 86 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 114 ) [[ 204 108 163 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(LILL)I int ( java/lang/invoke/MethodHandle:NotNull *, java/lang/Object *, int, java/lang/Object *, java/lang/Object * ) 0x0000000800c21c00::invoke @ bci:77 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(60) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) escapes as arg to: 162 CallStaticJava === 165 205 206 15 1 ( 88 114 124 87 86 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 114 ) [[ 204 108 163 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(LILL)I int ( java/lang/invoke/MethodHandle:NotNull *, java/lang/Object *, int, java/lang/Object *, java/lang/Object * ) 0x0000000800c21c00::invoke @ bci:77 0x0000000800c20c00::invokeExact_MT @ bci:19 PtrPass::panama_call_as_address @ bci:9 (line 47) !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:14 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(55) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(60) GlobalEscape(GlobalEscape) [ 152 [ 127 272b ]] 86 CheckCastPP === _ 152 [[ 162 272 272 42 42 42 154 154 43 43 44 57 127 ]] #java/lang/foreign/MemoryAddress:NotNull * Interface:java/lang/foreign/MemoryAddress:NotNull * !orig=[431],2290 !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(55) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(60) GlobalEscape(GlobalEscape) [ 152 [ 127 272b ]] 86 CheckCastPP === _ 152 [[ 162 272 272 42 42 42 154 154 43 43 44 57 127 ]] #java/lang/foreign/MemoryAddress:NotNull * Interface:java/lang/foreign/MemoryAddress:NotNull * !orig=[431],2290 !jvms: NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(46) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(55) GlobalEscape(GlobalEscape) [ 198 [ 86 ]] 152 CheckCastPP === 196 198 [[ 151 86 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(46) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(55) GlobalEscape(GlobalEscape) [ 198 [ 86 ]] 152 CheckCastPP === 196 198 [[ 151 86 ]] #jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * Oop:jdk/internal/foreign/MemoryAddressImpl:NotNull:exact * !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:4 (line 203) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > JavaObject(22) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(46) GlobalEscape(GlobalEscape) [ 106P [ 152 267b ]] 198 Proj === 106 [[ 230 152 267 ]] #5 > JavaObject(22) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(46) GlobalEscape(GlobalEscape) [ 106P [ 152 267b ]] 198 Proj === 106 [[ 230 152 267 ]] #5 > LocalVar(59) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(43) GlobalEscape(GlobalEscape) [ 29 [ ]] 12 Rethrow === 25 26 27 15 28 exception 29 [[ 0 ]] > LocalVar(59) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(43) GlobalEscape(GlobalEscape) [ 29 [ ]] 12 Rethrow === 25 26 27 15 28 exception 29 [[ 0 ]] > LocalVar(57) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: LocalVar(59) GlobalEscape(GlobalEscape) [ 1P 52 [ 12 ]] 29 Phi === 25 51 52 [[ 12 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) > LocalVar(57) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: LocalVar(59) GlobalEscape(GlobalEscape) [ 1P 52 [ 12 ]] 29 Phi === 25 51 52 [[ 12 ]] #java/lang/Throwable:NotNull * Oop:java/lang/Throwable:NotNull * !jvms: PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(30) NoEscape(NoEscape) -> ArgEscape(NoEscape) propagated from: JavaObject(9) ArgEscape(ArgEscape) NSR [ 183F [ ]] 221 ThreadLocal === 0 [[ 183 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(30) ArgEscape(NoEscape) -> ArgEscape(ArgEscape) propagated from: JavaObject(9) ArgEscape(ArgEscape) NSR [ 183F [ ]] 221 ThreadLocal === 0 [[ 183 ]] !jvms: ResourceScopeImpl::checkValidStateSlow @ bci:28 (line 205) AbstractMemorySegmentImpl::checkValidState @ bci:4 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(36) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(36) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(25) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(25) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(24) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(24) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(37) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(37) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(22) GlobalEscape(GlobalEscape) [ 267F 272F 273F 175F [ 198 152 86 127 101 172 214 254 171 ]] 106 Allocate === 160 59 60 15 1 ( 122 161 124 1 1 65 1 80 1 ) [[ 157 110 47 266 83 198 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top ) MemoryAddress::ofLong @ bci:12 (line 165) NativeMemorySegmentImpl::address @ bci:8 (line 65) PtrPass::panama_call_as_address @ bci:4 (line 47) !jvms: AbstractMemorySegmentImpl::checkValidState @ bci:1 (line 366) NativeMemorySegmentImpl::address @ bci:1 (line 64) PtrPass::panama_call_as_address @ bci:4 (line 47) > Field(23) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top > Field(23) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top > Field(28) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top > Field(28) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top > Field(34) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top > Field(34) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 ]] 1 Con === 0 [[]] #top > Field(26) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top > Field(26) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top > Field(29) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top > Field(29) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top > Field(31) NoEscape(NoEscape) -> GlobalEscape(NoEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top > Field(31) GlobalEscape(NoEscape) -> GlobalEscape(GlobalEscape) propagated from: JavaObject(0) GlobalEscape(GlobalEscape) NSR [ 269F 220F 148F 271F 184F 146F [ 66 255 248 241 246 29 114 52 183 142 72 70 12 220 182 141 71 189 ]] 1 Con === 0 [[]] #top > >
> > Testing: > - Manually running hotspot compiler tests with `-XX:CompileCommand=TraceEscapeAnalysis,*::*` > - Tier1-4 > > Thanks, > Jorn This pull request has now been integrated. Changeset: 8fec7b87 Author: Jorn Vernee URL: https://git.openjdk.java.net/jdk/commit/8fec7b87c1bc762f9c8ef41cd715d5aaab4c0324 Stats: 141 lines in 4 files changed: 96 ins; 0 del; 45 mod 8281548: Add escape analysis tracing flag Reviewed-by: kvn, thartmann, xliu ------------- PR: https://git.openjdk.java.net/jdk/pull/7428 From sviswanathan at openjdk.java.net Tue Mar 1 16:38:06 2022 From: sviswanathan at openjdk.java.net (Sandhya Viswanathan) Date: Tue, 1 Mar 2022 16:38:06 GMT Subject: RFR: 8281375: Accelerate bitCount operation for AVX2 and AVX512 target. [v6] In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 04:39:29 GMT, Jatin Bhateja wrote: >> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 4375: >> >>> 4373: evpunpckldq(xtmp2, k0, xtmp3, xtmp1, true, vec_enc); >>> 4374: evpsadbw(xtmp2, k0, xtmp2, xtmp1, true, vec_enc); >>> 4375: vpackuswb(dst, xtmp2, dst, vec_enc); >> >> This doesn't look correct for say 512 bit vector length. At this point, the xtmp2 has 64-bit popcount results for lower 8 integers and dst has 64-bit popcount results for upper 8 integers. The vpackuswb does interleaving between xtmp2 and dst at 128 bit lanes so the result is not in correct order. > > original vector of integer = [ a3 a2 a1 a0] > unpackldq = [0, a1, 0, a0] > unpackhdq = [ 0, a3 , 0 , a2] > perform sum of absolute difference and store the result into LSB 16 bits of each quad word. > packuswb packs at lane granularity i.e, 128 bits packed. > 128 bit 128 bit > [0, sa3, 0, sa2] [ 0, sa1, 0, sa0 ] => [ sa3, sa2 , sa1, sa0] The problem is at 512 bit level. ------------- PR: https://git.openjdk.java.net/jdk/pull/7373 From jbhateja at openjdk.java.net Tue Mar 1 17:07:58 2022 From: jbhateja at openjdk.java.net (Jatin Bhateja) Date: Tue, 1 Mar 2022 17:07:58 GMT Subject: RFR: 8279508: Auto-vectorize Math.round API [v10] In-Reply-To: References: Message-ID: > Summary of changes: > - Intrinsify Math.round(float) and Math.round(double) APIs. > - Extend auto-vectorizer to infer vector operations on encountering scalar IR nodes for above intrinsics. > - Test creation using new IR testing framework. > > Following are the performance number of a JMH micro included with the patch > > Test System: Intel(R) Xeon(R) Platinum 8380 CPU @ 2.30GHz (Icelake Server) > > > Benchmark | TESTSIZE | Baseline AVX3 (ops/ms) | Withopt AVX3 (ops/ms) | Gain ratio | Baseline AVX2 (ops/ms) | Withopt AVX2 (ops/ms) | Gain ratio > -- | -- | -- | -- | -- | -- | -- | -- > FpRoundingBenchmark.test_round_double | 1024.00 | 504.15 | 2209.54 | 4.38 | 510.36 | 548.39 | 1.07 > FpRoundingBenchmark.test_round_double | 2048.00 | 293.64 | 1271.98 | 4.33 | 293.48 | 274.01 | 0.93 > FpRoundingBenchmark.test_round_float | 1024.00 | 825.99 | 4754.66 | 5.76 | 751.83 | 2274.13 | 3.02 > FpRoundingBenchmark.test_round_float | 2048.00 | 412.22 | 2490.09 | 6.04 | 388.52 | 1334.18 | 3.43 > > > Kindly review and share your feedback. > > Best Regards, > Jatin Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: 8279508: Review comments resolved.` ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7094/files - new: https://git.openjdk.java.net/jdk/pull/7094/files/54d4ea36..3b90ae53 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7094&range=09 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7094&range=08-09 Stats: 12 lines in 2 files changed: 1 ins; 0 del; 11 mod Patch: https://git.openjdk.java.net/jdk/pull/7094.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7094/head:pull/7094 PR: https://git.openjdk.java.net/jdk/pull/7094 From jbhateja at openjdk.java.net Tue Mar 1 17:08:51 2022 From: jbhateja at openjdk.java.net (Jatin Bhateja) Date: Tue, 1 Mar 2022 17:08:51 GMT Subject: RFR: 8281375: Accelerate bitCount operation for AVX2 and AVX512 target. [v7] In-Reply-To: References: Message-ID: > Summary of changes: > > - Patch extends existing vectorized bitCount optimization added with [JDK-8278868](https://bugs.openjdk.java.net/browse/JDK-8278868) and emits optimized JIT sequence for AVX2 and other AVX512 targets which do not support avx512_vpopcntdq feature. > - Since PopCountVI/PopCountVL node emit different instruction sequence based on the target features hence a rudimentary cost mode has been added which influences the SLP unrolling factor to prevent generating bloated main loops. > - Following are the performance results of an existing [JMH micro](https://github.com/jatin-bhateja/jdk/blob/master/test/micro/org/openjdk/bench/vm/compiler/VectorBitCount.java) over various X86 targets. > > > Benchmark | SIZE | Baseline AVX2 (ns/op) | Withopt AVX2 (ns/op) | Gain % | Baseline AVX3 (ns/op) | Withopt AVX3 (ns/op) | Gain % | Baseline AVX3 (VPOPCOUNTDQ) | Withopt AVX3 (VPOCOUNTDQ) | Gain % > -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- > VectorBitCount.WithSuperword.intBitCount | 1024 | 1089.799 | 420.156 | 159.3796114 | 1083.92 | 203.958 | 431.442748 | 88.958 | 60.096 | 48.02649095 > VectorBitCount.WithSuperword.longBitCount | 1024 | 417.458 | 413.859 | 0.869619846 | 417.203 | 214.949 | 94.09394787 | 105.954 | 117.019 | -9.455729411 > > Please review and share your feedback. > > Best Regards, > Jatin Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: 8281375: Review comments resolved. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7373/files - new: https://git.openjdk.java.net/jdk/pull/7373/files/92071f7b..1cdd068e Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7373&range=06 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7373&range=05-06 Stats: 6 lines in 2 files changed: 2 ins; 0 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/7373.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7373/head:pull/7373 PR: https://git.openjdk.java.net/jdk/pull/7373 From kvn at openjdk.java.net Tue Mar 1 18:32:02 2022 From: kvn at openjdk.java.net (Vladimir Kozlov) Date: Tue, 1 Mar 2022 18:32:02 GMT Subject: RFR: 8281122: [IR Framework] Cleanup IR matching code in preparation for JDK-8280378 In-Reply-To: References: Message-ID: On Fri, 18 Feb 2022 13:36:31 GMT, Christian Hagedorn wrote: > This patch does some restructurings and refactorings of the `IRMatcher.java` class in preparation for adding IR matching support on different compile phases with [JDK-8280378](https://bugs.openjdk.java.net/browse/JDK-8280378). There are no semantic changes of how IR matching is eventually done on regexes and how the results are checked with the `failOn` and `counts` constraints provided by the user. The only user-visible change is an improved output format of matching failures. > > The old format also did not report a `counts` constraint failure correctly. It wrongly used the format of `failOn` failures which was misleading. This is also fixed by this patch. > > **Example:** > > @Test > @IR(counts = {IRNode.STORE_F, "!= 1"}) // fails > @IR(counts = {IRNode.STORE_F, "2", IRNode.LOAD_F, "> 1"}) // both constraints fail > public void test1() { > fFld = 4.2f; > } > > @Test > @IR(failOn = IRNode.ALLOC, counts = {IRNode.STORE_F, ">= 2"}) // failOn and counts fail > public void test2() { > fFld = 4.2f; > o = new Object(); > } > > _Failure outputs:_ >
> Old format > > > Failed IR Rules (3) > ------------------ > - Method "public void ir_framework.tests.Testi.test1()": > * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", "!= 1"}, applyIfNot={})" > - counts: Graph contains wrong number of nodes: > Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > Expected 1 but found 1 node: > 25 StoreF === 5 7 24 21 [[ 16 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test1 @ bci:3 (line 48) > * @IR rule 2: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", "2", "(\\d+(\\s){2}(LoadF.*)+(\\s){2}===.*)", "> 1"}, applyIfNot={})" > - counts: Graph contains wrong number of nodes: > Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > Expected 2 but found 1 node: > 25 StoreF === 5 7 24 21 [[ 16 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test1 @ bci:3 (line 48) > Regex 2: (\d+(\s){2}(LoadF.*)+(\s){2}===.*) > Expected 1 but found 0 nodes. > > - Method "public void ir_framework.tests.Testi.test2()": > * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={"(.*precise .*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java)"}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", ">= 2"}, applyIfNot={})" > - failOn: Graph contains forbidden nodes: > Regex 1: (.*precise .*\R((.*(?i:mov|xorl|nop|spill).*|\s*|.*LGHI.*)\R)*.*(?i:call,static).*wrapper for: _new_instance_Java) > Matched forbidden node: > 1a5 movq RSI, precise java/lang/Object: 0x00007fb188007318:Constant:exact * # ptr > 1af call,static wrapper for: _new_instance_Java > - counts: Graph contains wrong number of nodes: > Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > Expected 2 but found 1 node: > 25 StoreF === 5 7 24 21 [[ 19 236 36 179 220 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test2 @ bci:3 (line 55) > >
>
> New format > > > Failed IR Rules (3) of Methods (2) > ---------------------------------- > 1) Method "public void ir_framework.tests.Testi.test1()" - [Failed IR rules: 2]: > * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", "!= 1"}, applyIfNot={})" > - counts: Graph contains wrong number of nodes: > * Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > - Failed comparison: [found] 1 != 1 [given] > - Matched node: > * 25 StoreF === 5 7 24 21 [[ 16 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test1 @ bci:3 (line 48) > * @IR rule 2: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", "2", "(\\d+(\\s){2}(LoadF.*)+(\\s){2}===.*)", "> 1"}, applyIfNot={})" > - counts: Graph contains wrong number of nodes: > * Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > - Failed comparison: [found] 1 = 2 [given] > - Matched node: > * 25 StoreF === 5 7 24 21 [[ 16 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test1 @ bci:3 (line 48) > * Regex 2: (\d+(\s){2}(LoadF.*)+(\s){2}===.*) > - Failed comparison: [found] 0 > 1 [given] > - No nodes matched! > > 2) Method "public void ir_framework.tests.Testi.test2()" - [Failed IR rules: 1]: > * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={"(.*precise .*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java)"}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", ">= 2"}, applyIfNot={})" > - failOn: Graph contains forbidden nodes: > * Regex 1: (.*precise .*\R((.*(?i:mov|xorl|nop|spill).*|\s*|.*LGHI.*)\R)*.*(?i:call,static).*wrapper for: _new_instance_Java) > - Matched forbidden node: > * 1a5 movq RSI, precise java/lang/Object: 0x00007fd3c4007318:Constant:exact * # ptr > 1af call,static wrapper for: _new_instance_Java > - counts: Graph contains wrong number of nodes: > * Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > - Failed comparison: [found] 1 >= 2 [given] > - Matched node: > * 25 StoreF === 5 7 24 21 [[ 19 236 36 179 220 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test2 @ bci:3 (line 55) > >
> > **New class structure:** > > The old `IRMatcher` class mixed different tasks such as parsing, IR annotation verification, IR matching and failure reporting together. This made it difficult to extend the existing code to add IR matching support on different compile phases. Therefore, the class was split to separate the different tasks: > - parser classes (`IREncodingParser`, `HotSpotPidFileParser`, `IRMethodParser` etc.) > - entity classes for the different parts of an `@IR` annotation (`IRMethod`, `IRRule`, `Counts`, `FailOn` etc.) > - match result classes for each entity class to provide a formatted failure message (`IRMethodMatchResult`, `IRRuleMatchResult` etc.) > > The main structure of the new classes will be kept in JDK-8280378 but will be further improved to match the new needs. > > **Testing:** > - Normal tier testing including tier5 and 6 where the IR framework tests are executed. > - Testing of this patch in Valhalla with tier1-3 + some Valhalla-specific stress testing > > > Thanks, > Christian Good. ------------- Marked as reviewed by kvn (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7533 From kvn at openjdk.java.net Tue Mar 1 19:22:58 2022 From: kvn at openjdk.java.net (Vladimir Kozlov) Date: Tue, 1 Mar 2022 19:22:58 GMT Subject: RFR: 8282142: [TestCase] compiler/inlining/ResolvedClassTest.java will fail when --with-jvm-features=-compiler1 [v3] In-Reply-To: References: Message-ID: On Mon, 28 Feb 2022 06:45:17 GMT, Haomin wrote: >> ?l when --with-jvm-features=-compiler1 > > Haomin has updated the pull request incrementally with one additional commit since the last revision: > > 8282142: [TestCase] compiler/inlining/ResolvedClassTest.java will fail when --with-jvm-features=-compiler1 Did you investigated why C2 compilation failed to produce expected message? And produces instead: `failed initial checks` ------------- PR: https://git.openjdk.java.net/jdk/pull/7541 From manc at openjdk.java.net Tue Mar 1 20:24:29 2022 From: manc at openjdk.java.net (Man Cao) Date: Tue, 1 Mar 2022 20:24:29 GMT Subject: RFR: 8282507: Add LICENSE file for hsdis Message-ID: <1KA6kduxxfIuA9AaRYd31n8qDpmd5eE0CFJpNzBHHUs=.c9387f31-19f1-47dd-8a61-1746f100f1f6@github.com> Hi all, Could anyone help review the addition of LICENSE file to hsdis directory? -Man ------------- Commit messages: - Add LICENSE file for hsdis Changes: https://git.openjdk.java.net/jdk/pull/7649/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7649&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8282507 Stats: 35 lines in 1 file changed: 35 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/7649.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7649/head:pull/7649 PR: https://git.openjdk.java.net/jdk/pull/7649 From kvn at openjdk.java.net Tue Mar 1 21:10:07 2022 From: kvn at openjdk.java.net (Vladimir Kozlov) Date: Tue, 1 Mar 2022 21:10:07 GMT Subject: RFR: 8279886: C1: Turn off SelectivePhiFunctions in presence of irreducible loops [v2] In-Reply-To: References: <9hUbaevqiNT2GmsBxLbGYHYFmSMeDZZDaBkUpuJFBHk=.b7da7542-844d-4d8c-8f61-ee0eca5a3500@github.com> Message-ID: On Tue, 1 Mar 2022 15:50:24 GMT, Igor Veresov wrote: >> This change add irreducible loops detection to `BlockListBuilder::mark_loops()` - a loop marking routine necessary for the SSA conversion. Here is brief description of the algorithm (copy-pasted from the comments I left in the code). >> >> The loop detection algorithm works as follows: >> >> - We maintain the `_loop_map`, where for each block we have a bitmap indicating which loops contain this block. >> - The CFG is recursively traversed (depth-first) and if we detect a loop, we assign the loop a unique number that is stored in the bitmap associated with the loop header block. Until we return back through that loop header the bitmap contains only a single bit corresponding to the loop number. >> - The bit is then propagated for all the blocks in the loop after we exit them (post-order). There could be multiple bits of course in case of nested loops. >> - When we exit the loop header we remove that single bit and assign the real loop state for it. >> - Now, the tricky part here is how we detect irriducible loops. In the algorithm above the loop state bits are propagated to the predecessors. If we encounter an irreducible loop (a loop with multiple heads) we would see a node with some loop bit set that would then propagate back and be never cleared because we would never go back through the original loop header. Therefore if there are any irreducible loops the bits in the states for these loops are going to propagate back to the root. >> >> Testing is clean: hs-tier{1-7} > > Igor Veresov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits: > > - Add comments > - Detect irreducible loops during parsing/phi insertion. Looks good. ------------- Marked as reviewed by kvn (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7636 From jrose at openjdk.java.net Tue Mar 1 23:05:03 2022 From: jrose at openjdk.java.net (John R Rose) Date: Tue, 1 Mar 2022 23:05:03 GMT Subject: RFR: 8278296: Generalize long range check transformation [v5] In-Reply-To: References: Message-ID: On Wed, 26 Jan 2022 16:04:06 GMT, Roland Westrelin wrote: >> 8259609 (C2: optimize long range checks in long counted loops) only >> covered the case of a counted loop with a positive stride and a range >> check with a positive scale. This change generalizes the long range >> check transformation to all 4 combinations of stride and scale signs. >> >> The stride > 0, scale > 0 case (covered 8259609) was tweaked so it now >> uses Qmax computed as the inclusive limit of j*K+Q. That helps in >> generalizing the formulas to other cases. >> >> The addition of PhaseIdealLoop::is_scaled_iv_plus_extra_offset() was >> required for the case of negative scale in an int loop. The range >> check then has the shape: >> >> (CmpUL (AddL (ConvI2L (SubI ConI (LshiftI (Phi >> >> with ConI, the zero constant. >> >> This change also addresses this comment from John: >> >> https://github.com/openjdk/jdk/pull/6576#discussion_r765343664 >> >> as part of 8276116 (C2: optimize long range checks in int counted loops) > > Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision: > > review Attached is another bunch of documentation changes, explaining what's going on in great detail. I think I'm done, actually. I did this in concert with an executable test harness, to catch logic errors. [roland-review-0301-patch.txt](https://github.com/openjdk/jdk/files/8165295/roland-review-0301-patch.txt) In the transform code, I changed the names of some of the variables and some of the order of operations, to correspond better to the documentation (or so I hope; please check). I made an algorithmic change, replacing an overflowing `Q_max+1` by simply `max_jlong` rather than `R`, since `max_jlong` is a simple rematerializable constant but `R` might need spilling. I validated this change in my test harness; any value between R and `max_jlong` inclusive will work as `H_clamp`. Near the conditional moves I made comments suggesting alternative flow-free idioms. But I can't think of any good reason not to use the conditional moves, even on platforms (like old PPC) which implement them as control flow. Feel free to toss those comments, though I enjoyed coming up with them. For the record, I did a series of experiments to validate the subtle logic of this transformation. Here is the code: Attached is another bunch of documentation changes, explaining what's going on in great detail. I think I'm done, actually. I did this in concert with an executable test harness, to catch logic errors. [roland-review-0301-patch.txt](https://github.com/openjdk/jdk/files/8165295/roland-review-0301-patch.txt) In the transform code, I changed the names of some of the variables and some of the order of operations, to correspond better to the documentation (or so I hope; please check). I made an algorithmic change, replacing an overflowing `Q_max+1` by simply `max_jlong` rather than `R`, since `max_jlong` is a simple rematerializable constant but `R` might need spilling. I validated this change in my test harness; any value between R and `max_jlong` inclusive will work as `H_clamp`. Near the conditional moves I made comments suggesting alternative flow-free idioms. But I can't think of any good reason not to use the conditional moves, even on platforms (like old PPC) which implement them as control flow. Feel free to toss those comments, though I enjoyed coming up with them. For the record, I did a series of experiments to validate the subtle logic of this transformation. Here is the code: ------------- PR: https://git.openjdk.java.net/jdk/pull/6989 From duke at openjdk.java.net Wed Mar 2 01:55:59 2022 From: duke at openjdk.java.net (Haomin) Date: Wed, 2 Mar 2022 01:55:59 GMT Subject: RFR: 8282142: [TestCase] compiler/inlining/ResolvedClassTest.java will fail when --with-jvm-features=-compiler1 [v3] In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 19:20:16 GMT, Vladimir Kozlov wrote: > Did you investigated why C2 compilation failed to produce expected message? And produces instead: `failed initial checks` Hi @vnkozlov , `testStaticInit()` want to get expected error `analyzer.shouldContain("TestStaticInit$A::m (1 bytes) no static binding");` But only C1 can print this. grep -nr "no static binding" src/hotspot/ src/hotspot/share/c1/c1_GraphBuilder.cpp:2101: print_inlining(target, "no static binding", /*success*/ false); src/hotspot/share/gc/parallel/mutableNUMASpace.cpp:834: // Make the page allocation happen here if there is no static binding. So, I think It should be tested when c1-only. Thanks. ------------- PR: https://git.openjdk.java.net/jdk/pull/7541 From jbhateja at openjdk.java.net Wed Mar 2 02:44:41 2022 From: jbhateja at openjdk.java.net (Jatin Bhateja) Date: Wed, 2 Mar 2022 02:44:41 GMT Subject: RFR: 8279508: Auto-vectorize Math.round API [v11] In-Reply-To: References: Message-ID: > Summary of changes: > - Intrinsify Math.round(float) and Math.round(double) APIs. > - Extend auto-vectorizer to infer vector operations on encountering scalar IR nodes for above intrinsics. > - Test creation using new IR testing framework. > > Following are the performance number of a JMH micro included with the patch > > Test System: Intel(R) Xeon(R) Platinum 8380 CPU @ 2.30GHz (Icelake Server) > > > Benchmark | TESTSIZE | Baseline AVX3 (ops/ms) | Withopt AVX3 (ops/ms) | Gain ratio | Baseline AVX2 (ops/ms) | Withopt AVX2 (ops/ms) | Gain ratio > -- | -- | -- | -- | -- | -- | -- | -- > FpRoundingBenchmark.test_round_double | 1024.00 | 504.15 | 2209.54 | 4.38 | 510.36 | 548.39 | 1.07 > FpRoundingBenchmark.test_round_double | 2048.00 | 293.64 | 1271.98 | 4.33 | 293.48 | 274.01 | 0.93 > FpRoundingBenchmark.test_round_float | 1024.00 | 825.99 | 4754.66 | 5.76 | 751.83 | 2274.13 | 3.02 > FpRoundingBenchmark.test_round_float | 2048.00 | 412.22 | 2490.09 | 6.04 | 388.52 | 1334.18 | 3.43 > > > Kindly review and share your feedback. > > Best Regards, > Jatin Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: 8279508: Removing +LogCompilation flag. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7094/files - new: https://git.openjdk.java.net/jdk/pull/7094/files/3b90ae53..57b1b13a Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7094&range=10 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7094&range=09-10 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/7094.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7094/head:pull/7094 PR: https://git.openjdk.java.net/jdk/pull/7094 From xgong at openjdk.java.net Wed Mar 2 03:46:27 2022 From: xgong at openjdk.java.net (Xiaohong Gong) Date: Wed, 2 Mar 2022 03:46:27 GMT Subject: RFR: 8282432: Optimize masked "test" Vector API with predicate feature Message-ID: The vector `"test"` api is implemented with vector `"compare"`. And the masked `"test" `is implemented with `"test(op).and(m)"` which means `"compare().and(m)"` finally. Since the masked vector `"compare"` has been optimized with predicated instruction for archituctures that support the feature, the masked `"test"` can also be optimized by implementing it with the predicated compare. This could save the additional ` "and"` for architectures that support the predicate feature. This patch optimized the masked `"test"` by implementing it with masked `"compare"`. With this patch, the following codes for the` "IS_NEGATIVE"` op for a DoubleVector with SVE: mov z19.d, #0 cmpgt p1.d, p7/z, z19.d, z17.d and p0.b, p7/z, p1.b, p0.b are optimized to: mov z19.d, #0 cmpgt p0.d, p0/z, z19.d, z17.d Also update the jtreg tests for masked` "test" ` to make sure they are hot enough to be compiled by c2. ------------- Commit messages: - 8282432: Optimize masked "test" Vector API with predicate feature Changes: https://git.openjdk.java.net/jdk/pull/7654/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7654&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8282432 Stats: 1233 lines in 70 files changed: 590 ins; 7 del; 636 mod Patch: https://git.openjdk.java.net/jdk/pull/7654.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7654/head:pull/7654 PR: https://git.openjdk.java.net/jdk/pull/7654 From jbhateja at openjdk.java.net Wed Mar 2 05:05:11 2022 From: jbhateja at openjdk.java.net (Jatin Bhateja) Date: Wed, 2 Mar 2022 05:05:11 GMT Subject: RFR: 8281375: Accelerate bitCount operation for AVX2 and AVX512 target. [v6] In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 16:34:52 GMT, Sandhya Viswanathan wrote: >> original vector of integer = [ a3 a2 a1 a0] >> unpackldq = [0, a1, 0, a0] >> unpackhdq = [ 0, a3 , 0 , a2] >> perform sum of absolute difference and store the result into LSB 16 bits of each quad word. >> packuswb packs at lane granularity i.e, 128 bits packed. >> 128 bit 128 bit >> [0, sa3, 0, sa2] [ 0, sa1, 0, sa0 ] => [ sa3, sa2 , sa1, sa0] > > The problem is at 512 bit level. original 512 bit vector holding 16 integers = [ a15 a14 a13 a12, a11 a10 a9 a8 ,a7 a6 a5 a4 ,a3 a2 a1 a0 ] unpackdq lower: 512 bit (vec1) 128 128 128 128 0 a13 0 a12 0 a9 0 a8 0 a5 0 a4 0 a1 0 a0 unpackdq higher: 512 bit (vec1) 128 128 128 128 0 a15 0 a14 0 a11 0 a10 0 a7 0 a6 0 a3 0 a2 Next sum of absolute difference operation followed by pack will squeez each 128 bit lane of two participant vectors and interleave them in resulatant vector. VEC1_L3 VEC1_L2 VEC1_L1 VEC1_L0 VEC2_L3 VEC2_L2 VEC2_L1 VEC2_L0 [ 0 sa13 0 sa12 0 sa9 0 sa8 0 sa5 0 sa4 0 sa1 0 sa0 ] [ 0 sa15 0 sa14 0 sa11 0 sa10 0 sa7 0 sa6 0 sa3 0 sa2 ] [ sa15 sa14 sa13 sa12 sa11 sa10 sa9 sa8 sa7 sa6 sa5 sa4 sa3 sa2 sa1 sa0] ------------- PR: https://git.openjdk.java.net/jdk/pull/7373 From chagedorn at openjdk.java.net Wed Mar 2 09:01:05 2022 From: chagedorn at openjdk.java.net (Christian Hagedorn) Date: Wed, 2 Mar 2022 09:01:05 GMT Subject: Integrated: 8282480: IGV: Use description instead of enum name for phases In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 13:03:50 GMT, Christian Hagedorn wrote: > [JDK-8281505](https://bugs.openjdk.java.net/browse/JDK-8281505) changed the `PrintIdeal` output to use the enum name of a phase when used with `PrintIdealPhase` instead of the description. However, it also changed the phase name shown in the IGV to the enum name. This should be reverted back for a better readability. > > IGV after JDK-8281505: > ![Screenshot from 2022-03-01 13-59-15](https://user-images.githubusercontent.com/17833009/156173248-7f6450cb-9816-437a-b5fa-816a2e214ad9.png) > > IGV before JDK-8281505/with this patch: > ![Screenshot from 2022-03-01 13-58-36](https://user-images.githubusercontent.com/17833009/156173243-0a0f975a-a44d-46a6-a48a-5183ff7600e1.png) > > Thanks, > Christian This pull request has now been integrated. Changeset: ed3496e6 Author: Christian Hagedorn URL: https://git.openjdk.java.net/jdk/commit/ed3496e6c030b6b0a3745bf8ef281075afa1cd27 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod 8282480: IGV: Use description instead of enum name for phases Reviewed-by: redestad, thartmann ------------- PR: https://git.openjdk.java.net/jdk/pull/7645 From ihse at openjdk.java.net Wed Mar 2 10:33:02 2022 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Wed, 2 Mar 2022 10:33:02 GMT Subject: RFR: 8282507: Add LICENSE file for hsdis In-Reply-To: <1KA6kduxxfIuA9AaRYd31n8qDpmd5eE0CFJpNzBHHUs=.c9387f31-19f1-47dd-8a61-1746f100f1f6@github.com> References: <1KA6kduxxfIuA9AaRYd31n8qDpmd5eE0CFJpNzBHHUs=.c9387f31-19f1-47dd-8a61-1746f100f1f6@github.com> Message-ID: On Tue, 1 Mar 2022 20:18:11 GMT, Man Cao wrote: > Hi all, > > Could anyone help review the addition of LICENSE file to hsdis directory? > > -Man I'm not sure what the legal implications are of adding a separate general file like this, instead of marking each individual file. I'd need to get some confirmation that this is acceptable. ------------- PR: https://git.openjdk.java.net/jdk/pull/7649 From roland at openjdk.java.net Wed Mar 2 13:36:31 2022 From: roland at openjdk.java.net (Roland Westrelin) Date: Wed, 2 Mar 2022 13:36:31 GMT Subject: RFR: 8278296: Generalize long range check transformation [v6] In-Reply-To: References: Message-ID: <_NG2SisUeyWEbQzye-ZRXRiadCQL-tIjhG0v7Jz6QhY=.4c2df5ac-d323-43ed-ab3e-7e92af1f6371@github.com> > 8259609 (C2: optimize long range checks in long counted loops) only > covered the case of a counted loop with a positive stride and a range > check with a positive scale. This change generalizes the long range > check transformation to all 4 combinations of stride and scale signs. > > The stride > 0, scale > 0 case (covered 8259609) was tweaked so it now > uses Qmax computed as the inclusive limit of j*K+Q. That helps in > generalizing the formulas to other cases. > > The addition of PhaseIdealLoop::is_scaled_iv_plus_extra_offset() was > required for the case of negative scale in an int loop. The range > check then has the shape: > > (CmpUL (AddL (ConvI2L (SubI ConI (LshiftI (Phi > > with ConI, the zero constant. > > This change also addresses this comment from John: > > https://github.com/openjdk/jdk/pull/6576#discussion_r765343664 > > as part of 8276116 (C2: optimize long range checks in int counted loops) Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits: - typo + build fix - John's review - Merge branch 'master' into JDK-8278296 - review - fixes - John's patch - Merge branch 'master' into JDK-8278296 - more review - review - whitespaces - ... and 1 more: https://git.openjdk.java.net/jdk/compare/2c5d266f...6a2ae123 ------------- Changes: https://git.openjdk.java.net/jdk/pull/6989/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6989&range=05 Stats: 723 lines in 7 files changed: 489 ins; 79 del; 155 mod Patch: https://git.openjdk.java.net/jdk/pull/6989.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/6989/head:pull/6989 PR: https://git.openjdk.java.net/jdk/pull/6989 From roland at openjdk.java.net Wed Mar 2 13:40:00 2022 From: roland at openjdk.java.net (Roland Westrelin) Date: Wed, 2 Mar 2022 13:40:00 GMT Subject: RFR: 8278296: Generalize long range check transformation [v5] In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 23:02:10 GMT, John R Rose wrote: > Attached is another bunch of documentation changes, explaining what's going on in great detail. I think I'm done, actually. I did this in concert with an executable test harness, to catch logic errors. Thanks for the careful review. I pushed your patch + another commit with a typo and build fixes. Would you mind marking yourself as a reviewer (using the github UI) if you're done? ------------- PR: https://git.openjdk.java.net/jdk/pull/6989 From adinn at openjdk.java.net Wed Mar 2 13:49:00 2022 From: adinn at openjdk.java.net (Andrew Dinn) Date: Wed, 2 Mar 2022 13:49:00 GMT Subject: RFR: 8282182: Document algorithm used to encode aarch64 logical immediate operands. [v3] In-Reply-To: <_mcHOjaHB3O6M6B9vFnu6d-SWwTNu14mX2-iVAHYKz4=.2e9b79d3-fe2f-45b0-9942-48eccb1cfa11@github.com> References: <_mcHOjaHB3O6M6B9vFnu6d-SWwTNu14mX2-iVAHYKz4=.2e9b79d3-fe2f-45b0-9942-48eccb1cfa11@github.com> Message-ID: On Mon, 21 Feb 2022 13:15:34 GMT, Andrew Dinn wrote: >> This *documentation only* change explains how logical immediate mask values are derived from valid logical instruction operands. The encoding function is used to populate a sparse array that maps valid masks to a unique set of input operand values and a reverse lookup array that maps inputs to the associated mask. > > Andrew Dinn has updated the pull request incrementally with one additional commit since the last revision: > > include unsaved changes @shipilev Any further comments on the revised version? ------------- PR: https://git.openjdk.java.net/jdk/pull/7536 From manc at openjdk.java.net Wed Mar 2 19:09:03 2022 From: manc at openjdk.java.net (Man Cao) Date: Wed, 2 Mar 2022 19:09:03 GMT Subject: RFR: 8282507: Add LICENSE file for hsdis In-Reply-To: <1KA6kduxxfIuA9AaRYd31n8qDpmd5eE0CFJpNzBHHUs=.c9387f31-19f1-47dd-8a61-1746f100f1f6@github.com> References: <1KA6kduxxfIuA9AaRYd31n8qDpmd5eE0CFJpNzBHHUs=.c9387f31-19f1-47dd-8a61-1746f100f1f6@github.com> Message-ID: <6p9JZ8dwlJ5-HZkkP4yxHfv17G8v25jmSLTiw9GgUu8=.384fb06e-3fb6-477a-a82a-5e31b0022241@github.com> On Tue, 1 Mar 2022 20:18:11 GMT, Man Cao wrote: > Hi all, > > Could anyone help review the addition of LICENSE file to hsdis directory? > > -Man Thank you for reaching out for confirmation. This doc might help: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository . A separate LICENSE file is also more consistent with other code in OpenJDK. ------------- PR: https://git.openjdk.java.net/jdk/pull/7649 From psandoz at openjdk.java.net Wed Mar 2 19:17:04 2022 From: psandoz at openjdk.java.net (Paul Sandoz) Date: Wed, 2 Mar 2022 19:17:04 GMT Subject: RFR: 8282432: Optimize masked "test" Vector API with predicate feature In-Reply-To: References: Message-ID: <3Eb4XMw6WAiao9pQW6BfchjrwQ4qju9nL8hG0HL9psk=.aa63fea9-c727-4a34-9b87-e78fea9d027a@github.com> On Wed, 2 Mar 2022 02:50:27 GMT, Xiaohong Gong wrote: > The vector `"test"` api is implemented with vector `"compare"`. And the masked `"test" `is implemented with `"test(op).and(m)"` which means `"compare().and(m)"` finally. Since the masked vector `"compare"` has been optimized with predicated instruction for archituctures that support the feature, the masked `"test"` can also be optimized by implementing it with the predicated compare. This could save the additional ` "and"` for architectures that support the predicate feature. > > This patch optimized the masked `"test"` by implementing it with masked `"compare"`. With this patch, the following codes for the` "IS_NEGATIVE"` op for a DoubleVector with SVE: > > mov z19.d, #0 > cmpgt p1.d, p7/z, z19.d, z17.d > and p0.b, p7/z, p1.b, p0.b > > are optimized to: > > mov z19.d, #0 > cmpgt p0.d, p0/z, z19.d, z17.d > > Also update the jtreg tests for masked` "test" ` to make sure they are hot enough to be compiled by c2. src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java line 1737: > 1735: , > 1736: M2 extends VectorMask> > 1737: M1 testTemplate(Class maskType, Test op, M2 mask) { Can we simplify by making some code FP specific? - the mask `cast` can be applied in this method rather than in the caller, simplifying the signature - for clarify, vector `viewAsIntegralLanes` is only needed for FP (update would be required for the non-mask template). src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java line 1766: > 1764: throw new AssertionError(op); > 1765: } > 1766: return maskType.cast(m.cast(this.vspecies())); Suggestion: return maskType.cast(m.cast(vsp)); Same for non-mask template too. test/jdk/jdk/incubator/vector/templates/Unit-Test.template line 29: > 27: VectorMask<$Wideboxtype$> vmask = VectorMask.fromArray(SPECIES, mask, 0); > 28: > 29: for (int ic = 0; ic < INVOC_COUNT; ic++) { Can you remove `SmokeTest` from the method name. ------------- PR: https://git.openjdk.java.net/jdk/pull/7654 From jiefu at openjdk.java.net Wed Mar 2 23:16:07 2022 From: jiefu at openjdk.java.net (Jie Fu) Date: Wed, 2 Mar 2022 23:16:07 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v7] In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 02:28:00 GMT, Quan Anh Mai wrote: >> Hi, >> >> This patch adds several matching rules for x86_64 backend to use `lea` instructions for several fused arithmetic operations. Also, `lea`s don't kill flags and allow different `dst` and `src`, so it is preferred over `sll` if possible, too. >> >> Thank you very much. > > Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: > > remove irrelevent changes test/micro/org/openjdk/bench/vm/compiler/LeaInstruction.java line 32: > 30: @BenchmarkMode(Mode.AverageTime) > 31: @OutputTimeUnit(TimeUnit.NANOSECONDS) > 32: @Fork(value = 2, jvmArgsAppend = {"-XX:LoopUnrollLimit=1"}) How about `value = 1`? I think it would reduce the micro-bench testing time, right? ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From sviswanathan at openjdk.java.net Wed Mar 2 23:27:08 2022 From: sviswanathan at openjdk.java.net (Sandhya Viswanathan) Date: Wed, 2 Mar 2022 23:27:08 GMT Subject: RFR: 8279508: Auto-vectorize Math.round API [v9] In-Reply-To: References: <1K0c0y8K8bVNJEFMyTQSxwdgJlx9E2N8uhHC7O9sfyM=.c4ead8b5-abe0-42f4-ae10-aa24425eb75d@github.com> <8mhsd-DL1IccFiqrRigKdck8OJg79sjKgaYXrHc4zwY=.c92cb7f5-8e54-42ab-84f1-9cfa1ce76779@github.com> Message-ID: On Sat, 26 Feb 2022 03:38:32 GMT, Quan Anh Mai wrote: >> I believe the indefinite value should be 2^(w - 1) (a.k.a 0x80000000) and the documentation is typoed. If you look at `cvtss2si`, the indefinite value is also written as 2^w - 1 but yet in `MacroAssembler::convert_f2i` we compare it with 0x80000000. In addition, choosing -1 as an indefinite value is weird enough and to complicate it as 2^w - 1 is really unusual. > > `MacroAssembler::convert_f2i` > > https://github.com/openjdk/jdk/blob/c5c6058fd57d4b594012035eaf18a57257f4ad85/src/hotspot/cpu/x86/macroAssembler_x86.cpp#L8919 @jatin-bhateja @merykitty You are right, on overflow we observe 2^(w - 1) i.e. 0x8000 0000 so using vector_float_signflip() is correct. ------------- PR: https://git.openjdk.java.net/jdk/pull/7094 From sviswanathan at openjdk.java.net Wed Mar 2 23:32:05 2022 From: sviswanathan at openjdk.java.net (Sandhya Viswanathan) Date: Wed, 2 Mar 2022 23:32:05 GMT Subject: RFR: 8279508: Auto-vectorize Math.round API [v11] In-Reply-To: References: Message-ID: On Wed, 2 Mar 2022 02:44:41 GMT, Jatin Bhateja wrote: >> Summary of changes: >> - Intrinsify Math.round(float) and Math.round(double) APIs. >> - Extend auto-vectorizer to infer vector operations on encountering scalar IR nodes for above intrinsics. >> - Test creation using new IR testing framework. >> >> Following are the performance number of a JMH micro included with the patch >> >> Test System: Intel(R) Xeon(R) Platinum 8380 CPU @ 2.30GHz (Icelake Server) >> >> >> Benchmark | TESTSIZE | Baseline AVX3 (ops/ms) | Withopt AVX3 (ops/ms) | Gain ratio | Baseline AVX2 (ops/ms) | Withopt AVX2 (ops/ms) | Gain ratio >> -- | -- | -- | -- | -- | -- | -- | -- >> FpRoundingBenchmark.test_round_double | 1024.00 | 504.15 | 2209.54 | 4.38 | 510.36 | 548.39 | 1.07 >> FpRoundingBenchmark.test_round_double | 2048.00 | 293.64 | 1271.98 | 4.33 | 293.48 | 274.01 | 0.93 >> FpRoundingBenchmark.test_round_float | 1024.00 | 825.99 | 4754.66 | 5.76 | 751.83 | 2274.13 | 3.02 >> FpRoundingBenchmark.test_round_float | 2048.00 | 412.22 | 2490.09 | 6.04 | 388.52 | 1334.18 | 3.43 >> >> >> Kindly review and share your feedback. >> >> Best Regards, >> Jatin > > Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: > > 8279508: Removing +LogCompilation flag. Marked as reviewed by sviswanathan (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/7094 From sviswanathan at openjdk.java.net Wed Mar 2 23:32:06 2022 From: sviswanathan at openjdk.java.net (Sandhya Viswanathan) Date: Wed, 2 Mar 2022 23:32:06 GMT Subject: RFR: 8279508: Auto-vectorize Math.round API [v9] In-Reply-To: References: Message-ID: On Sat, 26 Feb 2022 04:55:08 GMT, Jatin Bhateja wrote: >> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: >> >> 8279508: Adding descriptive comments. > > As per SDM, if post conversion a floating point number is non-representable in destination format e.g. a floating point value 3.4028235E10 post integer conversion will overflow the value range of integer primitive type, hence a -0.0 value or 0x80000000 is returned here. Similarly for +/- NaN and +/-Inf post conversion value returns is -0.0. All these cases i.e. post conversion non-representable floating point values and NaN/Inf values are handled in a special manner where algorithm first performs an unordered comparison b/w original source value and returns a 0 in case of NaN, this weeds out the NaN case and for rest of the special values we check the MSB bit of the source and either return an Integer.MAX_VALUE for +ve numbers or a Integer.MIN_VALUE to adhere to the semantics of Math.round API. > > Existing tests were enhanced to cover various special cases (NaN/Inf/+ve/-ve value/values which may be inexact after adding 0.5/ values which post conversion overflow integer value range). @jatin-bhateja The patch looks good to me. ------------- PR: https://git.openjdk.java.net/jdk/pull/7094 From sviswanathan at openjdk.java.net Wed Mar 2 23:32:07 2022 From: sviswanathan at openjdk.java.net (Sandhya Viswanathan) Date: Wed, 2 Mar 2022 23:32:07 GMT Subject: RFR: 8279508: Auto-vectorize Math.round API [v9] In-Reply-To: References: Message-ID: On Sat, 26 Feb 2022 01:07:47 GMT, Sandhya Viswanathan wrote: >> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: >> >> 8279508: Adding descriptive comments. > > src/hotspot/cpu/x86/x86.ad line 7295: > >> 7293: __ vector_round_double_evex($dst$$XMMRegister, $src$$XMMRegister, $xtmp1$$XMMRegister, >> 7294: $xtmp2$$XMMRegister, $ktmp1$$KRegister, $ktmp2$$KRegister, >> 7295: ExternalAddress(vector_double_signflip()), new_mxcsr, $scratch$$Register, vlen_enc); > > The vector_double_signflip() here should be replaced by vector_all_bits_set(). > vcvtpd2qq description: > If a converted result cannot be represented in the destination > format, the floating-point invalid exception is raised, and if this exception is masked, the indefinite integer value > (2w-1, where w represents the number of bits in the destination format) is returned. The overflow value observed is 2^(w-1) so using vector_double_signflip() is correct, please ignore this comment. ------------- PR: https://git.openjdk.java.net/jdk/pull/7094 From jrose at openjdk.java.net Wed Mar 2 23:34:05 2022 From: jrose at openjdk.java.net (John R Rose) Date: Wed, 2 Mar 2022 23:34:05 GMT Subject: RFR: 8278296: Generalize long range check transformation [v6] In-Reply-To: <_NG2SisUeyWEbQzye-ZRXRiadCQL-tIjhG0v7Jz6QhY=.4c2df5ac-d323-43ed-ab3e-7e92af1f6371@github.com> References: <_NG2SisUeyWEbQzye-ZRXRiadCQL-tIjhG0v7Jz6QhY=.4c2df5ac-d323-43ed-ab3e-7e92af1f6371@github.com> Message-ID: On Wed, 2 Mar 2022 13:36:31 GMT, Roland Westrelin wrote: >> 8259609 (C2: optimize long range checks in long counted loops) only >> covered the case of a counted loop with a positive stride and a range >> check with a positive scale. This change generalizes the long range >> check transformation to all 4 combinations of stride and scale signs. >> >> The stride > 0, scale > 0 case (covered 8259609) was tweaked so it now >> uses Qmax computed as the inclusive limit of j*K+Q. That helps in >> generalizing the formulas to other cases. >> >> The addition of PhaseIdealLoop::is_scaled_iv_plus_extra_offset() was >> required for the case of negative scale in an int loop. The range >> check then has the shape: >> >> (CmpUL (AddL (ConvI2L (SubI ConI (LshiftI (Phi >> >> with ConI, the zero constant. >> >> This change also addresses this comment from John: >> >> https://github.com/openjdk/jdk/pull/6576#discussion_r765343664 >> >> as part of 8276116 (C2: optimize long range checks in int counted loops) > > Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits: > > - typo + build fix > - John's review > - Merge branch 'master' into JDK-8278296 > - review > - fixes > - John's patch > - Merge branch 'master' into JDK-8278296 > - more review > - review > - whitespaces > - ... and 1 more: https://git.openjdk.java.net/jdk/compare/2c5d266f...6a2ae123 Marked as reviewed by jrose (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/6989 From duke at openjdk.java.net Thu Mar 3 00:16:33 2022 From: duke at openjdk.java.net (Ahmed Muhsin) Date: Thu, 3 Mar 2022 00:16:33 GMT Subject: RFR: 8272735: Add missing SubL node transformations Message-ID: This change adds/enables missing subnode transformations for operations of type `long`. A few comments in the test file `SubINodeIdealizationTests.java` were modified to add clarity and to fix a typo. Hotspot:tier1 tests were run, this change does not introduce any new failures. ------------- Commit messages: - modify test method comments to add clarity and validity - reorder test methods to match the test's counterpart, SubINodeIdealizationTests.java - add missing SubLNode transformations - add tests for missing SubLNode transformations Changes: https://git.openjdk.java.net/jdk/pull/7669/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7669&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8272735 Stats: 64 lines in 3 files changed: 29 ins; 0 del; 35 mod Patch: https://git.openjdk.java.net/jdk/pull/7669.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7669/head:pull/7669 PR: https://git.openjdk.java.net/jdk/pull/7669 From duke at openjdk.java.net Thu Mar 3 00:30:54 2022 From: duke at openjdk.java.net (Quan Anh Mai) Date: Thu, 3 Mar 2022 00:30:54 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v8] In-Reply-To: References: Message-ID: > Hi, > > This patch adds several matching rules for x86_64 backend to use `lea` instructions for several fused arithmetic operations. Also, `lea`s don't kill flags and allow different `dst` and `src`, so it is preferred over `sll` if possible, too. > > Thank you very much. Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: address reviews ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7560/files - new: https://git.openjdk.java.net/jdk/pull/7560/files/31f23261..7d9b1e25 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7560&range=07 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7560&range=06-07 Stats: 43 lines in 2 files changed: 0 ins; 30 del; 13 mod Patch: https://git.openjdk.java.net/jdk/pull/7560.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7560/head:pull/7560 PR: https://git.openjdk.java.net/jdk/pull/7560 From duke at openjdk.java.net Thu Mar 3 00:30:55 2022 From: duke at openjdk.java.net (Quan Anh Mai) Date: Thu, 3 Mar 2022 00:30:55 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v7] In-Reply-To: References: Message-ID: <5_xce5NTgFQepYuEMRANE1c0CuWKJZl6Ix8VI4Quao4=.ebe55bcc-f190-4a67-a3cb-9b97edc08cfb@github.com> On Wed, 2 Mar 2022 14:30:21 GMT, Jie Fu wrote: >> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: >> >> remove irrelevent changes > > src/hotspot/cpu/x86/x86_64.ad line 3523: > >> 3521: match(RegI); >> 3522: match(rRegI); >> 3523: match(rax_RegI); > > Why explicitly match rax, rbx, ..., rdi here? Tbh I'm not sure but the other operands seem to do the same thing > src/hotspot/cpu/x86/x86_64.ad line 7511: > >> 7509: %} >> 7510: >> 7511: instruct leaI_rReg_rReg_immI(rRegI dst, rRegI src1, rRegI src2, immI disp) > > Please rename src1/src2 with base/index. Done > src/hotspot/cpu/x86/x86_64.ad line 7724: > >> 7722: %} >> 7723: >> 7724: instruct leaL_rReg_rReg_immI2_no_disp(rRegL dst, no_rbp_r13_RegL base, rRegL index, immI2 scale) > > Does it make too much sense to keep both `leaL_rReg_rReg_immI2_no_disp ` and `leaL_rReg_rReg_immI2 ` for real programs? > > The more instruct rules in the AD file, the bigger of the libjvm.so would be. > I would suggest removing `leaL_rReg_rReg_immI2 `. I agree ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From jbhateja at openjdk.java.net Thu Mar 3 05:46:09 2022 From: jbhateja at openjdk.java.net (Jatin Bhateja) Date: Thu, 3 Mar 2022 05:46:09 GMT Subject: RFR: 8279508: Auto-vectorize Math.round API [v2] In-Reply-To: References: Message-ID: <3JoM4khNMz85gwfyxZeBNxJCZ_B7826cc-iO4pHtTJM=.5b21a96e-b2f5-4093-a763-eec2b6d77a2e@github.com> On Wed, 19 Jan 2022 22:09:26 GMT, Joe Darcy wrote: >> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: >> >> 8279508: Adding a test for scalar intrinsification. > > The testing for this PR doesn't look adequate to me. I don't see any testing for the values where the behavior of round has been redefined at points in the last decade. See JDK-8010430 and JDK-6430675, both of which have regression tests in the core libs area. Thanks. Hi @jddarcy , can you kindly validate your feedback, it has been incorporated. ------------- PR: https://git.openjdk.java.net/jdk/pull/7094 From jbhateja at openjdk.java.net Thu Mar 3 05:46:07 2022 From: jbhateja at openjdk.java.net (Jatin Bhateja) Date: Thu, 3 Mar 2022 05:46:07 GMT Subject: RFR: 8281375: Accelerate bitCount operation for AVX2 and AVX512 target. [v7] In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 17:08:51 GMT, Jatin Bhateja wrote: >> Summary of changes: >> >> - Patch extends existing vectorized bitCount optimization added with [JDK-8278868](https://bugs.openjdk.java.net/browse/JDK-8278868) and emits optimized JIT sequence for AVX2 and other AVX512 targets which do not support avx512_vpopcntdq feature. >> - Since PopCountVI/PopCountVL node emit different instruction sequence based on the target features hence a rudimentary cost mode has been added which influences the SLP unrolling factor to prevent generating bloated main loops. >> - Following are the performance results of an existing [JMH micro](https://github.com/jatin-bhateja/jdk/blob/master/test/micro/org/openjdk/bench/vm/compiler/VectorBitCount.java) over various X86 targets. >> >> >> Benchmark | SIZE | Baseline AVX2 (ns/op) | Withopt AVX2 (ns/op) | Gain % | Baseline AVX3 (ns/op) | Withopt AVX3 (ns/op) | Gain % | Baseline AVX3 (VPOPCOUNTDQ) | Withopt AVX3 (VPOCOUNTDQ) | Gain % >> -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- >> VectorBitCount.WithSuperword.intBitCount | 1024 | 1089.799 | 420.156 | 159.3796114 | 1083.92 | 203.958 | 431.442748 | 88.958 | 60.096 | 48.02649095 >> VectorBitCount.WithSuperword.longBitCount | 1024 | 417.458 | 413.859 | 0.869619846 | 417.203 | 214.949 | 94.09394787 | 105.954 | 117.019 | -9.455729411 >> >> Please review and share your feedback. >> >> Best Regards, >> Jatin > > Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: > > 8281375: Review comments resolved. Hi @sviswa7 , your comments have been addressed. ------------- PR: https://git.openjdk.java.net/jdk/pull/7373 From njian at openjdk.java.net Thu Mar 3 06:53:02 2022 From: njian at openjdk.java.net (Ningsheng Jian) Date: Thu, 3 Mar 2022 06:53:02 GMT Subject: RFR: 8280511: AArch64: Combine shift and negate to a single instruction In-Reply-To: References: Message-ID: On Tue, 15 Feb 2022 06:48:10 GMT, Fei Gao wrote: > Hi, > > In AArch64, > > asr x10, x1, #31 > neg x0, x10 > > can be optimized to: > `neg x0, x1, asr #31` > > To implement the instruction combining, we add matching rules in the backend. > > Thanks. Looks good to me. ------------- Marked as reviewed by njian (Committer). PR: https://git.openjdk.java.net/jdk/pull/7471 From chagedorn at openjdk.java.net Thu Mar 3 07:22:07 2022 From: chagedorn at openjdk.java.net (Christian Hagedorn) Date: Thu, 3 Mar 2022 07:22:07 GMT Subject: RFR: 8281122: [IR Framework] Cleanup IR matching code in preparation for JDK-8280378 In-Reply-To: References: Message-ID: On Fri, 18 Feb 2022 13:36:31 GMT, Christian Hagedorn wrote: > This patch does some restructurings and refactorings of the `IRMatcher.java` class in preparation for adding IR matching support on different compile phases with [JDK-8280378](https://bugs.openjdk.java.net/browse/JDK-8280378). There are no semantic changes of how IR matching is eventually done on regexes and how the results are checked with the `failOn` and `counts` constraints provided by the user. The only user-visible change is an improved output format of matching failures. > > The old format also did not report a `counts` constraint failure correctly. It wrongly used the format of `failOn` failures which was misleading. This is also fixed by this patch. > > **Example:** > > @Test > @IR(counts = {IRNode.STORE_F, "!= 1"}) // fails > @IR(counts = {IRNode.STORE_F, "2", IRNode.LOAD_F, "> 1"}) // both constraints fail > public void test1() { > fFld = 4.2f; > } > > @Test > @IR(failOn = IRNode.ALLOC, counts = {IRNode.STORE_F, ">= 2"}) // failOn and counts fail > public void test2() { > fFld = 4.2f; > o = new Object(); > } > > _Failure outputs:_ >
> Old format > > > Failed IR Rules (3) > ------------------ > - Method "public void ir_framework.tests.Testi.test1()": > * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", "!= 1"}, applyIfNot={})" > - counts: Graph contains wrong number of nodes: > Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > Expected 1 but found 1 node: > 25 StoreF === 5 7 24 21 [[ 16 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test1 @ bci:3 (line 48) > * @IR rule 2: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", "2", "(\\d+(\\s){2}(LoadF.*)+(\\s){2}===.*)", "> 1"}, applyIfNot={})" > - counts: Graph contains wrong number of nodes: > Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > Expected 2 but found 1 node: > 25 StoreF === 5 7 24 21 [[ 16 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test1 @ bci:3 (line 48) > Regex 2: (\d+(\s){2}(LoadF.*)+(\s){2}===.*) > Expected 1 but found 0 nodes. > > - Method "public void ir_framework.tests.Testi.test2()": > * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={"(.*precise .*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java)"}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", ">= 2"}, applyIfNot={})" > - failOn: Graph contains forbidden nodes: > Regex 1: (.*precise .*\R((.*(?i:mov|xorl|nop|spill).*|\s*|.*LGHI.*)\R)*.*(?i:call,static).*wrapper for: _new_instance_Java) > Matched forbidden node: > 1a5 movq RSI, precise java/lang/Object: 0x00007fb188007318:Constant:exact * # ptr > 1af call,static wrapper for: _new_instance_Java > - counts: Graph contains wrong number of nodes: > Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > Expected 2 but found 1 node: > 25 StoreF === 5 7 24 21 [[ 19 236 36 179 220 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test2 @ bci:3 (line 55) > >
>
> New format > > > Failed IR Rules (3) of Methods (2) > ---------------------------------- > 1) Method "public void ir_framework.tests.Testi.test1()" - [Failed IR rules: 2]: > * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", "!= 1"}, applyIfNot={})" > - counts: Graph contains wrong number of nodes: > * Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > - Failed comparison: [found] 1 != 1 [given] > - Matched node: > * 25 StoreF === 5 7 24 21 [[ 16 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test1 @ bci:3 (line 48) > * @IR rule 2: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", "2", "(\\d+(\\s){2}(LoadF.*)+(\\s){2}===.*)", "> 1"}, applyIfNot={})" > - counts: Graph contains wrong number of nodes: > * Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > - Failed comparison: [found] 1 = 2 [given] > - Matched node: > * 25 StoreF === 5 7 24 21 [[ 16 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test1 @ bci:3 (line 48) > * Regex 2: (\d+(\s){2}(LoadF.*)+(\s){2}===.*) > - Failed comparison: [found] 0 > 1 [given] > - No nodes matched! > > 2) Method "public void ir_framework.tests.Testi.test2()" - [Failed IR rules: 1]: > * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={"(.*precise .*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java)"}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", ">= 2"}, applyIfNot={})" > - failOn: Graph contains forbidden nodes: > * Regex 1: (.*precise .*\R((.*(?i:mov|xorl|nop|spill).*|\s*|.*LGHI.*)\R)*.*(?i:call,static).*wrapper for: _new_instance_Java) > - Matched forbidden node: > * 1a5 movq RSI, precise java/lang/Object: 0x00007fd3c4007318:Constant:exact * # ptr > 1af call,static wrapper for: _new_instance_Java > - counts: Graph contains wrong number of nodes: > * Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > - Failed comparison: [found] 1 >= 2 [given] > - Matched node: > * 25 StoreF === 5 7 24 21 [[ 19 236 36 179 220 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test2 @ bci:3 (line 55) > >
> > **New class structure:** > > The old `IRMatcher` class mixed different tasks such as parsing, IR annotation verification, IR matching and failure reporting together. This made it difficult to extend the existing code to add IR matching support on different compile phases. Therefore, the class was split to separate the different tasks: > - parser classes (`IREncodingParser`, `HotSpotPidFileParser`, `IRMethodParser` etc.) > - entity classes for the different parts of an `@IR` annotation (`IRMethod`, `IRRule`, `Counts`, `FailOn` etc.) > - match result classes for each entity class to provide a formatted failure message (`IRMethodMatchResult`, `IRRuleMatchResult` etc.) > > The main structure of the new classes will be kept in JDK-8280378 but will be further improved to match the new needs. > > **Testing:** > - Normal tier testing including tier5 and 6 where the IR framework tests are executed. > - Testing of this patch in Valhalla with tier1-3 + some Valhalla-specific stress testing > > > Thanks, > Christian Thanks Vladimir for your review! ------------- PR: https://git.openjdk.java.net/jdk/pull/7533 From chagedorn at openjdk.java.net Thu Mar 3 07:22:07 2022 From: chagedorn at openjdk.java.net (Christian Hagedorn) Date: Thu, 3 Mar 2022 07:22:07 GMT Subject: Integrated: 8281122: [IR Framework] Cleanup IR matching code in preparation for JDK-8280378 In-Reply-To: References: Message-ID: <0D573Z1Pc-VQ0oeFF5K4PGdrFQA1WhAqPvXPxeM7kpU=.01e2f5ac-90b5-4e43-93d0-625b6490f847@github.com> On Fri, 18 Feb 2022 13:36:31 GMT, Christian Hagedorn wrote: > This patch does some restructurings and refactorings of the `IRMatcher.java` class in preparation for adding IR matching support on different compile phases with [JDK-8280378](https://bugs.openjdk.java.net/browse/JDK-8280378). There are no semantic changes of how IR matching is eventually done on regexes and how the results are checked with the `failOn` and `counts` constraints provided by the user. The only user-visible change is an improved output format of matching failures. > > The old format also did not report a `counts` constraint failure correctly. It wrongly used the format of `failOn` failures which was misleading. This is also fixed by this patch. > > **Example:** > > @Test > @IR(counts = {IRNode.STORE_F, "!= 1"}) // fails > @IR(counts = {IRNode.STORE_F, "2", IRNode.LOAD_F, "> 1"}) // both constraints fail > public void test1() { > fFld = 4.2f; > } > > @Test > @IR(failOn = IRNode.ALLOC, counts = {IRNode.STORE_F, ">= 2"}) // failOn and counts fail > public void test2() { > fFld = 4.2f; > o = new Object(); > } > > _Failure outputs:_ >
> Old format > > > Failed IR Rules (3) > ------------------ > - Method "public void ir_framework.tests.Testi.test1()": > * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", "!= 1"}, applyIfNot={})" > - counts: Graph contains wrong number of nodes: > Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > Expected 1 but found 1 node: > 25 StoreF === 5 7 24 21 [[ 16 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test1 @ bci:3 (line 48) > * @IR rule 2: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", "2", "(\\d+(\\s){2}(LoadF.*)+(\\s){2}===.*)", "> 1"}, applyIfNot={})" > - counts: Graph contains wrong number of nodes: > Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > Expected 2 but found 1 node: > 25 StoreF === 5 7 24 21 [[ 16 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test1 @ bci:3 (line 48) > Regex 2: (\d+(\s){2}(LoadF.*)+(\s){2}===.*) > Expected 1 but found 0 nodes. > > - Method "public void ir_framework.tests.Testi.test2()": > * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={"(.*precise .*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java)"}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", ">= 2"}, applyIfNot={})" > - failOn: Graph contains forbidden nodes: > Regex 1: (.*precise .*\R((.*(?i:mov|xorl|nop|spill).*|\s*|.*LGHI.*)\R)*.*(?i:call,static).*wrapper for: _new_instance_Java) > Matched forbidden node: > 1a5 movq RSI, precise java/lang/Object: 0x00007fb188007318:Constant:exact * # ptr > 1af call,static wrapper for: _new_instance_Java > - counts: Graph contains wrong number of nodes: > Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > Expected 2 but found 1 node: > 25 StoreF === 5 7 24 21 [[ 19 236 36 179 220 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test2 @ bci:3 (line 55) > >
>
> New format > > > Failed IR Rules (3) of Methods (2) > ---------------------------------- > 1) Method "public void ir_framework.tests.Testi.test1()" - [Failed IR rules: 2]: > * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", "!= 1"}, applyIfNot={})" > - counts: Graph contains wrong number of nodes: > * Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > - Failed comparison: [found] 1 != 1 [given] > - Matched node: > * 25 StoreF === 5 7 24 21 [[ 16 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test1 @ bci:3 (line 48) > * @IR rule 2: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", "2", "(\\d+(\\s){2}(LoadF.*)+(\\s){2}===.*)", "> 1"}, applyIfNot={})" > - counts: Graph contains wrong number of nodes: > * Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > - Failed comparison: [found] 1 = 2 [given] > - Matched node: > * 25 StoreF === 5 7 24 21 [[ 16 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test1 @ bci:3 (line 48) > * Regex 2: (\d+(\s){2}(LoadF.*)+(\s){2}===.*) > - Failed comparison: [found] 0 > 1 [given] > - No nodes matched! > > 2) Method "public void ir_framework.tests.Testi.test2()" - [Failed IR rules: 1]: > * @IR rule 1: "@compiler.lib.ir_framework.IR(applyIf={}, applyIfAnd={}, failOn={"(.*precise .*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java)"}, applyIfOr={}, counts={"(\\d+(\\s){2}(StoreF.*)+(\\s){2}===.*)", ">= 2"}, applyIfNot={})" > - failOn: Graph contains forbidden nodes: > * Regex 1: (.*precise .*\R((.*(?i:mov|xorl|nop|spill).*|\s*|.*LGHI.*)\R)*.*(?i:call,static).*wrapper for: _new_instance_Java) > - Matched forbidden node: > * 1a5 movq RSI, precise java/lang/Object: 0x00007fd3c4007318:Constant:exact * # ptr > 1af call,static wrapper for: _new_instance_Java > - counts: Graph contains wrong number of nodes: > * Regex 1: (\d+(\s){2}(StoreF.*)+(\s){2}===.*) > - Failed comparison: [found] 1 >= 2 [given] > - Matched node: > * 25 StoreF === 5 7 24 21 [[ 19 236 36 179 220 ]] @ir_framework/tests/Testi+12 *, name=fFld, idx=4; Memory: @ir_framework/tests/Testi:NotNull+12 *, name=fFld, idx=4; !jvms: Testi::test2 @ bci:3 (line 55) > >
> > **New class structure:** > > The old `IRMatcher` class mixed different tasks such as parsing, IR annotation verification, IR matching and failure reporting together. This made it difficult to extend the existing code to add IR matching support on different compile phases. Therefore, the class was split to separate the different tasks: > - parser classes (`IREncodingParser`, `HotSpotPidFileParser`, `IRMethodParser` etc.) > - entity classes for the different parts of an `@IR` annotation (`IRMethod`, `IRRule`, `Counts`, `FailOn` etc.) > - match result classes for each entity class to provide a formatted failure message (`IRMethodMatchResult`, `IRRuleMatchResult` etc.) > > The main structure of the new classes will be kept in JDK-8280378 but will be further improved to match the new needs. > > **Testing:** > - Normal tier testing including tier5 and 6 where the IR framework tests are executed. > - Testing of this patch in Valhalla with tier1-3 + some Valhalla-specific stress testing > > > Thanks, > Christian This pull request has now been integrated. Changeset: 2da67779 Author: Christian Hagedorn URL: https://git.openjdk.java.net/jdk/commit/2da677793f562236d473afe12b5c941f25f41377 Stats: 3592 lines in 57 files changed: 2756 ins; 769 del; 67 mod 8281122: [IR Framework] Cleanup IR matching code in preparation for JDK-8280378 Reviewed-by: thartmann, kvn ------------- PR: https://git.openjdk.java.net/jdk/pull/7533 From duke at openjdk.java.net Thu Mar 3 07:56:08 2022 From: duke at openjdk.java.net (Tobias Holenstein) Date: Thu, 3 Mar 2022 07:56:08 GMT Subject: RFR: 8277055: Assert "missing inlining msg" with -XX:+PrintIntrinsics [v2] In-Reply-To: <74tdeSabkBWUN8o7TbaTAvPMlWsze-e9T9AavG0X3rQ=.13d080af-adb6-4bbd-b076-677807ce36a2@github.com> References: <4O-VnRkcKYv4jHhr1XXsDudUMnhEebv-_ocX0stgqqE=.2f9d8be0-2105-4de0-bbca-ba06936e121e@github.com> <74tdeSabkBWUN8o7TbaTAvPMlWsze-e9T9AavG0X3rQ=.13d080af-adb6-4bbd-b076-677807ce36a2@github.com> Message-ID: On Tue, 1 Mar 2022 14:07:50 GMT, Tobias Hartmann wrote: >> Tobias Holenstein has updated the pull request incrementally with one additional commit since the last revision: >> >> more detailed message > > Looks good to me too. Thanks for updating the inlining message to include the reason. Thanks @TobiHartmann and @rwestrel for the review! ------------- PR: https://git.openjdk.java.net/jdk/pull/7385 From duke at openjdk.java.net Thu Mar 3 08:03:08 2022 From: duke at openjdk.java.net (Tobias Holenstein) Date: Thu, 3 Mar 2022 08:03:08 GMT Subject: Integrated: 8277055: Assert "missing inlining msg" with -XX:+PrintIntrinsics In-Reply-To: <4O-VnRkcKYv4jHhr1XXsDudUMnhEebv-_ocX0stgqqE=.2f9d8be0-2105-4de0-bbca-ba06936e121e@github.com> References: <4O-VnRkcKYv4jHhr1XXsDudUMnhEebv-_ocX0stgqqE=.2f9d8be0-2105-4de0-bbca-ba06936e121e@github.com> Message-ID: <2RepQKTaOE5NC0_JL6k-0ywPyCdgop3Ysc1PtNRgl1M=.eeeebf00-d8e5-45fd-adfb-f19d12f60da1@github.com> On Tue, 8 Feb 2022 16:57:20 GMT, Tobias Holenstein wrote: > in `CallGenerator::do_late_inline_helper()` we hit an assert `"missing inlining msg"` when calling `C->print_inlining_update_delayed(this)`. The reason is that not all implementations of do_late_inline_check() print an inline message. The fix is to add an inline message for the two `return false` in `LateInlineVirtualCallGenerator::do_late_inline_check(...)` where we do not print an inline message. > > Tier1-3 passed This pull request has now been integrated. Changeset: b1f935c1 Author: Tobias Holenstein Committer: Tobias Hartmann URL: https://git.openjdk.java.net/jdk/commit/b1f935c1d0d3729470b57832cf74c43d49ea1f71 Stats: 14 lines in 2 files changed: 11 ins; 0 del; 3 mod 8277055: Assert "missing inlining msg" with -XX:+PrintIntrinsics Reviewed-by: roland, thartmann ------------- PR: https://git.openjdk.java.net/jdk/pull/7385 From xgong at openjdk.java.net Thu Mar 3 08:12:46 2022 From: xgong at openjdk.java.net (Xiaohong Gong) Date: Thu, 3 Mar 2022 08:12:46 GMT Subject: RFR: 8282432: Optimize masked "test" Vector API with predicate feature [v2] In-Reply-To: References: Message-ID: > The vector `"test"` api is implemented with vector `"compare"`. And the masked `"test" `is implemented with `"test(op).and(m)"` which means `"compare().and(m)"` finally. Since the masked vector `"compare"` has been optimized with predicated instruction for archituctures that support the feature, the masked `"test"` can also be optimized by implementing it with the predicated compare. This could save the additional ` "and"` for architectures that support the predicate feature. > > This patch optimized the masked `"test"` by implementing it with masked `"compare"`. With this patch, the following codes for the` "IS_NEGATIVE"` op for a DoubleVector with SVE: > > mov z19.d, #0 > cmpgt p1.d, p7/z, z19.d, z17.d > and p0.b, p7/z, p1.b, p0.b > > are optimized to: > > mov z19.d, #0 > cmpgt p0.d, p0/z, z19.d, z17.d > > Also update the jtreg tests for masked` "test" ` to make sure they are hot enough to be compiled by c2. Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision: Simply the testTemplate ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7654/files - new: https://git.openjdk.java.net/jdk/pull/7654/files/41a9d56f..c90d2f49 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7654&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7654&range=00-01 Stats: 197 lines in 49 files changed: 13 ins; 33 del; 151 mod Patch: https://git.openjdk.java.net/jdk/pull/7654.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7654/head:pull/7654 PR: https://git.openjdk.java.net/jdk/pull/7654 From xgong at openjdk.java.net Thu Mar 3 08:12:48 2022 From: xgong at openjdk.java.net (Xiaohong Gong) Date: Thu, 3 Mar 2022 08:12:48 GMT Subject: RFR: 8282432: Optimize masked "test" Vector API with predicate feature In-Reply-To: References: Message-ID: On Wed, 2 Mar 2022 02:50:27 GMT, Xiaohong Gong wrote: > The vector `"test"` api is implemented with vector `"compare"`. And the masked `"test" `is implemented with `"test(op).and(m)"` which means `"compare().and(m)"` finally. Since the masked vector `"compare"` has been optimized with predicated instruction for archituctures that support the feature, the masked `"test"` can also be optimized by implementing it with the predicated compare. This could save the additional ` "and"` for architectures that support the predicate feature. > > This patch optimized the masked `"test"` by implementing it with masked `"compare"`. With this patch, the following codes for the` "IS_NEGATIVE"` op for a DoubleVector with SVE: > > mov z19.d, #0 > cmpgt p1.d, p7/z, z19.d, z17.d > and p0.b, p7/z, p1.b, p0.b > > are optimized to: > > mov z19.d, #0 > cmpgt p0.d, p0/z, z19.d, z17.d > > Also update the jtreg tests for masked` "test" ` to make sure they are hot enough to be compiled by c2. Hi @PaulSandoz , thanks for your review! All the comments have been address. Could you please take a look at it again? Thanks! ------------- PR: https://git.openjdk.java.net/jdk/pull/7654 From roland at openjdk.java.net Thu Mar 3 09:06:43 2022 From: roland at openjdk.java.net (Roland Westrelin) Date: Thu, 3 Mar 2022 09:06:43 GMT Subject: RFR: 8278296: Generalize long range check transformation [v7] In-Reply-To: References: Message-ID: <5rM8EWPO7RSeKXP1aOtDVtYJv1w5GYGv7mj5AR3A6OA=.f9cb94a8-2894-4e59-a0af-4b5ea72f01e8@github.com> > 8259609 (C2: optimize long range checks in long counted loops) only > covered the case of a counted loop with a positive stride and a range > check with a positive scale. This change generalizes the long range > check transformation to all 4 combinations of stride and scale signs. > > The stride > 0, scale > 0 case (covered 8259609) was tweaked so it now > uses Qmax computed as the inclusive limit of j*K+Q. That helps in > generalizing the formulas to other cases. > > The addition of PhaseIdealLoop::is_scaled_iv_plus_extra_offset() was > required for the case of negative scale in an int loop. The range > check then has the shape: > > (CmpUL (AddL (ConvI2L (SubI ConI (LshiftI (Phi > > with ConI, the zero constant. > > This change also addresses this comment from John: > > https://github.com/openjdk/jdk/pull/6576#discussion_r765343664 > > as part of 8276116 (C2: optimize long range checks in int counted loops) Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision: build fix ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/6989/files - new: https://git.openjdk.java.net/jdk/pull/6989/files/6a2ae123..a25701a5 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6989&range=06 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6989&range=05-06 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/6989.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/6989/head:pull/6989 PR: https://git.openjdk.java.net/jdk/pull/6989 From duke at openjdk.java.net Thu Mar 3 11:34:21 2022 From: duke at openjdk.java.net (Emanuel Peter) Date: Thu, 3 Mar 2022 11:34:21 GMT Subject: RFR: 8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) Message-ID: There are two functions that check for equality. void ck(long x, long y): already throws a RuntimeException if we observe inequality void ck(double x, double y): called itself, leading to endless recursion and a StackOverflowError. Instead of the recursion, I now also throw a RuntimeException. This can currently be triggered with `path-to-jtreg/jtreg -va -s -jdk:jdk-path -javaoptions:"-XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressGCM -XX:+OptoScheduling -XX:StressSeed=293843391" test/hotspot/jtreg/compiler/intrinsics/unsafe/HeapByteBufferTest.java ` (see bug [JDK-8282555](https://bugs.openjdk.java.net/browse/JDK-8282555)) This way I could verify that instead of StackOverflowError we now get RuntimeException, as desired. Ran some basic tests to ensure I didn't break things. ------------- Commit messages: - missed a line - 8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) Changes: https://git.openjdk.java.net/jdk/pull/7674/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7674&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8282573 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/7674.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7674/head:pull/7674 PR: https://git.openjdk.java.net/jdk/pull/7674 From thartmann at openjdk.java.net Thu Mar 3 14:29:59 2022 From: thartmann at openjdk.java.net (Tobias Hartmann) Date: Thu, 3 Mar 2022 14:29:59 GMT Subject: RFR: 8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) In-Reply-To: References: Message-ID: On Thu, 3 Mar 2022 11:24:04 GMT, Emanuel Peter wrote: > There are two functions that check for equality. > void ck(long x, long y): already throws a RuntimeException if we observe inequality > void ck(double x, double y): called itself, leading to endless recursion and a StackOverflowError. > > Instead of the recursion, I now also throw a RuntimeException. > > This can currently be triggered with > `path-to-jtreg/jtreg -va -s -jdk:jdk-path -javaoptions:"-XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressGCM -XX:+OptoScheduling -XX:StressSeed=293843391" test/hotspot/jtreg/compiler/intrinsics/unsafe/HeapByteBufferTest.java ` > (see bug [JDK-8282555](https://bugs.openjdk.java.net/browse/JDK-8282555)) > > This way I could verify that instead of StackOverflowError we now get RuntimeException, as desired. > Ran some basic tests to ensure I didn't break things. test/hotspot/jtreg/compiler/intrinsics/unsafe/ByteBufferTest.java line 219: > 217: > 218: void ck(double x, double y) { > 219: if (x == x && y == y && x != y) { What are the `x == x` and `y == y` checks good for? ------------- PR: https://git.openjdk.java.net/jdk/pull/7674 From duke at openjdk.java.net Thu Mar 3 16:26:41 2022 From: duke at openjdk.java.net (Emanuel Peter) Date: Thu, 3 Mar 2022 16:26:41 GMT Subject: RFR: 8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) [v2] In-Reply-To: References: Message-ID: > There are two functions that check for equality. > void ck(long x, long y): already throws a RuntimeException if we observe inequality > void ck(double x, double y): called itself, leading to endless recursion and a StackOverflowError. > > Instead of the recursion, I now also throw a RuntimeException. > > This can currently be triggered with > `path-to-jtreg/jtreg -va -s -jdk:jdk-path -javaoptions:"-XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressGCM -XX:+OptoScheduling -XX:StressSeed=293843391" test/hotspot/jtreg/compiler/intrinsics/unsafe/HeapByteBufferTest.java ` > (see bug [JDK-8282555](https://bugs.openjdk.java.net/browse/JDK-8282555)) > > This way I could verify that instead of StackOverflowError we now get RuntimeException, as desired. > Ran some basic tests to ensure I didn't break things. Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: removed unnecessary conditions ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7674/files - new: https://git.openjdk.java.net/jdk/pull/7674/files/4eca7cf8..17ad7a21 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7674&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7674&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/7674.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7674/head:pull/7674 PR: https://git.openjdk.java.net/jdk/pull/7674 From duke at openjdk.java.net Thu Mar 3 16:38:59 2022 From: duke at openjdk.java.net (Emanuel Peter) Date: Thu, 3 Mar 2022 16:38:59 GMT Subject: RFR: 8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) [v2] In-Reply-To: References: Message-ID: On Thu, 3 Mar 2022 14:26:41 GMT, Tobias Hartmann wrote: >> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: >> >> removed unnecessary conditions > > test/hotspot/jtreg/compiler/intrinsics/unsafe/ByteBufferTest.java line 219: > >> 217: >> 218: void ck(double x, double y) { >> 219: if (x == x && y == y && x != y) { > > What are the `x == x` and `y == y` checks good for? I removed it. @PaulSandoz agreed that this method was very suspect. I should try removing it. There is an off chance it could create some NaN issues on odd platforms. ------------- PR: https://git.openjdk.java.net/jdk/pull/7674 From psandoz at openjdk.java.net Thu Mar 3 17:43:06 2022 From: psandoz at openjdk.java.net (Paul Sandoz) Date: Thu, 3 Mar 2022 17:43:06 GMT Subject: RFR: 8282432: Optimize masked "test" Vector API with predicate feature [v2] In-Reply-To: References: Message-ID: On Thu, 3 Mar 2022 08:12:46 GMT, Xiaohong Gong wrote: >> The vector `"test"` api is implemented with vector `"compare"`. And the masked `"test" `is implemented with `"test(op).and(m)"` which means `"compare().and(m)"` finally. Since the masked vector `"compare"` has been optimized with predicated instruction for archituctures that support the feature, the masked `"test"` can also be optimized by implementing it with the predicated compare. This could save the additional ` "and"` for architectures that support the predicate feature. >> >> This patch optimized the masked `"test"` by implementing it with masked `"compare"`. With this patch, the following codes for the` "IS_NEGATIVE"` op for a DoubleVector with SVE: >> >> mov z19.d, #0 >> cmpgt p1.d, p7/z, z19.d, z17.d >> and p0.b, p7/z, p1.b, p0.b >> >> are optimized to: >> >> mov z19.d, #0 >> cmpgt p0.d, p0/z, z19.d, z17.d >> >> Also update the jtreg tests for masked` "test" ` to make sure they are hot enough to be compiled by c2. > > Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision: > > Simply the testTemplate I guess the following: `mask.cast(IntVector.species(shape())` is more efficient than: `m.cast(vspecies().asIntegral()))` ? ------------- Marked as reviewed by psandoz (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7654 From psandoz at openjdk.java.net Thu Mar 3 17:58:04 2022 From: psandoz at openjdk.java.net (Paul Sandoz) Date: Thu, 3 Mar 2022 17:58:04 GMT Subject: RFR: 8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) [v2] In-Reply-To: References: Message-ID: On Thu, 3 Mar 2022 16:26:41 GMT, Emanuel Peter wrote: >> There are two functions that check for equality. >> void ck(long x, long y): already throws a RuntimeException if we observe inequality >> void ck(double x, double y): called itself, leading to endless recursion and a StackOverflowError. >> >> Instead of the recursion, I now also throw a RuntimeException. >> >> This can currently be triggered with >> `path-to-jtreg/jtreg -va -s -jdk:jdk-path -javaoptions:"-XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressGCM -XX:+OptoScheduling -XX:StressSeed=293843391" test/hotspot/jtreg/compiler/intrinsics/unsafe/HeapByteBufferTest.java ` >> (see bug [JDK-8282555](https://bugs.openjdk.java.net/browse/JDK-8282555)) >> >> This way I could verify that instead of StackOverflowError we now get RuntimeException, as desired. >> Ran some basic tests to ensure I didn't break things. > > Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: > > removed unnecessary conditions Marked as reviewed by psandoz (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/7674 From sviswanathan at openjdk.java.net Fri Mar 4 00:17:09 2022 From: sviswanathan at openjdk.java.net (Sandhya Viswanathan) Date: Fri, 4 Mar 2022 00:17:09 GMT Subject: RFR: 8281375: Accelerate bitCount operation for AVX2 and AVX512 target. [v7] In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 17:08:51 GMT, Jatin Bhateja wrote: >> Summary of changes: >> >> - Patch extends existing vectorized bitCount optimization added with [JDK-8278868](https://bugs.openjdk.java.net/browse/JDK-8278868) and emits optimized JIT sequence for AVX2 and other AVX512 targets which do not support avx512_vpopcntdq feature. >> - Since PopCountVI/PopCountVL node emit different instruction sequence based on the target features hence a rudimentary cost mode has been added which influences the SLP unrolling factor to prevent generating bloated main loops. >> - Following are the performance results of an existing [JMH micro](https://github.com/jatin-bhateja/jdk/blob/master/test/micro/org/openjdk/bench/vm/compiler/VectorBitCount.java) over various X86 targets. >> >> >> Benchmark | SIZE | Baseline AVX2 (ns/op) | Withopt AVX2 (ns/op) | Gain % | Baseline AVX3 (ns/op) | Withopt AVX3 (ns/op) | Gain % | Baseline AVX3 (VPOPCOUNTDQ) | Withopt AVX3 (VPOCOUNTDQ) | Gain % >> -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- >> VectorBitCount.WithSuperword.intBitCount | 1024 | 1089.799 | 420.156 | 159.3796114 | 1083.92 | 203.958 | 431.442748 | 88.958 | 60.096 | 48.02649095 >> VectorBitCount.WithSuperword.longBitCount | 1024 | 417.458 | 413.859 | 0.869619846 | 417.203 | 214.949 | 94.09394787 | 105.954 | 117.019 | -9.455729411 >> >> Please review and share your feedback. >> >> Best Regards, >> Jatin > > Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: > > 8281375: Review comments resolved. src/hotspot/cpu/x86/assembler_x86.cpp line 8329: > 8327: void Assembler::vpunpckhdq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { > 8328: assert(UseAVX > 0, "requires some form of AVX"); > 8329: InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); legacy_mode should be false here. src/hotspot/cpu/x86/assembler_x86.cpp line 8336: > 8334: void Assembler::vpunpckldq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { > 8335: assert(UseAVX > 0, "requires some form of AVX"); > 8336: InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); legacy_mode should be false here. src/hotspot/cpu/x86/assembler_x86.cpp line 8341: > 8339: } > 8340: > 8341: // xmm/mem sourced byte/word/dword/qword replicate The comment seems to be misplaced. src/hotspot/cpu/x86/assembler_x86.cpp line 8342: > 8340: > 8341: // xmm/mem sourced byte/word/dword/qword replicate > 8342: void Assembler::evpsadbw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { There is no masked version of evpsadbw documented which takes any k registers in the manual so we should be able to use the vpsadbw() defined before and remove evpsadbw()? src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 4360: > 4358: vpopcntd(dst, src, vec_enc); > 4359: } else if (vec_enc == Assembler::AVX_512bit) { > 4360: assert(VM_Version::supports_avx512vlbw(), ""); I think check for supports_avx512bw() is enough here. Do we need vl? src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 4374: > 4372: evpsadbw(dst, k0, dst, xtmp1, true, vec_enc); > 4373: evpunpckldq(xtmp2, k0, xtmp3, xtmp1, true, vec_enc); > 4374: evpsadbw(xtmp2, k0, xtmp2, xtmp1, true, vec_enc); The merge masking can be set to false for the entire algorithm, because k is always all set and no merging at all needed. src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 4393: > 4391: vpunpckldq(xtmp2, xtmp3, xtmp1, vec_enc); > 4392: vpsadbw(xtmp2, xtmp2, xtmp1, vec_enc); > 4393: vpackuswb(dst, xtmp2, dst, vec_enc); This code is common with the 512 bit version, vec_enc decides the proper encoding, could be merged together. This also then removes the need for adding the evpunpck* instructions. K0 mask is implicit. src/hotspot/cpu/x86/x86.ad line 1870: > 1868: case Op_PopCountVI: > 1869: if (!VM_Version::supports_avx512_vpopcntdq() && > 1870: (vlen == 16) && !VM_Version::supports_avx512vlbw()) { For vlen==16, check for only avx512bw() is needed. src/hotspot/cpu/x86/x86.ad line 1876: > 1874: case Op_PopCountVL: > 1875: if (!VM_Version::supports_avx512_vpopcntdq() && > 1876: ((vlen <= 4) || ((vlen == 8) && !VM_Version::supports_avx512vlbw()))) { In case of long vlen==8, check for only avx512bw() is needed. ------------- PR: https://git.openjdk.java.net/jdk/pull/7373 From sviswanathan at openjdk.java.net Fri Mar 4 00:17:09 2022 From: sviswanathan at openjdk.java.net (Sandhya Viswanathan) Date: Fri, 4 Mar 2022 00:17:09 GMT Subject: RFR: 8281375: Accelerate bitCount operation for AVX2 and AVX512 target. [v6] In-Reply-To: References: Message-ID: On Wed, 2 Mar 2022 05:02:02 GMT, Jatin Bhateja wrote: >> The problem is at 512 bit level. > > original 512 bit vector holding 16 integers = [ a15 a14 a13 a12, a11 a10 a9 a8 ,a7 a6 a5 a4 ,a3 a2 a1 a0 ] > unpackdq lower: > 512 bit (vec1) > 128 128 128 128 > 0 a13 0 a12 0 a9 0 a8 0 a5 0 a4 0 a1 0 a0 > unpackdq higher: > 512 bit (vec1) > 128 128 128 128 > 0 a15 0 a14 0 a11 0 a10 0 a7 0 a6 0 a3 0 a2 > Next sum of absolute difference operation followed by pack will squeez each 128 bit lane of two participant vectors > and interleave them in resulatant vector. > VEC1_L3 VEC1_L2 VEC1_L1 VEC1_L0 VEC2_L3 VEC2_L2 VEC2_L1 VEC2_L0 > [ 0 sa13 0 sa12 0 sa9 0 sa8 0 sa5 0 sa4 0 sa1 0 sa0 ] [ 0 sa15 0 sa14 0 sa11 0 sa10 0 sa7 0 sa6 0 sa3 0 sa2 ] > [ sa15 sa14 sa13 sa12 sa11 sa10 sa9 sa8 sa7 sa6 sa5 sa4 sa3 sa2 sa1 sa0] Thanks for the clarification this looks good for 512 bit, I missed the reordering done by punpck. ------------- PR: https://git.openjdk.java.net/jdk/pull/7373 From dlong at openjdk.java.net Fri Mar 4 03:07:01 2022 From: dlong at openjdk.java.net (Dean Long) Date: Fri, 4 Mar 2022 03:07:01 GMT Subject: RFR: 8279886: C1: Turn off SelectivePhiFunctions in presence of irreducible loops [v2] In-Reply-To: References: <9hUbaevqiNT2GmsBxLbGYHYFmSMeDZZDaBkUpuJFBHk=.b7da7542-844d-4d8c-8f61-ee0eca5a3500@github.com> Message-ID: On Tue, 1 Mar 2022 15:50:24 GMT, Igor Veresov wrote: >> This change add irreducible loops detection to `BlockListBuilder::mark_loops()` - a loop marking routine necessary for the SSA conversion. Here is brief description of the algorithm (copy-pasted from the comments I left in the code). >> >> The loop detection algorithm works as follows: >> >> - We maintain the `_loop_map`, where for each block we have a bitmap indicating which loops contain this block. >> - The CFG is recursively traversed (depth-first) and if we detect a loop, we assign the loop a unique number that is stored in the bitmap associated with the loop header block. Until we return back through that loop header the bitmap contains only a single bit corresponding to the loop number. >> - The bit is then propagated for all the blocks in the loop after we exit them (post-order). There could be multiple bits of course in case of nested loops. >> - When we exit the loop header we remove that single bit and assign the real loop state for it. >> - Now, the tricky part here is how we detect irriducible loops. In the algorithm above the loop state bits are propagated to the predecessors. If we encounter an irreducible loop (a loop with multiple heads) we would see a node with some loop bit set that would then propagate back and be never cleared because we would never go back through the original loop header. Therefore if there are any irreducible loops the bits in the states for these loops are going to propagate back to the root. >> >> Testing is clean: hs-tier{1-7} > > Igor Veresov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits: > > - Add comments > - Detect irreducible loops during parsing/phi insertion. Very nice! ------------- Marked as reviewed by dlong (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7636 From yyang at openjdk.java.net Fri Mar 4 03:20:15 2022 From: yyang at openjdk.java.net (Yi Yang) Date: Fri, 4 Mar 2022 03:20:15 GMT Subject: RFR: 8282638: [JVMCI] Export array fill stubs to JVMCI compiler Message-ID: Export array _jint_fill,_jshort_fill,jbyte_fill,_arrayof_jshort_fill,_arrayof_jbyte_fill,_arrayof_jint_fill to JVMCI compiler ------------- Commit messages: - 8282638: [JVMCI] Export array fill stubs to JVMCI compiler Changes: https://git.openjdk.java.net/jdk/pull/7685/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7685&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8282638 Stats: 7 lines in 1 file changed: 7 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/7685.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7685/head:pull/7685 PR: https://git.openjdk.java.net/jdk/pull/7685 From iveresov at openjdk.java.net Fri Mar 4 03:53:09 2022 From: iveresov at openjdk.java.net (Igor Veresov) Date: Fri, 4 Mar 2022 03:53:09 GMT Subject: RFR: 8279886: C1: Turn off SelectivePhiFunctions in presence of irreducible loops [v2] In-Reply-To: References: <9hUbaevqiNT2GmsBxLbGYHYFmSMeDZZDaBkUpuJFBHk=.b7da7542-844d-4d8c-8f61-ee0eca5a3500@github.com> Message-ID: On Tue, 1 Mar 2022 21:07:01 GMT, Vladimir Kozlov wrote: >> Igor Veresov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits: >> >> - Add comments >> - Detect irreducible loops during parsing/phi insertion. > > Looks good. Thanks @vnkozlov and @dean-long for the reviews! ------------- PR: https://git.openjdk.java.net/jdk/pull/7636 From iveresov at openjdk.java.net Fri Mar 4 03:53:09 2022 From: iveresov at openjdk.java.net (Igor Veresov) Date: Fri, 4 Mar 2022 03:53:09 GMT Subject: Integrated: 8279886: C1: Turn off SelectivePhiFunctions in presence of irreducible loops In-Reply-To: <9hUbaevqiNT2GmsBxLbGYHYFmSMeDZZDaBkUpuJFBHk=.b7da7542-844d-4d8c-8f61-ee0eca5a3500@github.com> References: <9hUbaevqiNT2GmsBxLbGYHYFmSMeDZZDaBkUpuJFBHk=.b7da7542-844d-4d8c-8f61-ee0eca5a3500@github.com> Message-ID: On Mon, 28 Feb 2022 20:46:26 GMT, Igor Veresov wrote: > This change add irreducible loops detection to `BlockListBuilder::mark_loops()` - a loop marking routine necessary for the SSA conversion. Here is brief description of the algorithm (copy-pasted from the comments I left in the code). > > The loop detection algorithm works as follows: > > - We maintain the `_loop_map`, where for each block we have a bitmap indicating which loops contain this block. > - The CFG is recursively traversed (depth-first) and if we detect a loop, we assign the loop a unique number that is stored in the bitmap associated with the loop header block. Until we return back through that loop header the bitmap contains only a single bit corresponding to the loop number. > - The bit is then propagated for all the blocks in the loop after we exit them (post-order). There could be multiple bits of course in case of nested loops. > - When we exit the loop header we remove that single bit and assign the real loop state for it. > - Now, the tricky part here is how we detect irriducible loops. In the algorithm above the loop state bits are propagated to the predecessors. If we encounter an irreducible loop (a loop with multiple heads) we would see a node with some loop bit set that would then propagate back and be never cleared because we would never go back through the original loop header. Therefore if there are any irreducible loops the bits in the states for these loops are going to propagate back to the root. > > Testing is clean: hs-tier{1-7} This pull request has now been integrated. Changeset: b629782b Author: Igor Veresov URL: https://git.openjdk.java.net/jdk/commit/b629782b8d44e8aa8a99c6a3381663a6169aa1ad Stats: 63 lines in 5 files changed: 27 ins; 7 del; 29 mod 8279886: C1: Turn off SelectivePhiFunctions in presence of irreducible loops Reviewed-by: kvn, dlong ------------- PR: https://git.openjdk.java.net/jdk/pull/7636 From jiefu at openjdk.java.net Fri Mar 4 05:09:08 2022 From: jiefu at openjdk.java.net (Jie Fu) Date: Fri, 4 Mar 2022 05:09:08 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v6] In-Reply-To: <2OyaRp6UdLYtDJSJQash1i6Nfo4jriWELQA30ITrwIY=.ab68593c-de96-493f-a215-0be40cb69a36@github.com> References: <2OyaRp6UdLYtDJSJQash1i6Nfo4jriWELQA30ITrwIY=.ab68593c-de96-493f-a215-0be40cb69a36@github.com> Message-ID: On Mon, 28 Feb 2022 23:42:13 GMT, Quan Anh Mai wrote: >> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: >> >> reviews > > The tool measures the throughput of the operations, which is the number of cycles per iteration. Because the processor can execute multiple instructions at the same time, to measure the latency, you should create a dependency chain between the output of the instruction and its input in the next iteration. The technique used by uops.info is to `movsx` (which is an instruction that is not elided) from the output operand back to the input operand, so that the processor must wait for the result of the previous iteration before executing the next one, instead of executing multiple iterations concurrently when there is a lack of dependencies. > > A simple `lea rax, [rbp + rcx + 0x8]; movsx rbp, eax` gives the throughput of 4 cycles, minus the latency of the `movsx` which is 1 gives you the documented latency of 3 (this is the latency between the output and the base operand, similar experiment will give the same answer for the latency between the output and the index operand). > > Thanks. Hi @merykitty , Thanks for your update. Instead of removing `leaI_rReg_immI`, I would suggest enabling it. I tried to match it based on your latest patch like this and saw about 2% perf improvement of B_D_int. diff --git a/src/hotspot/cpu/x86/x86_64.ad b/src/hotspot/cpu/x86/x86_64.ad index f86dbbb..45f4730 100644 --- a/src/hotspot/cpu/x86/x86_64.ad +++ b/src/hotspot/cpu/x86/x86_64.ad @@ -7388,6 +7388,19 @@ instruct addI_rReg(rRegI dst, rRegI src, rFlagsReg cr) ins_pipe(ialu_reg_reg); %} +instruct leaI_rReg_immI(rRegI dst, no_rbp_r13_RegI base, immI disp) +%{ + predicate(VM_Version::supports_fast_2op_lea()); + match(Set dst (AddI base disp)); + + ins_cost(110); + format %{ "addr32 leal $dst, [$base + $disp]\t# int" %} + ins_encode %{ + __ leal($dst$$Register, Address($base$$Register, $disp$$constant)); + %} + ins_pipe(ialu_reg_reg); +%} + instruct addI_rReg_imm(rRegI dst, immI src, rFlagsReg cr) %{ match(Set dst (AddI dst src)); diff --git a/test/micro/org/openjdk/bench/vm/compiler/LeaInstruction.java b/test/micro/org/openjdk/bench/vm/compiler/LeaInstruction.java index 02b10d7..335c032 100644 --- a/test/micro/org/openjdk/bench/vm/compiler/LeaInstruction.java +++ b/test/micro/org/openjdk/bench/vm/compiler/LeaInstruction.java @@ -46,6 +46,17 @@ public class LeaInstruction { } @Benchmark + public void B_D_int(Blackhole bh) { + int x = this.x, y = this.y; + for (int i = 0; i < ITERATION; i++) { + x = x + 10; + y = y + 20; + bh.consume(x); + bh.consume(y); + } + } + + @Benchmark public void B_I_D_int(Blackhole bh) { int x = this.x, y = this.y; for (int i = 0; i < ITERATION; i++) { There are also `leaL_rReg_immL` and `leaP_rReg_imm` to be enabled. What do you think? ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From duke at openjdk.java.net Fri Mar 4 05:09:09 2022 From: duke at openjdk.java.net (Quan Anh Mai) Date: Fri, 4 Mar 2022 05:09:09 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v8] In-Reply-To: References: Message-ID: On Wed, 2 Mar 2022 14:41:18 GMT, Jie Fu wrote: >> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: >> >> address reviews > > src/hotspot/cpu/x86/x86_64.ad line 7446: > >> 7444: %} >> 7445: >> 7446: instruct leaI_rReg_immI(rRegI dst, rRegI src0, immI src1) > > I'm not sure if there would be any unexpected side-effect caused by the removal of `leaI_rReg_immI`. > Why you said it seems never be matched? The rule happens after `addI_rReg_imm` and has higher cost. I perceive it is there to define the peephole rule down below https://github.com/openjdk/jdk/blob/b6c35ae44aeb31deb7a15ee2939156ed00b3df52/src/hotspot/cpu/x86/x86_64.ad#L13284 ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From duke at openjdk.java.net Fri Mar 4 05:09:10 2022 From: duke at openjdk.java.net (Quan Anh Mai) Date: Fri, 4 Mar 2022 05:09:10 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v7] In-Reply-To: References: Message-ID: On Wed, 2 Mar 2022 23:13:17 GMT, Jie Fu wrote: >> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: >> >> remove irrelevent changes > > test/micro/org/openjdk/bench/vm/compiler/LeaInstruction.java line 32: > >> 30: @BenchmarkMode(Mode.AverageTime) >> 31: @OutputTimeUnit(TimeUnit.NANOSECONDS) >> 32: @Fork(value = 2, jvmArgsAppend = {"-XX:LoopUnrollLimit=1"}) > > How about `value = 1`? > I think it would reduce the micro-bench testing time, right? I have addressed the reviews. Thank you very much. ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From jiefu at openjdk.java.net Fri Mar 4 05:18:03 2022 From: jiefu at openjdk.java.net (Jie Fu) Date: Fri, 4 Mar 2022 05:18:03 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v8] In-Reply-To: References: Message-ID: <7bZ05MC1ruaU_VKnYRnuuhi_tjv4UGZafS6GMKiUQFo=.b54408f9-f5f8-4269-b6da-a0022b68bae5@github.com> On Thu, 3 Mar 2022 00:30:54 GMT, Quan Anh Mai wrote: >> Hi, >> >> This patch adds several matching rules for x86_64 backend to use `lea` instructions for several fused arithmetic operations. Also, `lea`s don't kill flags and allow different `dst` and `src`, so it is preferred over `sll` if possible, too. >> >> Thank you very much. > > Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: > > address reviews Maybe you have also noticed that the gcc will also generate `lea` for this method with -O{1, 2, 3}. int test(int d) { return d + 5; } So why not also enable it for Java? ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From darcy at openjdk.java.net Fri Mar 4 06:10:09 2022 From: darcy at openjdk.java.net (Joe Darcy) Date: Fri, 4 Mar 2022 06:10:09 GMT Subject: RFR: 8279508: Auto-vectorize Math.round API [v9] In-Reply-To: References: Message-ID: On Tue, 1 Mar 2022 06:17:06 GMT, Joe Darcy wrote: >> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: >> >> 8279508: Adding descriptive comments. > > test/jdk/java/lang/Math/RoundTests.java line 32: > >> 30: public static void main(String... args) { >> 31: int failures = 0; >> 32: for (int i = 0; i < 100000; i++) { > > Is there an idiom to trigger the auto-vectorization, perhaps using command line arguments, that doesn't bloat the running time of this test? IMO RoundTests should have a explicit @run tag without any VM options as well. Do the added VM options run on all platforms in question? What is the approximate time to run the test run compared to before? ------------- PR: https://git.openjdk.java.net/jdk/pull/7094 From jiefu at openjdk.java.net Fri Mar 4 06:12:07 2022 From: jiefu at openjdk.java.net (Jie Fu) Date: Fri, 4 Mar 2022 06:12:07 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v6] In-Reply-To: References: <2OyaRp6UdLYtDJSJQash1i6Nfo4jriWELQA30ITrwIY=.ab68593c-de96-493f-a215-0be40cb69a36@github.com> Message-ID: On Fri, 4 Mar 2022 05:05:22 GMT, Jie Fu wrote: > +instruct leaI_rReg_immI(rRegI dst, no_rbp_r13_RegI base, immI disp) Should be ` +instruct leaI_rReg_immI(rRegI dst, rRegI base, immI disp)` , right? ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From duke at openjdk.java.net Fri Mar 4 06:29:43 2022 From: duke at openjdk.java.net (Quan Anh Mai) Date: Fri, 4 Mar 2022 06:29:43 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v9] In-Reply-To: References: Message-ID: > Hi, > > This patch adds several matching rules for x86_64 backend to use `lea` instructions for several fused arithmetic operations. Also, `lea`s don't kill flags and allow different `dst` and `src`, so it is preferred over `sll` if possible, too. > > Thank you very much. Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: remove 0x67 prefix ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7560/files - new: https://git.openjdk.java.net/jdk/pull/7560/files/7d9b1e25..d171e82a Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7560&range=08 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7560&range=07-08 Stats: 7 lines in 2 files changed: 0 ins; 3 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/7560.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7560/head:pull/7560 PR: https://git.openjdk.java.net/jdk/pull/7560 From thartmann at openjdk.java.net Fri Mar 4 06:54:01 2022 From: thartmann at openjdk.java.net (Tobias Hartmann) Date: Fri, 4 Mar 2022 06:54:01 GMT Subject: RFR: 8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) [v2] In-Reply-To: References: Message-ID: <1ILgzn3-A4b4HF--bG-B9GhWusUWhh_eImCCKwhDlkE=.4cc7d8f4-03f6-4ed8-85b8-9a115de6a3ec@github.com> On Thu, 3 Mar 2022 16:26:41 GMT, Emanuel Peter wrote: >> There are two functions that check for equality. >> void ck(long x, long y): already throws a RuntimeException if we observe inequality >> void ck(double x, double y): called itself, leading to endless recursion and a StackOverflowError. >> >> Instead of the recursion, I now also throw a RuntimeException. >> >> This can currently be triggered with >> `path-to-jtreg/jtreg -va -s -jdk:jdk-path -javaoptions:"-XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressGCM -XX:+OptoScheduling -XX:StressSeed=293843391" test/hotspot/jtreg/compiler/intrinsics/unsafe/HeapByteBufferTest.java ` >> (see bug [JDK-8282555](https://bugs.openjdk.java.net/browse/JDK-8282555)) >> >> This way I could verify that instead of StackOverflowError we now get RuntimeException, as desired. >> Ran some basic tests to ensure I didn't break things. > > Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: > > removed unnecessary conditions Looks good to me. ------------- Marked as reviewed by thartmann (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7674 From duke at openjdk.java.net Fri Mar 4 07:02:04 2022 From: duke at openjdk.java.net (Quan Anh Mai) Date: Fri, 4 Mar 2022 07:02:04 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v9] In-Reply-To: References: Message-ID: On Fri, 4 Mar 2022 06:29:43 GMT, Quan Anh Mai wrote: >> Hi, >> >> This patch adds several matching rules for x86_64 backend to use `lea` instructions for several fused arithmetic operations. Also, `lea`s don't kill flags and allow different `dst` and `src`, so it is preferred over `sll` if possible, too. >> >> Thank you very much. > > Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: > > remove 0x67 prefix I would refrain from doing that, carelessly changing `add`s to `lea`s may bring negative results in real-world situations since the latter is a little larger in size and lower in throughput. IMO the best solution would be emitting `lea` after the coalescing of an `add` or `shl` and its input fails (e.g when the `dst` operand is needed for other operations), resulting in a sequence `mov r1, r2; add r1, r3/imm` become `lea r1, [r2 + r3/imm]`. This happens after the register allocation phase and well after the matching phase. I perceive the peephole rules are more appropriate for this transformation but I'm still exploring this idea. The latest change removes the redundant 0x67 prefix from `leal` since it reduces the size of the instruction and without `REX.W` prefix the destination register is 32-bit and according to the manual, the result is: > 64-bit effective address is calculated (default address size) and the lower 32 bits of the address are stored in the requested 32-bit register destination. which will produce the same result as before. The `prefix(src, dst)` is brought out for uniformity with other instructions, the function itself does not do anything on x86_32 (see assembler_x86.inline.hpp) so it is not a concern. Thank you very much. ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From jiefu at openjdk.java.net Fri Mar 4 08:27:02 2022 From: jiefu at openjdk.java.net (Jie Fu) Date: Fri, 4 Mar 2022 08:27:02 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v9] In-Reply-To: References: Message-ID: On Fri, 4 Mar 2022 06:59:02 GMT, Quan Anh Mai wrote: > I would refrain from doing that, carelessly changing `add`s to `lea`s may bring negative results in real-world situations since the latter is a little larger in size and lower in throughput. IMO the best solution would be emitting `lea` after the coalescing of an `add` or `shl` and its input fails (e.g when the `dst` operand is needed for other operations), resulting in a sequence `mov r1, r2; add r1, r3/imm` become `lea r1, [r2 + r3/imm]`. This happens after the register allocation phase and well after the matching phase. I perceive the peephole rules are more appropriate for this transformation but I'm still exploring this idea. Sounds reasonable. Shall we also remove `leaP_rReg_imm `? ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From duke at openjdk.java.net Fri Mar 4 08:29:40 2022 From: duke at openjdk.java.net (Quan Anh Mai) Date: Fri, 4 Mar 2022 08:29:40 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v10] In-Reply-To: References: Message-ID: > Hi, > > This patch adds several matching rules for x86_64 backend to use `lea` instructions for several fused arithmetic operations. Also, `lea`s don't kill flags and allow different `dst` and `src`, so it is preferred over `sll` if possible, too. > > Thank you very much. Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: remove unreached rules ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7560/files - new: https://git.openjdk.java.net/jdk/pull/7560/files/d171e82a..69a1afc9 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7560&range=09 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7560&range=08-09 Stats: 12 lines in 1 file changed: 0 ins; 12 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/7560.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7560/head:pull/7560 PR: https://git.openjdk.java.net/jdk/pull/7560 From jiefu at openjdk.java.net Fri Mar 4 08:46:05 2022 From: jiefu at openjdk.java.net (Jie Fu) Date: Fri, 4 Mar 2022 08:46:05 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v9] In-Reply-To: References: Message-ID: <7SOZqELdGZpse5jZjxLdRKXivjjAB_jRrJOJnvMmpq0=.ff2a8ea0-7169-4105-84c1-3eb77c7709cd@github.com> On Fri, 4 Mar 2022 06:59:02 GMT, Quan Anh Mai wrote: > The latest change removes the redundant 0x67 prefix from `leal` since it reduces the size of the instruction and without `REX.W` prefix the destination register is 32-bit and according to the manual, the result is: > > > 64-bit effective address is calculated (default address size) and the lower 32 bits of the address are stored in the requested 32-bit register destination. > > which will produce the same result as before. The `prefix(src, dst)` is brought out for uniformity with other instructions, the function itself does not do anything on x86_32 (see assembler_x86.inline.hpp) so it is not a concern. Did you check cases like 32-bit calculation overflow? Maybe add a jtreg test to verify the results? Thanks. ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From duke at openjdk.java.net Fri Mar 4 09:51:02 2022 From: duke at openjdk.java.net (Quan Anh Mai) Date: Fri, 4 Mar 2022 09:51:02 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v9] In-Reply-To: References: Message-ID: On Fri, 4 Mar 2022 08:23:21 GMT, Jie Fu wrote: > Shall we also remove `leaP_rReg_imm` ? Done. > Did you check cases like 32-bit calculation overflow? > Maybe add a jtreg test to verify the results? According to Intel manual, volume 1, section 3.3.7: > All 16-bit and 32-bit address calculations are zero-extended in IA-32e mode to form 64-bit addresses. Address calculations are first truncated to the effective address size of the current mode (64-bit mode or compatibility mode), as overridden by any address-size prefix. The result is then zero-extended to the full 64-bit address width. It is trivial that truncation to 32 bit and zero extension from 32 bit keep the lower 32 bits untouched. Also, the lower 32 bits of integral additions and multiplications only depends on the lower 32 bits of the operands. As a result, calculations with 32-bit address, 32-bit operand give the same result as those with 64-bit address, 32-bit operand since the lower 32 bits are similar and the upper 32 bits are all zero. Also, looking at the generated code for (using `unsigned int` because overflow cause wrapping, similar to Java calculations) unsigned int test(unsigned int x, unsigned int y) { return x + y * 4 + 100; } GCC conveniently output [`leal 0x64(%rdi,%rsi,4), %eax`](https://godbolt.org/z/M6o7zjoe3) with 64-bit address (without 0x67 prefix). So, we can be confident that we don't make a mistake here. Thanks a lot. ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From jiefu at openjdk.java.net Fri Mar 4 11:56:03 2022 From: jiefu at openjdk.java.net (Jie Fu) Date: Fri, 4 Mar 2022 11:56:03 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v10] In-Reply-To: References: Message-ID: On Fri, 4 Mar 2022 08:29:40 GMT, Quan Anh Mai wrote: >> Hi, >> >> This patch adds several matching rules for x86_64 backend to use `lea` instructions for several fused arithmetic operations. Also, `lea`s don't kill flags and allow different `dst` and `src`, so it is preferred over `sll` if possible, too. >> >> Thank you very much. > > Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: > > remove unreached rules Looks good to me assuming that change in `Assembler::leal` is correct. (I didn't do a double check of the change in `Assembler::leal` encoding.) ------------- Marked as reviewed by jiefu (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7560 From tanksherman27 at gmail.com Fri Mar 4 12:21:21 2022 From: tanksherman27 at gmail.com (Julian Waters) Date: Fri, 4 Mar 2022 20:21:21 +0800 Subject: On JDK-8281518 Message-ID: >From the discussion on JDK-8281518: "What *would* get us benefit in a cost-effective way would be to take this optimization and several previous ones (and future ones) and refactor them into a single comprehensive analysis based on truth tables, which would normalize bitwise expressions up to some particular complexity (say, up to three input variables and up to depth 2, with variety of operators). This is a minor research project, but (I think) a worthy one." Out of curiosity, do we have an exhaustive list of related optimizations prior to this one already included in C2? best regards, Julian From duke at openjdk.java.net Fri Mar 4 12:50:05 2022 From: duke at openjdk.java.net (Emanuel Peter) Date: Fri, 4 Mar 2022 12:50:05 GMT Subject: RFR: 8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) [v2] In-Reply-To: References: Message-ID: On Thu, 3 Mar 2022 17:55:00 GMT, Paul Sandoz wrote: >> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: >> >> removed unnecessary conditions > > Marked as reviewed by psandoz (Reviewer). Thanks @PaulSandoz and @TobiHartmann for the help and the reviews! ------------- PR: https://git.openjdk.java.net/jdk/pull/7674 From duke at openjdk.java.net Fri Mar 4 12:59:03 2022 From: duke at openjdk.java.net (Emanuel Peter) Date: Fri, 4 Mar 2022 12:59:03 GMT Subject: Integrated: 8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) In-Reply-To: References: Message-ID: <-CkqAXqLpFWwYWmwhs6HKdH2IKaLSYehQPHeLFDSQ7c=.9fb58c4a-09fd-400a-964e-f60f6e5f881f@github.com> On Thu, 3 Mar 2022 11:24:04 GMT, Emanuel Peter wrote: > There are two functions that check for equality. > void ck(long x, long y): already throws a RuntimeException if we observe inequality > void ck(double x, double y): called itself, leading to endless recursion and a StackOverflowError. > > Instead of the recursion, I now also throw a RuntimeException. > > This can currently be triggered with > `path-to-jtreg/jtreg -va -s -jdk:jdk-path -javaoptions:"-XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressGCM -XX:+OptoScheduling -XX:StressSeed=293843391" test/hotspot/jtreg/compiler/intrinsics/unsafe/HeapByteBufferTest.java ` > (see bug [JDK-8282555](https://bugs.openjdk.java.net/browse/JDK-8282555)) > > This way I could verify that instead of StackOverflowError we now get RuntimeException, as desired. > Ran some basic tests to ensure I didn't break things. This pull request has now been integrated. Changeset: a584c904 Author: Emanuel Peter Committer: Tobias Hartmann URL: https://git.openjdk.java.net/jdk/commit/a584c904a9e386d7ce80fb9cc6d49fece065d3da Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod 8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) Reviewed-by: psandoz, thartmann ------------- PR: https://git.openjdk.java.net/jdk/pull/7674 From jiefu at openjdk.java.net Fri Mar 4 14:25:11 2022 From: jiefu at openjdk.java.net (Jie Fu) Date: Fri, 4 Mar 2022 14:25:11 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v10] In-Reply-To: References: Message-ID: <150qK-2EDzRnISU8yLqFBYgeEVEcrjajQRKQrR3PeLs=.801f4add-c396-465c-9282-196aefa06e31@github.com> On Fri, 4 Mar 2022 08:29:40 GMT, Quan Anh Mai wrote: >> Hi, >> >> This patch adds several matching rules for x86_64 backend to use `lea` instructions for several fused arithmetic operations. Also, `lea`s don't kill flags and allow different `dst` and `src`, so it is preferred over `sll` if possible, too. >> >> Thank you very much. > > Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: > > remove unreached rules src/hotspot/cpu/x86/x86_64.ad line 7747: > 7745: %} > 7746: > 7747: // XXX addP mem ops ???? This comment line is for leaP_rReg_imm, which should also be removed? ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From duke at openjdk.java.net Fri Mar 4 14:34:08 2022 From: duke at openjdk.java.net (Quan Anh Mai) Date: Fri, 4 Mar 2022 14:34:08 GMT Subject: RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v10] In-Reply-To: <150qK-2EDzRnISU8yLqFBYgeEVEcrjajQRKQrR3PeLs=.801f4add-c396-465c-9282-196aefa06e31@github.com> References: <150qK-2EDzRnISU8yLqFBYgeEVEcrjajQRKQrR3PeLs=.801f4add-c396-465c-9282-196aefa06e31@github.com> Message-ID: On Fri, 4 Mar 2022 14:21:42 GMT, Jie Fu wrote: >> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: >> >> remove unreached rules > > src/hotspot/cpu/x86/x86_64.ad line 7747: > >> 7745: %} >> 7746: >> 7747: // XXX addP mem ops ???? > > This comment line is for leaP_rReg_imm, which should also be removed? I believe it is for the missing rules of `AddP` with memory operands such as `addP_mem_rReg` ------------- PR: https://git.openjdk.java.net/jdk/pull/7560 From duke at openjdk.java.net Fri Mar 4 15:23:36 2022 From: duke at openjdk.java.net (Emanuel Peter) Date: Fri, 4 Mar 2022 15:23:36 GMT Subject: RFR: 8282661: 2 compiler/intrinsics/unsafe/*ByteBufferTest.java tests fail after JDK-8282573 Message-ID: Running tests now... ------------- Commit messages: - 8282661: 2 compiler/intrinsics/unsafe/*ByteBufferTest.java tests fail after JDK-8282573 Changes: https://git.openjdk.java.net/jdk/pull/7699/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7699&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8282661 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/7699.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7699/head:pull/7699 PR: https://git.openjdk.java.net/jdk/pull/7699 From dcubed at openjdk.java.net Fri Mar 4 15:33:06 2022 From: dcubed at openjdk.java.net (Daniel D.Daugherty) Date: Fri, 4 Mar 2022 15:33:06 GMT Subject: RFR: 8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) [v2] In-Reply-To: References: Message-ID: On Thu, 3 Mar 2022 16:26:41 GMT, Emanuel Peter wrote: >> There are two functions that check for equality. >> void ck(long x, long y): already throws a RuntimeException if we observe inequality >> void ck(double x, double y): called itself, leading to endless recursion and a StackOverflowError. >> >> Instead of the recursion, I now also throw a RuntimeException. >> >> This can currently be triggered with >> `path-to-jtreg/jtreg -va -s -jdk:jdk-path -javaoptions:"-XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressGCM -XX:+OptoScheduling -XX:StressSeed=293843391" test/hotspot/jtreg/compiler/intrinsics/unsafe/HeapByteBufferTest.java ` >> (see bug [JDK-8282555](https://bugs.openjdk.java.net/browse/JDK-8282555)) >> >> This way I could verify that instead of StackOverflowError we now get RuntimeException, as desired. >> Ran some basic tests to ensure I didn't break things. > > Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: > > removed unnecessary conditions test/hotspot/jtreg/compiler/intrinsics/unsafe/ByteBufferTest.java line 220: > 218: void ck(double x, double y) { > 219: if (x != y) { > 220: throw new RuntimeException(" x = " + Double.toString(x) + ", y = " + Double.toString(y) You might want to add some explanation to the exception: s/" x = "/"Expected x == y: x = " or something like that. ------------- PR: https://git.openjdk.java.net/jdk/pull/7674 From dcubed at openjdk.java.net Fri Mar 4 15:54:05 2022 From: dcubed at openjdk.java.net (Daniel D.Daugherty) Date: Fri, 4 Mar 2022 15:54:05 GMT Subject: RFR: 8282661: 2 compiler/intrinsics/unsafe/*ByteBufferTest.java tests fail after JDK-8282573 In-Reply-To: References: Message-ID: On Fri, 4 Mar 2022 15:17:17 GMT, Emanuel Peter wrote: > According to IEEE, any comparison with a NaN is false. Thus NaN =! NaN is always true. > To guard against this case, we also have the `x == x && y == y` case. Changes requested by dcubed (Reviewer). test/hotspot/jtreg/compiler/intrinsics/unsafe/ByteBufferTest.java line 219: > 217: > 218: void ck(double x, double y) { > 219: if (x == x && y == y && x != y) { This line of logic is begging for a comment of some sort. Especially to keep someone from coming along later and "optimizing" it. ------------- PR: https://git.openjdk.java.net/jdk/pull/7699 From chagedorn at openjdk.java.net Fri Mar 4 16:29:42 2022 From: chagedorn at openjdk.java.net (Christian Hagedorn) Date: Fri, 4 Mar 2022 16:29:42 GMT Subject: RFR: 8282661: [BACKOUT] ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) [v2] In-Reply-To: References: Message-ID: On Fri, 4 Mar 2022 16:26:41 GMT, Emanuel Peter wrote: >> Backout [JDK-8282573](https://bugs.openjdk.java.net/browse/JDK-8282573). >> The new fix lead to many tests failing. >> And a new fix needs a little bit of thinking and testing. > > Emanuel Peter has updated the pull request incrementally with two additional commits since the last revision: > > - Revert "8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y)" > > This reverts commit a584c904a9e386d7ce80fb9cc6d49fece065d3da. > - Revert "8282661: 2 compiler/intrinsics/unsafe/*ByteBufferTest.java tests fail after JDK-8282573" > > This reverts commit 684e7b3f55d8f109eb096b1294600fa9fa8fbfbd. Looks good and trivial. ------------- Marked as reviewed by chagedorn (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7699 From duke at openjdk.java.net Fri Mar 4 16:29:44 2022 From: duke at openjdk.java.net (Emanuel Peter) Date: Fri, 4 Mar 2022 16:29:44 GMT Subject: RFR: 8282661: [BACKOUT] ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) In-Reply-To: References: Message-ID: On Fri, 4 Mar 2022 15:17:17 GMT, Emanuel Peter wrote: > Backout [JDK-8282573](https://bugs.openjdk.java.net/browse/JDK-8282573). > The new fix lead to many tests failing. > And a new fix needs a little bit of thinking and testing. Sorry for the trainwreck. Thanks @PaulSandoz @chhagedorn @dcubed-ojdk for the help and the reviews! ------------- PR: https://git.openjdk.java.net/jdk/pull/7699 From duke at openjdk.java.net Fri Mar 4 16:29:31 2022 From: duke at openjdk.java.net (Tyler Steele) Date: Fri, 4 Mar 2022 16:29:31 GMT Subject: RFR: 8282509: [AIX] ResolvedTestClass fails on AIX with similar output Message-ID: <5eb3C_3MU09ZBJSPs9ER4fM8u89e7T814CDtRDIdqAY=.04acec75-b1ca-44be-8bb2-140a51ca0a2b@github.com> This is a tentative solution to a failure observed on AIX. The solution is tentative because I require help to ensure that something deeper and more problematic is not happening. The test fails because the output produced by PrintCompilation produces `LambdaForm$MH/0x00000007c0002400` instead of `Invokers$Holder` as it does on other platforms. There is one other place the output is different, when `DirectMethodHandle$Holder` is replaced with `LambdaForm$DMH/0x00000007c0001c00`. Ignoring these name changes, the output of PrintCompilation is identical. I observe the same compilations (including the OSR/non-OSR, and same level) in the same order. I would be grateful for help understanding the root of the difference behind the change. I have a few ideas, but I will let you build your own interpretations free from my potentially incorrect understanding (i.e. no spoilers). Thanks in advance. ------------- Commit messages: - Trial Solution: Replaces shouldContain with shouldMatch + Regex in ResolvedClassTest Changes: https://git.openjdk.java.net/jdk/pull/7701/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7701&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8282509 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/7701.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7701/head:pull/7701 PR: https://git.openjdk.java.net/jdk/pull/7701 From duke at openjdk.java.net Fri Mar 4 16:29:32 2022 From: duke at openjdk.java.net (Tyler Steele) Date: Fri, 4 Mar 2022 16:29:32 GMT Subject: RFR: 8282509: [AIX] ResolvedTestClass fails on AIX with similar output In-Reply-To: <5eb3C_3MU09ZBJSPs9ER4fM8u89e7T814CDtRDIdqAY=.04acec75-b1ca-44be-8bb2-140a51ca0a2b@github.com> References: <5eb3C_3MU09ZBJSPs9ER4fM8u89e7T814CDtRDIdqAY=.04acec75-b1ca-44be-8bb2-140a51ca0a2b@github.com> Message-ID: On Fri, 4 Mar 2022 16:22:47 GMT, Tyler Steele wrote: > This is a tentative solution to a failure observed on AIX. The solution is tentative because I require help to ensure that something deeper and more problematic is not happening. > > The test fails because the output produced by PrintCompilation produces `LambdaForm$MH/0x00000007c0002400` instead of `Invokers$Holder` as it does on other platforms. There is one other place the output is different, when `DirectMethodHandle$Holder` is replaced with `LambdaForm$DMH/0x00000007c0001c00`. Ignoring these name changes, the output of PrintCompilation is identical. I observe the same compilations (including the OSR/non-OSR, and same level) in the same order. > > I would be grateful for help understanding the root of the difference behind the change. I have a few ideas, but I will let you build your own interpretations free from my potentially incorrect understanding (i.e. no spoilers). Thanks in advance. Dean Long mentioned on the issue that they were able to reproduce the issue with an exploded image. I don't have access to JBS (yet!) to comment there directly, so I'll mention here that I am building with make images, and not the default target. ------------- PR: https://git.openjdk.java.net/jdk/pull/7701 From duke at openjdk.java.net Fri Mar 4 16:29:41 2022 From: duke at openjdk.java.net (Emanuel Peter) Date: Fri, 4 Mar 2022 16:29:41 GMT Subject: RFR: 8282661: [BACKOUT] ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) [v2] In-Reply-To: References: Message-ID: > Backout [JDK-8282573](https://bugs.openjdk.java.net/browse/JDK-8282573). > The new fix lead to many tests failing. > And a new fix needs a little bit of thinking and testing. Emanuel Peter has updated the pull request incrementally with two additional commits since the last revision: - Revert "8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y)" This reverts commit a584c904a9e386d7ce80fb9cc6d49fece065d3da. - Revert "8282661: 2 compiler/intrinsics/unsafe/*ByteBufferTest.java tests fail after JDK-8282573" This reverts commit 684e7b3f55d8f109eb096b1294600fa9fa8fbfbd. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7699/files - new: https://git.openjdk.java.net/jdk/pull/7699/files/684e7b3f..cfc0d07e Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7699&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7699&range=00-01 Stats: 3 lines in 1 file changed: 0 ins; 2 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/7699.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7699/head:pull/7699 PR: https://git.openjdk.java.net/jdk/pull/7699 From psandoz at openjdk.java.net Fri Mar 4 16:29:43 2022 From: psandoz at openjdk.java.net (Paul Sandoz) Date: Fri, 4 Mar 2022 16:29:43 GMT Subject: RFR: 8282661: [BACKOUT] ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) [v2] In-Reply-To: References: Message-ID: On Fri, 4 Mar 2022 16:26:41 GMT, Emanuel Peter wrote: >> Backout [JDK-8282573](https://bugs.openjdk.java.net/browse/JDK-8282573). >> The new fix lead to many tests failing. >> And a new fix needs a little bit of thinking and testing. > > Emanuel Peter has updated the pull request incrementally with two additional commits since the last revision: > > - Revert "8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y)" > > This reverts commit a584c904a9e386d7ce80fb9cc6d49fece065d3da. > - Revert "8282661: 2 compiler/intrinsics/unsafe/*ByteBufferTest.java tests fail after JDK-8282573" > > This reverts commit 684e7b3f55d8f109eb096b1294600fa9fa8fbfbd. Marked as reviewed by psandoz (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/7699 From duke at openjdk.java.net Fri Mar 4 16:29:45 2022 From: duke at openjdk.java.net (Emanuel Peter) Date: Fri, 4 Mar 2022 16:29:45 GMT Subject: Integrated: 8282661: [BACKOUT] ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) In-Reply-To: References: Message-ID: On Fri, 4 Mar 2022 15:17:17 GMT, Emanuel Peter wrote: > Backout [JDK-8282573](https://bugs.openjdk.java.net/browse/JDK-8282573). > The new fix lead to many tests failing. > And a new fix needs a little bit of thinking and testing. This pull request has now been integrated. Changeset: 603050bf Author: Emanuel Peter Committer: Paul Sandoz URL: https://git.openjdk.java.net/jdk/commit/603050bfe00d7a0185d84acab2a24a803aa86f82 Stats: 4 lines in 1 file changed: 0 ins; 2 del; 2 mod 8282661: [BACKOUT] ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) Reviewed-by: chagedorn, psandoz ------------- PR: https://git.openjdk.java.net/jdk/pull/7699 From duke at openjdk.java.net Fri Mar 4 16:33:55 2022 From: duke at openjdk.java.net (Tyler Steele) Date: Fri, 4 Mar 2022 16:33:55 GMT Subject: RFR: 8282509: [AIX] ResolvedTestClass fails on AIX with similar output [v2] In-Reply-To: <5eb3C_3MU09ZBJSPs9ER4fM8u89e7T814CDtRDIdqAY=.04acec75-b1ca-44be-8bb2-140a51ca0a2b@github.com> References: <5eb3C_3MU09ZBJSPs9ER4fM8u89e7T814CDtRDIdqAY=.04acec75-b1ca-44be-8bb2-140a51ca0a2b@github.com> Message-ID: > This is a tentative solution to a failure observed on AIX. The solution is tentative because I require help to ensure that something deeper and more problematic is not happening. > > The test fails because the output produced by PrintCompilation produces `LambdaForm$MH/0x00000007c0002400` instead of `Invokers$Holder` as it does on other platforms. There is one other place the output is different, when `DirectMethodHandle$Holder` is replaced with `LambdaForm$DMH/0x00000007c0001c00`. Ignoring these name changes, the output of PrintCompilation is identical. I observe the same compilations (including the OSR/non-OSR, and same level) in the same order. > > I would be grateful for help understanding the root of the difference behind the change. I have a few ideas, but I will let you build your own interpretations free from my potentially incorrect understanding (i.e. no spoilers). Thanks in advance. Tyler Steele has updated the pull request incrementally with one additional commit since the last revision: Remove leading chars not present in original test ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7701/files - new: https://git.openjdk.java.net/jdk/pull/7701/files/8e77ff1b..4149b86c Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7701&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7701&range=00-01 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/7701.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7701/head:pull/7701 PR: https://git.openjdk.java.net/jdk/pull/7701 From duke at openjdk.java.net Fri Mar 4 16:47:06 2022 From: duke at openjdk.java.net (Quan Anh Mai) Date: Fri, 4 Mar 2022 16:47:06 GMT Subject: RFR: 8282661: [BACKOUT] ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) [v2] In-Reply-To: References: Message-ID: <0DKraI5TbBEgriZ-99f6oHwG2rCAE26y54dC7NmRUQY=.a8fa3c30-9708-47e9-a078-98170ae2cb62@github.com> On Fri, 4 Mar 2022 15:50:45 GMT, Daniel D. Daugherty wrote: >> Emanuel Peter has updated the pull request incrementally with two additional commits since the last revision: >> >> - Revert "8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y)" >> >> This reverts commit a584c904a9e386d7ce80fb9cc6d49fece065d3da. >> - Revert "8282661: 2 compiler/intrinsics/unsafe/*ByteBufferTest.java tests fail after JDK-8282573" >> >> This reverts commit 684e7b3f55d8f109eb096b1294600fa9fa8fbfbd. > > test/hotspot/jtreg/compiler/intrinsics/unsafe/ByteBufferTest.java line 219: > >> 217: >> 218: void ck(double x, double y) { >> 219: if (x == x && y == y && x != y) { > > This line of logic is begging for a comment of some sort. > Especially to keep someone from coming along later and "optimizing" it. I suggest using `Double::isNan` instead of `x == x` ------------- PR: https://git.openjdk.java.net/jdk/pull/7699 From jbhateja at openjdk.java.net Fri Mar 4 19:08:09 2022 From: jbhateja at openjdk.java.net (Jatin Bhateja) Date: Fri, 4 Mar 2022 19:08:09 GMT Subject: RFR: 8279508: Auto-vectorize Math.round API [v9] In-Reply-To: References: Message-ID: <2jFjnftd7VluGsxgp8BK0vgHA68VrgGREj0fk7F6Dhk=.e40ddcaa-5a31-4115-976d-5f43e94b8ccf@github.com> On Fri, 4 Mar 2022 06:06:52 GMT, Joe Darcy wrote: >> test/jdk/java/lang/Math/RoundTests.java line 32: >> >>> 30: public static void main(String... args) { >>> 31: int failures = 0; >>> 32: for (int i = 0; i < 100000; i++) { >> >> Is there an idiom to trigger the auto-vectorization, perhaps using command line arguments, that doesn't bloat the running time of this test? > > IMO RoundTests should have a explicit @run tag without any VM options as well. > > Do the added VM options run on all platforms in question? What is the approximate time to run the test run compared to before? Hi @jddarcy , Test has been modified on the same lines using generic options which manipulate compilation thresholds and agnostic to target platforms. * @run main/othervm -XX:Tier3CompileThreshold=100 -XX:CompileThresholdScaling=0.01 -XX:+TieredCompilation RoundTests Verified that RoundTests::test* methods gets compiled by c2. Test execution time with and without change is almost same ~7.80sec over Skylake-server. Regards ------------- PR: https://git.openjdk.java.net/jdk/pull/7094 From jbhateja at openjdk.java.net Fri Mar 4 20:27:36 2022 From: jbhateja at openjdk.java.net (Jatin Bhateja) Date: Fri, 4 Mar 2022 20:27:36 GMT Subject: RFR: 8281375: Accelerate bitCount operation for AVX2 and AVX512 target. [v8] In-Reply-To: References: Message-ID: > Summary of changes: > > - Patch extends existing vectorized bitCount optimization added with [JDK-8278868](https://bugs.openjdk.java.net/browse/JDK-8278868) and emits optimized JIT sequence for AVX2 and other AVX512 targets which do not support avx512_vpopcntdq feature. > - Since PopCountVI/PopCountVL node emit different instruction sequence based on the target features hence a rudimentary cost mode has been added which influences the SLP unrolling factor to prevent generating bloated main loops. > - Following are the performance results of an existing [JMH micro](https://github.com/jatin-bhateja/jdk/blob/master/test/micro/org/openjdk/bench/vm/compiler/VectorBitCount.java) over various X86 targets. > > > Benchmark | SIZE | Baseline AVX2 (ns/op) | Withopt AVX2 (ns/op) | Gain % | Baseline AVX3 (ns/op) | Withopt AVX3 (ns/op) | Gain % | Baseline AVX3 (VPOPCOUNTDQ) | Withopt AVX3 (VPOCOUNTDQ) | Gain % > -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- > VectorBitCount.WithSuperword.intBitCount | 1024 | 1089.799 | 420.156 | 159.3796114 | 1083.92 | 203.958 | 431.442748 | 88.958 | 60.096 | 48.02649095 > VectorBitCount.WithSuperword.longBitCount | 1024 | 417.458 | 413.859 | 0.869619846 | 417.203 | 214.949 | 94.09394787 | 105.954 | 117.019 | -9.455729411 > > Please review and share your feedback. > > Best Regards, > Jatin Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: 8281375: Review comments resolved. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7373/files - new: https://git.openjdk.java.net/jdk/pull/7373/files/1cdd068e..c54d962e Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7373&range=07 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7373&range=06-07 Stats: 73 lines in 4 files changed: 4 ins; 56 del; 13 mod Patch: https://git.openjdk.java.net/jdk/pull/7373.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7373/head:pull/7373 PR: https://git.openjdk.java.net/jdk/pull/7373 From kvn at openjdk.java.net Sat Mar 5 00:02:03 2022 From: kvn at openjdk.java.net (Vladimir Kozlov) Date: Sat, 5 Mar 2022 00:02:03 GMT Subject: RFR: 8282142: [TestCase] compiler/inlining/ResolvedClassTest.java will fail when --with-jvm-features=-compiler1 [v3] In-Reply-To: References: Message-ID: On Mon, 28 Feb 2022 06:45:17 GMT, Haomin wrote: >> ?l when --with-jvm-features=-compiler1 > > Haomin has updated the pull request incrementally with one additional commit since the last revision: > > 8282142: [TestCase] compiler/inlining/ResolvedClassTest.java will fail when --with-jvm-features=-compiler1 Okay. ------------- Marked as reviewed by kvn (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7541 From duke at openjdk.java.net Sat Mar 5 00:06:03 2022 From: duke at openjdk.java.net (Haomin) Date: Sat, 5 Mar 2022 00:06:03 GMT Subject: Integrated: 8282142: [TestCase] compiler/inlining/ResolvedClassTest.java will fail when --with-jvm-features=-compiler1 In-Reply-To: References: Message-ID: On Sat, 19 Feb 2022 03:49:58 GMT, Haomin wrote: > ?l when --with-jvm-features=-compiler1 This pull request has now been integrated. Changeset: c459f8f4 Author: wanghaomin Committer: Vladimir Kozlov URL: https://git.openjdk.java.net/jdk/commit/c459f8f406a99cf78814bb5722f546ae1cdb6c6f Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod 8282142: [TestCase] compiler/inlining/ResolvedClassTest.java will fail when --with-jvm-features=-compiler1 Reviewed-by: jiefu, kvn ------------- PR: https://git.openjdk.java.net/jdk/pull/7541 From sviswanathan at openjdk.java.net Sat Mar 5 00:58:06 2022 From: sviswanathan at openjdk.java.net (Sandhya Viswanathan) Date: Sat, 5 Mar 2022 00:58:06 GMT Subject: RFR: 8281375: Accelerate bitCount operation for AVX2 and AVX512 target. [v8] In-Reply-To: References: Message-ID: On Fri, 4 Mar 2022 20:27:36 GMT, Jatin Bhateja wrote: >> Summary of changes: >> >> - Patch extends existing vectorized bitCount optimization added with [JDK-8278868](https://bugs.openjdk.java.net/browse/JDK-8278868) and emits optimized JIT sequence for AVX2 and other AVX512 targets which do not support avx512_vpopcntdq feature. >> - Since PopCountVI/PopCountVL node emit different instruction sequence based on the target features hence a rudimentary cost mode has been added which influences the SLP unrolling factor to prevent generating bloated main loops. >> - Following are the performance results of an existing [JMH micro](https://github.com/jatin-bhateja/jdk/blob/master/test/micro/org/openjdk/bench/vm/compiler/VectorBitCount.java) over various X86 targets. >> >> >> Benchmark | SIZE | Baseline AVX2 (ns/op) | Withopt AVX2 (ns/op) | Gain % | Baseline AVX3 (ns/op) | Withopt AVX3 (ns/op) | Gain % | Baseline AVX3 (VPOPCOUNTDQ) | Withopt AVX3 (VPOCOUNTDQ) | Gain % >> -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- >> VectorBitCount.WithSuperword.intBitCount | 1024 | 1089.799 | 420.156 | 159.3796114 | 1083.92 | 203.958 | 431.442748 | 88.958 | 60.096 | 48.02649095 >> VectorBitCount.WithSuperword.longBitCount | 1024 | 417.458 | 413.859 | 0.869619846 | 417.203 | 214.949 | 94.09394787 | 105.954 | 117.019 | -9.455729411 >> >> Please review and share your feedback. >> >> Best Regards, >> Jatin > > Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: > > 8281375: Review comments resolved. Marked as reviewed by sviswanathan (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/7373 From sviswanathan at openjdk.java.net Sat Mar 5 00:58:07 2022 From: sviswanathan at openjdk.java.net (Sandhya Viswanathan) Date: Sat, 5 Mar 2022 00:58:07 GMT Subject: RFR: 8281375: Accelerate bitCount operation for AVX2 and AVX512 target. [v7] In-Reply-To: References: Message-ID: <4XFyr694xjEc7sBptBgSWUGVI0WkG80has3tBxY5Rmw=.1c153717-09e0-4287-82fb-e78ac3d512fa@github.com> On Thu, 3 Mar 2022 05:42:59 GMT, Jatin Bhateja wrote: >> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: >> >> 8281375: Review comments resolved. > > Hi @sviswa7 , your comments have been addressed. @jatin-bhateja The patch looks good to me. ------------- PR: https://git.openjdk.java.net/jdk/pull/7373 From psandoz at openjdk.java.net Sat Mar 5 01:40:07 2022 From: psandoz at openjdk.java.net (Paul Sandoz) Date: Sat, 5 Mar 2022 01:40:07 GMT Subject: RFR: 8281375: Accelerate bitCount operation for AVX2 and AVX512 target. [v8] In-Reply-To: References: Message-ID: On Fri, 4 Mar 2022 20:27:36 GMT, Jatin Bhateja wrote: >> Summary of changes: >> >> - Patch extends existing vectorized bitCount optimization added with [JDK-8278868](https://bugs.openjdk.java.net/browse/JDK-8278868) and emits optimized JIT sequence for AVX2 and other AVX512 targets which do not support avx512_vpopcntdq feature. >> - Since PopCountVI/PopCountVL node emit different instruction sequence based on the target features hence a rudimentary cost mode has been added which influences the SLP unrolling factor to prevent generating bloated main loops. >> - Following are the performance results of an existing [JMH micro](https://github.com/jatin-bhateja/jdk/blob/master/test/micro/org/openjdk/bench/vm/compiler/VectorBitCount.java) over various X86 targets. >> >> >> Benchmark | SIZE | Baseline AVX2 (ns/op) | Withopt AVX2 (ns/op) | Gain % | Baseline AVX3 (ns/op) | Withopt AVX3 (ns/op) | Gain % | Baseline AVX3 (VPOPCOUNTDQ) | Withopt AVX3 (VPOCOUNTDQ) | Gain % >> -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- >> VectorBitCount.WithSuperword.intBitCount | 1024 | 1089.799 | 420.156 | 159.3796114 | 1083.92 | 203.958 | 431.442748 | 88.958 | 60.096 | 48.02649095 >> VectorBitCount.WithSuperword.longBitCount | 1024 | 417.458 | 413.859 | 0.869619846 | 417.203 | 214.949 | 94.09394787 | 105.954 | 117.019 | -9.455729411 >> >> Please review and share your feedback. >> >> Best Regards, >> Jatin > > Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: > > 8281375: Review comments resolved. Running some tests. ------------- PR: https://git.openjdk.java.net/jdk/pull/7373 From sviswanathan at openjdk.java.net Sat Mar 5 01:40:07 2022 From: sviswanathan at openjdk.java.net (Sandhya Viswanathan) Date: Sat, 5 Mar 2022 01:40:07 GMT Subject: RFR: 8281375: Accelerate bitCount operation for AVX2 and AVX512 target. [v8] In-Reply-To: References: Message-ID: On Sat, 5 Mar 2022 01:36:09 GMT, Paul Sandoz wrote: >> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: >> >> 8281375: Review comments resolved. > > Running some tests. Thanks a lot @PaulSandoz. ------------- PR: https://git.openjdk.java.net/jdk/pull/7373 From aph at openjdk.java.net Sun Mar 6 09:35:08 2022 From: aph at openjdk.java.net (Andrew Haley) Date: Sun, 6 Mar 2022 09:35:08 GMT Subject: RFR: 8279508: Auto-vectorize Math.round API [v11] In-Reply-To: References: Message-ID: On Wed, 2 Mar 2022 02:44:41 GMT, Jatin Bhateja wrote: >> Summary of changes: >> - Intrinsify Math.round(float) and Math.round(double) APIs. >> - Extend auto-vectorizer to infer vector operations on encountering scalar IR nodes for above intrinsics. >> - Test creation using new IR testing framework. >> >> Following are the performance number of a JMH micro included with the patch >> >> Test System: Intel(R) Xeon(R) Platinum 8380 CPU @ 2.30GHz (Icelake Server) >> >> >> Benchmark | TESTSIZE | Baseline AVX3 (ops/ms) | Withopt AVX3 (ops/ms) | Gain ratio | Baseline AVX2 (ops/ms) | Withopt AVX2 (ops/ms) | Gain ratio >> -- | -- | -- | -- | -- | -- | -- | -- >> FpRoundingBenchmark.test_round_double | 1024.00 | 504.15 | 2209.54 | 4.38 | 510.36 | 548.39 | 1.07 >> FpRoundingBenchmark.test_round_double | 2048.00 | 293.64 | 1271.98 | 4.33 | 293.48 | 274.01 | 0.93 >> FpRoundingBenchmark.test_round_float | 1024.00 | 825.99 | 4754.66 | 5.76 | 751.83 | 2274.13 | 3.02 >> FpRoundingBenchmark.test_round_float | 2048.00 | 412.22 | 2490.09 | 6.04 | 388.52 | 1334.18 | 3.43 >> >> >> Kindly review and share your feedback. >> >> Best Regards, >> Jatin > > Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: > > 8279508: Removing +LogCompilation flag. src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 4157: > 4155: ExternalAddress mxcsr_std(StubRoutines::x86::addr_mxcsr_std()); > 4156: ldmxcsr(new_mxcsr); > 4157: movl(scratch, 1056964608); What is 1056964608 ? ------------- PR: https://git.openjdk.java.net/jdk/pull/7094 From jbhateja at openjdk.java.net Sun Mar 6 11:47:01 2022 From: jbhateja at openjdk.java.net (Jatin Bhateja) Date: Sun, 6 Mar 2022 11:47:01 GMT Subject: RFR: 8279508: Auto-vectorize Math.round API [v11] In-Reply-To: References: Message-ID: <78mhhL5dqkY5LQY2U2i_DF6MvgYBQiDIrieGcBOCGAA=.ec16edf8-24d2-4658-92ff-5d20f03e7620@github.com> On Sun, 6 Mar 2022 09:31:27 GMT, Andrew Haley wrote: >> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: >> >> 8279508: Removing +LogCompilation flag. > > src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 4157: > >> 4155: ExternalAddress mxcsr_std(StubRoutines::x86::addr_mxcsr_std()); >> 4156: ldmxcsr(new_mxcsr); >> 4157: movl(scratch, 1056964608); > > What is 1056964608 ? Raw bits corresponding to floating point value 0.5f. ------------- PR: https://git.openjdk.java.net/jdk/pull/7094 From aph at openjdk.java.net Sun Mar 6 13:52:00 2022 From: aph at openjdk.java.net (Andrew Haley) Date: Sun, 6 Mar 2022 13:52:00 GMT Subject: RFR: 8279508: Auto-vectorize Math.round API [v11] In-Reply-To: References: Message-ID: On Wed, 2 Mar 2022 02:44:41 GMT, Jatin Bhateja wrote: >> Summary of changes: >> - Intrinsify Math.round(float) and Math.round(double) APIs. >> - Extend auto-vectorizer to infer vector operations on encountering scalar IR nodes for above intrinsics. >> - Test creation using new IR testing framework. >> >> Following are the performance number of a JMH micro included with the patch >> >> Test System: Intel(R) Xeon(R) Platinum 8380 CPU @ 2.30GHz (Icelake Server) >> >> >> Benchmark | TESTSIZE | Baseline AVX3 (ops/ms) | Withopt AVX3 (ops/ms) | Gain ratio | Baseline AVX2 (ops/ms) | Withopt AVX2 (ops/ms) | Gain ratio >> -- | -- | -- | -- | -- | -- | -- | -- >> FpRoundingBenchmark.test_round_double | 1024.00 | 504.15 | 2209.54 | 4.38 | 510.36 | 548.39 | 1.07 >> FpRoundingBenchmark.test_round_double | 2048.00 | 293.64 | 1271.98 | 4.33 | 293.48 | 274.01 | 0.93 >> FpRoundingBenchmark.test_round_float | 1024.00 | 825.99 | 4754.66 | 5.76 | 751.83 | 2274.13 | 3.02 >> FpRoundingBenchmark.test_round_float | 2048.00 | 412.22 | 2490.09 | 6.04 | 388.52 | 1334.18 | 3.43 >> >> >> Kindly review and share your feedback. >> >> Best Regards, >> Jatin > > Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision: > > 8279508: Removing +LogCompilation flag. src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 4157: > 4155: ExternalAddress mxcsr_std(StubRoutines::x86::addr_mxcsr_std()); > 4156: ldmxcsr(new_mxcsr); > 4157: movl(scratch, 1056964608); Suggestion: movl(scratch, 1056964608); // Raw bits corresponding to floating point value 0.5f. ------------- PR: https://git.openjdk.java.net/jdk/pull/7094 From xgong at openjdk.java.net Mon Mar 7 01:31:04 2022 From: xgong at openjdk.java.net (Xiaohong Gong) Date: Mon, 7 Mar 2022 01:31:04 GMT Subject: RFR: 8282432: Optimize masked "test" Vector API with predicate feature [v2] In-Reply-To: References: Message-ID: On Thu, 3 Mar 2022 17:40:13 GMT, Paul Sandoz wrote: > I guess the following: `mask.cast(IntVector.species(shape())` is more efficient than: `m.cast(vspecies().asIntegral()))` ? Yeah, that's one point. Another main reason is `m.cast(vspecies().asIntegral()))` cannot be handled well in the superclass due to the java generic issues. Thanks for the reiview @PaulSandoz ! ------------- PR: https://git.openjdk.java.net/jdk/pull/7654 From jbhateja at openjdk.java.net Mon Mar 7 02:09:27 2022 From: jbhateja at openjdk.java.net (Jatin Bhateja) Date: Mon, 7 Mar 2022 02:09:27 GMT Subject: RFR: 8282711: Accelerate Math.signum function for AVX and AVX512 target. Message-ID: - Patch auto-vectorizes Math.signum operation for floating point types. - Efficient JIT sequence is being generated for AVX512 and legacy X86 targets. - Following is the performance data for include JMH micro. System : Intel(R) Xeon(R) Platinum 8380 CPU @ 2.30GHz (40C 2S Icelake Server) Benchmark | (SIZE) | Baseline AVX (ns/op) | Withopt AVX (ns/op) | Gain Ratio | Basline AVX512 (ns/op) | Withopt AVX512 (ns/op) | Gain Ratio -- | -- | -- | -- | -- | -- | -- | -- VectorSignum.doubleSignum | 256 | 174.357 | 68.374 | 2.550048264 | 173.679 | 31.013 | 5.600199916 VectorSignum.doubleSignum | 512 | 334.231 | 128.762 | 2.595727 | 334.625 | 59.377 | 5.635599643 VectorSignum.doubleSignum | 1024 | 655.679 | 251.566 | 2.606389576 | 655.267 | 116.736 | 5.613238418 VectorSignum.doubleSignum | 2048 | 1292.165 | 499.924 | 2.584722878 | 1301.7 | 228.064 | 5.707608391 VectorSignum.floatSignum | 256 | 176.064 | 39.864 | 4.416616496 | 174.639 | 25.372 | 6.883138893 VectorSignum.floatSignum | 512 | 337.565 | 71.027 | 4.752629282 | 331.506 | 36.64 | 9.047652838 VectorSignum.floatSignum | 1024 | 661.488 | 131.074 | 5.046675924 | 644.621 | 63.88 | 10.09112398 VectorSignum.floatSignum | 2048 | 1299.685 | 253.271 | 5.13159817 | 1279.658 | 118.995 | 10.75388042 Kindly review and share feedback. Best Regards, Jatin ------------- Commit messages: - 8282711: Accelerate Math.signum function for AVX and AVX512 target. Changes: https://git.openjdk.java.net/jdk/pull/7717/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7717&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8282711 Stats: 261 lines in 14 files changed: 260 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/7717.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7717/head:pull/7717 PR: https://git.openjdk.java.net/jdk/pull/7717 From xliu at openjdk.java.net Mon Mar 7 05:43:30 2022 From: xliu at openjdk.java.net (Xin Liu) Date: Mon, 7 Mar 2022 05:43:30 GMT Subject: RFR: 8282715: typo compileony in test Test8005033.java Message-ID: This patch doesn't change the testing functionality. It was compiled before. HotSpot failed to handle compiler directive 'compileony'. As a result, it has to compile all methods. Here is the warning message CompileCommand: An error occurred during parsing Error: Unrecognized option 'compileony' Line: 'compileony,compiler.codegen.Test8005033::testBitCount' Usage: '-XX:CompileCommand=