JDK-8314923 : [lworld] AllocationMergesTests.java fails IR verification
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: repo-valhalla
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-08-24
  • Updated: 2023-08-25
  • Resolved: 2023-08-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
repo-valhallaFixed
Related Reports
Relates :  
Relates :  
Description
Failed IR Rules (1) of Methods (1)
----------------------------------
1) Method "int compiler.c2.irTests.scalarReplacement.AllocationMergesTests.testEscapeInCallAfterMerge_C2(boolean,boolean,int,int)" - [Failed IR rules: 1]:
   * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeatureOr={}, applyIfCPUFeature={}, counts={"_#ALLOC#_", "2"}, failOn={}, applyIfAnd={}, applyIfOr={}, applyIfNot={})"
     > Phase "PrintOptoAssembly":
       - counts: Graph contains wrong number of nodes:
         * Constraint 1: "(.*precise .*\R((.*(?i:mov|mv|xorl|nop|spill).*|\s*)\R)*.*(?i:call,static).*wrapper for: _new_instance_Java)"
           - Failed comparison: [found] 1 = 2 [given]
             - Matched node:
               * 19c     movq    RSI, precise compiler/c2/irTests/scalarReplacement/AllocationMergesTests$Point: 0x00007f3504514188:Constant:exact *	# ptr
                 1a6     movq    [rsp + #0], R11	# spill
                 1aa     xorl    RDX, RDX	# int
                         nop 	# 3 bytes pad for loops and calls
                 1af     call,static  wrapper for: _new_instance_Java

>>> Check stdout for compilation output of the failed methods

Comments
A pull request was submitted for review. URL: https://git.openjdk.org/valhalla/pull/919 Date: 2023-08-25 08:55:23 +0000
25-08-2023

Missing Valhalla support for JDK-8287061 (if any), will be implemented by JDK-8315003.
25-08-2023

The test fails because the IR framework fails to detect this allocation due to the 64-bit mem-mem spill. The spill happens only in Valhalla because the _new_instance_java call has an additional _is_larval argument that increases register pressure: 154 B11: # out( B16 B12 ) <- in( B1 ) Freq: 0.000100017 154 movq RSI, precise compiler/c2/irTests/scalarReplacement/AllocationMergesTests$Point: 0x00007f95a82bb2a8:Constant:exact * # ptr 15e xorl RDX, RDX # int 160 pushq [rsp + #8] # 64-bit mem-mem spill popq [rsp + #0] nop # 2 bytes pad for loops and calls 16b call,static wrapper for: _new_instance_Java # compiler.c2.irTests.scalarReplacement.AllocationMergesTests::testEscapeInCallAfterMerge @ bci:0 (line 201) L[0]=rsp + #0 L[1]=RBP L[2]=rsp + #20 L[3]=rsp + #16 L[4]=rsp + #24 L[5]=_ # compiler.c2.irTests.scalarReplacement.AllocationMergesTests::testEscapeInCallAfterMerge_C2 @ bci:6 (line 216) L[0]=rsp + #0 L[1]=RBP L[2]=rsp + #20 L[3]=rsp + #16 L[4]=rsp + #24 # OopMap {[0]=Oop [8]=Oop off=368/0x170} This is an IR framework issue that I'll fix with JDK-8314999 in mainline. I'll put a stop-the-gap-solution in Valhalla.
25-08-2023