RFR: 8341293: Split field loads through Nested Phis
Tobias Hartmann
thartmann at openjdk.org
Wed Nov 20 11:16:20 UTC 2024
On Mon, 30 Sep 2024 16:23:05 GMT, Dhamoder Nalla <dhanalla at openjdk.org> wrote:
> As an extension of the work done as part of https://github.com/openjdk/jdk/pull/12897, split the field loads (AddP -> Load*) with nested phi parent nodes to enable more scalar replacements, thereby reducing memory allocation.
>
>
> Here are the sequence of Ideal graph transformations for Nested phi:
>
>
> 
>
> 
>
> 
`AllocationMergesNestedPhiTests.java` fails on Linux AArch64:
Failed IR Rules (1) of Methods (1)
----------------------------------
1) Method "int compiler.c2.irTests.scalarReplacement.AllocationMergesNestedPhiTests.testGlobalEscapeInThread_C2(boolean,int,int,int)" - [Failed IR rules: 1]:
* @IR rule 1: "@compiler.lib.ir_framework.IR(phase={ITER_GVN_AFTER_EA}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#ALLOC#_", ">=5"}, failOn={}, applyIfPlatform={}, applyIfPlatformOr={}, applyIfOr={}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={}, applyIfAnd={}, applyIfNot={})"
> Phase "Iter GVN after EA":
- counts: Graph contains wrong number of nodes:
* Constraint 1: "(\\d+(\\s){2}(Allocate\\b.*)+(\\s){2}===.*)"
- Failed comparison: [found] 4 >= 5 [given]
- Matched nodes (4):
* 243 Allocate === 1899 6 7 8 1 (241 225 29 1 1 10 11 12 13 14 10 11 12 13 14 1976 1956 1 1 1 11 13 12 14 184 184 11 13 12 14 1 1 184 184 13 14 ) [[ 244 245 246 253 254 255 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top, bool ) DirectMethodHandle::allocateInstance @ bci:12 (line 506) 0x0000ffff54b0c408::newInvokeSpecial @ bci:1 0x0000ffff54b0d388::linkToTargetMethod @ bci:9 AllocationMergesNestedPhiTests::testGlobalEscapeInThread @ bci:26 (line 247) AllocationMergesNestedPhiTests::testGlobalEscapeInThread_C2 @ bci:6 (line 268) !jvms: DirectMethodHandle::allocateInstance @ bci:12 (line 506) 0x0000ffff54b0c408::newInvokeSpecial @ bci:1 0x0000ffff54b0d388::linkToTargetMethod @ bci:9 AllocationMergesNestedPhiTests::testGlobalEscapeInThread @ bci:26 (line 247) AllocationMergesNestedPhiTests::testGlobalEscapeInThread_C2 @ bci:6 (line 268)
* 380 Allocate === 368 254 369 8 1 (378 377 29 1 1 10 11 12 13 14 10 11 12 13 14 1974 1954 260 1 1 13 14 ) [[ 381 382 383 390 391 392 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top, bool ) AllocationMergesNestedPhiTests::testGlobalEscapeInThread @ bci:33 (line 251) AllocationMergesNestedPhiTests::testGlobalEscapeInThread_C2 @ bci:6 (line 268) !jvms: AllocationMergesNestedPhiTests::testGlobalEscapeInThread @ bci:33 (line 251) AllocationMergesNestedPhiTests::testGlobalEscapeInThread_C2 @ bci:6 (line 268)
* 465 Allocate === 394 391 427 8 1 (109 126 29 1 1 10 11 12 13 14 10 11 12 13 14 1971 1951 260 1 1 397 397 260 397 411 411 29 260 412 1 1 1 1 397 13 14 ) [[ 466 467 468 475 476 477 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top, bool ) Thread::<init> @ bci:5 (line 319) Thread::<init> @ bci:6 (line 1088) AllocationMergesNestedPhiTests::testGlobalEscapeInThread @ bci:39 (line 251) AllocationMergesNestedPhiTests::testGlobalEscapeInThread_C2 @ bci:6 (line 268) !jvms: Thread::<init> @ bci:5 (line 319) Thread::<init> @ bci:6 (line 1088) AllocationMergesNestedPhiTests::testGlobalEscapeInThread @ bci:39 (line 251) AllocationMergesNestedPhiTests::testGlobalEscapeInThread_C2 @ bci:6 (line 268)
* 911 Allocate === 903 476 904 8 1 (909 908 29 1 1 10 11 12 13 14 10 11 12 13 14 1965 1945 260 1 1 397 397 260 397 881 411 29 260 412 1 761 29 907 397 13 14 ) [[ 912 913 914 921 922 923 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, top, bool ) Thread::<init> @ bci:98 (line 675) Thread::<init> @ bci:6 (line 1088) AllocationMergesNestedPhiTests::testGlobalEscapeInThread @ bci:39 (line 251) AllocationMergesNestedPhiTests::testGlobalEscapeInThread_C2 @ bci:6 (line 268) !jvms: Thread::<init> @ bci:98 (line 675) Thread::<init> @ bci:6 (line 1088) AllocationMergesNestedPhiTests::testGlobalEscapeInThread @ bci:39 (line 251) AllocationMergesNestedPhiTests::testGlobalEscapeInThread_C2 @ bci:6 (line 268)
>>> Check stdout for compilation output of the failed methods
-------------
PR Comment: https://git.openjdk.org/jdk/pull/21270#issuecomment-2488300819
More information about the hotspot-compiler-dev
mailing list