forked from ibmruntimes/openj9-openjdk-jdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
483 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
test/hotspot/jtreg/compiler/c2/TestCastX2NotProcessedIGVN.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Copyright (c) 2024, Red Hat, Inc. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
package compiler.c2; | ||
|
||
import compiler.lib.ir_framework.*; | ||
import jdk.internal.misc.Unsafe; | ||
|
||
/* | ||
* @test | ||
* @bug 8343068 | ||
* @summary C2: CastX2P Ideal transformation not always applied | ||
* @modules java.base/jdk.internal.misc | ||
* @library /test/lib / | ||
* @run driver compiler.c2.TestCastX2NotProcessedIGVN | ||
*/ | ||
|
||
public class TestCastX2NotProcessedIGVN { | ||
private static final Unsafe UNSAFE = Unsafe.getUnsafe(); | ||
static int size = 1024; | ||
static long base = UNSAFE.allocateMemory(4 * size); | ||
|
||
|
||
public static void main(String[] args) { | ||
TestFramework.runWithFlags("--add-modules", "java.base", "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED"); | ||
} | ||
|
||
@Test | ||
@IR(failOn = IRNode.ADD_L, counts = {IRNode.ADD_P, "1"}) | ||
public static byte test1(long base) { | ||
int offset = 0; | ||
do { | ||
offset++; | ||
} while (offset < 100); | ||
long longOffset = ((long) offset) * 2; | ||
return UNSAFE.getByte(null, base + longOffset); | ||
} | ||
|
||
@Run(test = "test1") | ||
public static void test1Runner() { | ||
test1(base); | ||
} | ||
|
||
@Test | ||
@IR(counts = {IRNode.LOAD_VECTOR_I, "> 1"}) | ||
public static int test2(int stop, int[] array) { | ||
int v = 0; | ||
stop = Math.min(stop, Integer.MAX_VALUE / 4); | ||
for (int i = 0; i < stop; i++) { | ||
long offset = ((long)i) * 4; | ||
array[i] = UNSAFE.getInt(null, offset + base); | ||
} | ||
return v; | ||
} | ||
|
||
@Run(test = "test2") | ||
public static void test2Runner() { | ||
test2(size, new int[size]); | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
test/hotspot/jtreg/compiler/c2/TestMatcherTwoImmOffsets.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
/** | ||
* @test | ||
* @bug 8339303 | ||
* @summary Test that the matcher does not create dead nodes when matching | ||
* address expressions with two immediate offsets. | ||
* @requires os.maxMemory > 4G | ||
* | ||
* @run main/othervm -Xmx4g -Xbatch -XX:-TieredCompilation | ||
* -XX:CompileOnly=compiler.c2.TestMatcherTwoImmOffsets::test | ||
* compiler.c2.TestMatcherTwoImmOffsets | ||
*/ | ||
|
||
package compiler.c2; | ||
|
||
public class TestMatcherTwoImmOffsets { | ||
static final int[] a1 = new int[10]; | ||
int[] a2; | ||
static TestMatcherTwoImmOffsets o = new TestMatcherTwoImmOffsets(); | ||
|
||
public static void test() { | ||
for (int i = 0; i < 10; i++) { | ||
for (int j = 0; j < 100; j++) { | ||
int[][] nArray = new int[10][]; | ||
for (int k = 0; k < nArray.length; k++) {} | ||
} | ||
for (long j = 1L; j < 3L; j++) { | ||
a1[(int) j]--; | ||
} | ||
o.a2 = a1; | ||
} | ||
} | ||
|
||
public static void main(String[] args) { | ||
for (int i = 0; i < 10; i++) { | ||
test(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
test/hotspot/jtreg/compiler/vectorization/TestReplicateAtConv.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2024, Red Hat, Inc. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
/** | ||
* @test | ||
* @bug 8341834 | ||
* @summary C2 compilation fails with "bad AD file" due to Replicate | ||
* @run main/othervm -XX:CompileCommand=compileonly,TestReplicateAtConv::test -Xcomp TestReplicateAtConv | ||
*/ | ||
|
||
public class TestReplicateAtConv { | ||
public static long val = 0; | ||
|
||
public static void test() { | ||
int array[] = new int[500]; | ||
|
||
for (int i = 0; i < 100; i++) { | ||
for (long l = 100; l > i; l--) { | ||
val = 42 + (l + i); | ||
array[(int)l] = (int)l - (int)val; | ||
} | ||
} | ||
} | ||
|
||
public static void main(String[] args) { | ||
test(); | ||
} | ||
} |
Oops, something went wrong.