Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/jdk17u
Path: blob/master/test/hotspot/jtreg/compiler/loopopts/TestIdomAfterLoopUnswitching.java
64478 views
1
/*
2
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
/*
25
* @test
26
* @bug 8268261
27
* @summary Test idom data after unswitching loop following by full unroll.
28
* @run main/othervm -XX:CompileCommand=compileonly,TestIdomAfterLoopUnswitching::*
29
* -Xcomp -XX:-TieredCompilation TestIdomAfterLoopUnswitching
30
*/
31
32
public class TestIdomAfterLoopUnswitching {
33
34
public static void main(String[] k) {
35
test1();
36
test2();
37
}
38
39
public static void test1() {
40
float h = 0;
41
for (int j = 0; j < 3; ++j) {
42
float k = 9;
43
float[] fla = new float[2];
44
for (int n = 0; n < 5; ++n) {
45
if (j >= 1) {
46
if (n <= 1) {
47
h += k;
48
}
49
}
50
}
51
for (int l12 = 0; l12 < 9; ++l12) {
52
for (int o = 0; o < 1; ++o) {
53
fla[0] += 1.0f;
54
}
55
}
56
}
57
}
58
59
public static void test2() {
60
float[] fla = new float[1000];
61
for (int i = 0; i < 1000; i++) {
62
for (float fl2 : fla) {
63
fla[100] = 1.0f;
64
}
65
}
66
for (int i = 0; i < 3; i++) {
67
for (int j = 0; j < 14; j++) {
68
fla[2] = fla[j];
69
}
70
}
71
}
72
}
73
74