JDK-8356278 : TestDuplicateBackedge fails due to missing CountedLoop in IR
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21,24,25,26
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-05-06
  • Updated: 2025-05-09
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.
JDK 26
26Unresolved
Related Reports
Relates :  
Description
Running test/hotspot/jtreg/compiler/c2/irTests/TestDuplicateBackedge.java with "sde64 -future --" fails:

Failed IR Rules (1) of Methods (1)
----------------------------------
1) Method "public static float compiler.c2.irTests.TestDuplicateBackedge.test()" - [Failed IR rules: 1]:
   * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#LOOP#_", "1", "_#COUNTED_LOOP#_", "1"}, applyIfPlatform={}, applyIfPlatformOr={}, failOn={}, applyIfOr={}, applyIfCPUFeatureAnd={}, applyIf={"DuplicateBackedge", "true"}, applyIfCPUFeature={}, applyIfAnd={}, applyIfNot={})"
     > Phase "PrintIdeal":
       - counts: Graph contains wrong number of nodes:
         * Constraint 1: "(\d+(\s){2}(Loop.*)+(\s){2}===.*)"
           - Failed comparison: [found] 2 = 1 [given]
             - Matched nodes (2):
               * 140  Loop  === 140 167 135  [[ 140 76 75 109 141 ]] inner  !orig=[72] !jvms: TestDuplicateBackedge::test @ bci:4 (line 50)
               * 167  Loop  === 167 5 155  [[ 167 140 168 169 170 ]] 
         * Constraint 2: "(\d+(\s){2}(CountedLoop\b.*)+(\s){2}===.*)"
           - Failed comparison: [found] 0 = 1 [given]
           - No nodes matched!

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

1) Compilation of "public static float compiler.c2.irTests.TestDuplicateBackedge.test()":
> Phase "PrintIdeal":
AFTER: print_ideal
   0  Root  === 0 139  [[ 0 1 3 21 22 32 43 54 65 129 128 90 93 96 101 125 118 143 ]] 
   1  Con  === 0  [[ ]]  #top
   3  Start  === 3 0  [[ 3 5 6 7 8 9 ]]  #{0:control, 1:abIO, 2:memory, 3:rawptr:BotPTR, 4:return_address}
   5  Parm  === 3  [[ 167 ]] Control !orig=[38],[49],[60] !jvms: TestDuplicateBackedge::test @ bci:-1 (line 48)
   6  Parm  === 3  [[ 139 ]] I_O !orig=[24] !jvms: TestDuplicateBackedge::test @ bci:-1 (line 48)
   7  Parm  === 3  [[ 139 131 126 157 159 ]] Memory  Memory: @BotPTR *+bot, idx=Bot; !orig=[25],[74] !jvms: TestDuplicateBackedge::test @ bci:-1 (line 48)
   8  Parm  === 3  [[ 139 ]] FramePtr !jvms: TestDuplicateBackedge::test @ bci:-1 (line 48)
   9  Parm  === 3  [[ 139 ]] ReturnAdr !jvms: TestDuplicateBackedge::test @ bci:-1 (line 48)
  21  ConF  === 0  [[ 169 ]]  #ftcon:1.000000
  22  ConI  === 0  [[ 168 117 121 100 116 ]]  #int:1
  75  Phi  === 140 169 122  [[ 122 119 ]]  #float !jvms: TestDuplicateBackedge::test @ bci:4 (line 50)
  76  Phi  === 140 168 121  [[ 116 121 91 107 ]]  #int !jvms: TestDuplicateBackedge::test @ bci:4 (line 50)
  90  ConL  === 0  [[ 92 ]]  #long:1717986919
  91  ConvI2L  === _ 76  [[ 92 ]]  #long:minint..maxint:www !jvms: TestDuplicateBackedge::test @ bci:7 (line 50)
  92  MulL  === _ 91 90  [[ 94 ]]  !jvms: TestDuplicateBackedge::test @ bci:7 (line 50)
  93  ConI  === 0  [[ 94 ]]  #int:34
  94  RShiftL  === _ 92 93  [[ 95 ]]  !jvms: TestDuplicateBackedge::test @ bci:7 (line 50)
  95  ConvL2I  === _ 94  [[ 98 ]]  #int:-214748365..214748364:www !jvms: TestDuplicateBackedge::test @ bci:7 (line 50)
  96  ConI  === 0  [[ 144 165 ]]  #int:31
  98  SubI  === _ 95 141  [[ 102 100 ]]  !jvms: TestDuplicateBackedge::test @ bci:7 (line 50)
 100  LShiftI  === _ 98 22  [[ 103 ]]  !jvms: TestDuplicateBackedge::test @ bci:7 (line 50)
 101  ConI  === 0  [[ 102 ]]  #int:3
 102  LShiftI  === _ 98 101  [[ 103 ]]  !jvms: TestDuplicateBackedge::test @ bci:7 (line 50)
 103  AddI  === _ 100 102  [[ 107 ]]  !jvms: TestDuplicateBackedge::test @ bci:7 (line 50)
 107  CmpI  === _ 76 103  [[ 108 ]]  !jvms: TestDuplicateBackedge::test @ bci:8 (line 50)
 108  Bool  === _ 107  [[ 109 ]] [ne] !jvms: TestDuplicateBackedge::test @ bci:8 (line 50)
 109  If  === 140 108  [[ 110 111 ]] P=0.900013, C=47896.000000 !jvms: TestDuplicateBackedge::test @ bci:8 (line 50)
 110  IfTrue  === 109  [[ 126 131 ]] #1 !jvms: TestDuplicateBackedge::test @ bci:8 (line 50)
 111  IfFalse  === 109  [[ 157 159 ]] #0 !jvms: TestDuplicateBackedge::test @ bci:8 (line 50)
 116  LShiftI  === _ 76 22  [[ 117 ]]  !jvms: TestDuplicateBackedge::test @ bci:13 (line 51)
 117  AddI  === _ 116 22  [[ 157 157 168 165 162 ]]  !orig=[164],[124] !jvms: TestDuplicateBackedge::test @ bci:15 (line 51)
 118  ConF  === 0  [[ 119 122 ]]  #ftcon:42.000000
 119  DivF  === _ 75 118  [[ 169 157 176 ]]  !orig=[163],[123] !jvms: TestDuplicateBackedge::test @ bci:20 (line 52)
 121  AddI  === _ 76 22  [[ 132 144 76 126 126 ]]  !orig=[124] !jvms: TestDuplicateBackedge::test @ bci:25 (line 54)
 122  MulF  === _ 75 118  [[ 176 75 126 ]]  !orig=[123] !jvms: TestDuplicateBackedge::test @ bci:31 (line 55)
 125  ConI  === 0  [[ 132 126 157 162 ]]  #int:1000
 126  SafePoint  === 110 1 7 1 1 131 122 121 121 125  [[ 134 ]]  SafePoint  !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 128  ThreadLocal  === 0  [[ 130 ]]  !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 129  ConL  === 0  [[ 130 ]]  #long:48
 130  AddP  === _ 1 128 129  [[ 131 159 ]]  !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 131  LoadP  === 110 7 130  [[ 126 ]]  @rawptr:BotPTR, idx=Raw; #rawptr:BotPTR (does not depend only on test, raw access) !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 132  CmpI  === _ 121 125  [[ 133 ]]  !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 133  Bool  === _ 132  [[ 134 ]] [lt] !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 134  If  === 126 133  [[ 135 175 ]] P=0.983339, C=43106.101562 !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 135  IfTrue  === 134  [[ 140 ]] #1 !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 139  Return  === 174 6 7 8 9 returns 176  [[ 0 ]] 
 140  Loop  === 140 167 135  [[ 140 76 75 109 141 ]] inner  !orig=[72] !jvms: TestDuplicateBackedge::test @ bci:4 (line 50)
 141  Phi  === 140 170 144  [[ 98 ]]  #int:-1..0 !orig=[97] !jvms: TestDuplicateBackedge::test @ bci:7 (line 50)
 143  ConI  === 0  [[ 170 ]]  #int:0
 144  RShiftI  === _ 121 96  [[ 141 ]]  !orig=[97] !jvms: TestDuplicateBackedge::test @ bci:7 (line 50)
 155  IfTrue  === 156  [[ 167 ]] #1 !orig=135 !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 156  If  === 157 161  [[ 155 173 ]] P=0.983339, C=4788.898926 !orig=134 !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 157  SafePoint  === 111 1 7 1 1 159 119 117 117 125  [[ 156 ]]  SafePoint  !orig=126 !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 159  LoadP  === 111 7 130  [[ 157 ]]  @rawptr:BotPTR, idx=Raw; #rawptr:BotPTR (does not depend only on test, raw access) !orig=131 !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 161  Bool  === _ 162  [[ 156 ]] [lt] !orig=133 !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 162  CmpI  === _ 117 125  [[ 161 ]]  !orig=132 !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 165  RShiftI  === _ 117 96  [[ 170 ]]  !orig=144,[97] !jvms: TestDuplicateBackedge::test @ bci:7 (line 50)
 167  Loop  === 167 5 155  [[ 167 140 168 169 170 ]] 
 168  Phi  === 167 22 117  [[ 76 ]]  #int !orig=76 !jvms: TestDuplicateBackedge::test @ bci:4 (line 50)
 169  Phi  === 167 21 119  [[ 75 ]]  #float !orig=75 !jvms: TestDuplicateBackedge::test @ bci:4 (line 50)
 170  Phi  === 167 143 165  [[ 141 ]]  #int:-1..0 !orig=141,[97] !jvms: TestDuplicateBackedge::test @ bci:7 (line 50)
 173  IfFalse  === 156  [[ 174 ]] #0 !orig=[136] !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 174  Region  === 174 173 175  [[ 174 139 176 ]]  !orig=[136] !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 175  IfFalse  === 134  [[ 174 ]] #0 !orig=[136] !jvms: TestDuplicateBackedge::test @ bci:37 (line 57)
 176  Phi  === 174 119 122  [[ 139 ]]  #float

SDE can be found here:
https://www.intel.com/content/www/us/en/developer/articles/tool/software-development-emulator.html
Comments
Assuming this is not a test bug but potentially same as JDK-8279888. ILW = Test fails due to unexpected IR shape (missing CountedLoop), single test with SDE -future, no workaround but disable compilation of affected method = MMH = P3
09-05-2025