RFR: 8328528: C2 should optimize long-typed parallel iv in an int counted loop [v8]

Emanuel Peter epeter at openjdk.org
Tue Jul 23 09:54:36 UTC 2024


On Mon, 22 Jul 2024 20:41:15 GMT, Kangcheng Xu <kxu at openjdk.org> wrote:

>> Kangcheng Xu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   use @run driver and Argument.RANDOM_ONCE
>
> I'm observing a weird test [failure exposed by GHA](https://github.com/tabjy/jdk/actions/runs/10045677996/job/27764679129) that only happens on Linux x86. While there are no actual loop nodes, `LoopLimit` nodes are matched by the same regex. I'm currently looking into this:
> 
> - `LoopLimit` nodes are somehow not eliminated together with counted loops on 32bit Linux
> - the same binary bundle downloaded from GHA running on my local machine produces only one failure (instead of two) on `testIntCountedLoopWithIntIVWithRandomStrides(int)`
> - `LoopLimit` and `/(\d+(\s){2}(Loop.*)+(\s){2}===.*)/` being another case of [regex mis-match](https://github.com/openjdk/jdk/pull/18198#issuecomment-2214675206)?
> 
> 
> 2024-07-22T18:16:53.5547051Z One or more @IR rules failed:
> 2024-07-22T18:16:53.5547411Z 
> 2024-07-22T18:16:53.5547613Z Failed IR Rules (2) of Methods (2)
> 2024-07-22T18:16:53.5548249Z ----------------------------------
> 2024-07-22T18:16:53.5550118Z 1) Method "private static int compiler.loopopts.parallel_iv.TestParallelIvInIntCountedLoop.testIntCountedLoopWithIntIVWithRandomStrides(int)" - [Failed IR rules: 1]:
> 2024-07-22T18:16:53.5553610Z    * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={}, failOn={"_#LOOP#_", "_#COUNTED_LOOP#_"}, applyIfPlatform={}, applyIfPlatformOr={}, applyIfOr={}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={}, applyIfAnd={}, applyIfNot={})"
> 2024-07-22T18:16:53.5556263Z      > Phase "PrintIdeal":
> 2024-07-22T18:16:53.5557150Z        - failOn: Graph contains forbidden nodes:
> 2024-07-22T18:16:53.5557912Z          * Constraint 1: "(\d+(\s){2}(Loop.*)+(\s){2}===.*)"
> 2024-07-22T18:16:53.5558668Z            - Matched forbidden node:
> 2024-07-22T18:16:53.5559308Z              * 127  LoopLimit  === _ 22 10 83  [[ 128 ]] 
> 2024-07-22T18:16:53.5559791Z 
> 2024-07-22T18:16:53.5561343Z 2) Method "private static long compiler.loopopts.parallel_iv.TestParallelIvInIntCountedLoop.testIntCountedLoopWithLongIVWithRandomStrides(int)" - [Failed IR rules: 1]:
> 2024-07-22T18:16:53.5565173Z    * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={}, failOn={"_#LOOP#_", "_#COUNTED_LOOP#_"}, applyIfPlatform={}, applyIfPlatformOr={}, applyIfOr={}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={}, applyIfAnd={}, applyIfNot={})"
> 2024-07-22T18:16:53.5567518Z      > Phase "PrintIdeal":
> 2024-07-22T18:16:53.5568180Z        - failOn: G...

@tabjy Yes, looks like the 32-bit VM behaves different. Do you know what makes the difference here?
Yes, looks like regex-matching is also confused here, we should probably address that.
If the difference of the 32-bit vs 64-bit turns out to be expected: you can just do this:
`test/hotspot/jtreg/compiler/loopopts/superword/RedTest_long.java:        applyIfPlatform = {"64-bit", "true"},`

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18489#issuecomment-2244762387


More information about the hotspot-compiler-dev mailing list