Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/compiler/loopopts/TestBrokenAntiDependenceWithPhi.java
41149 views
1
/*
2
* Copyright (c) 2021, Red Hat, Inc. 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 8259641
27
* @summary C2: assert(early->dominates(LCA)) failed: early is high enough
28
*
29
* @run main/othervm -Xcomp -XX:CompileOnly=TestBrokenAntiDependenceWithPhi TestBrokenAntiDependenceWithPhi
30
*
31
*/
32
33
public class TestBrokenAntiDependenceWithPhi {
34
35
int a;
36
int b;
37
byte c;
38
39
long e(int f, int g, long h) {
40
int i[] = new int[a];
41
double j = 2.74886;
42
long k[][] = new long[a][a];
43
long l = checkSum(k);
44
return l;
45
}
46
47
void m() {
48
int s, o, p[] = new int[a];
49
double d;
50
for (d = 5; d < 388; d++) {
51
e(b, b, 40418347472393L);
52
for (s = 3; s < 66; ++s)
53
int1array(a, 9);
54
}
55
for (o = 6; o > 2; o--)
56
p[o] = c;
57
}
58
59
public static void main(String[] q) {
60
TestBrokenAntiDependenceWithPhi r = new TestBrokenAntiDependenceWithPhi();
61
try {
62
r.m();
63
} catch (ArrayIndexOutOfBoundsException aioobe) {
64
}
65
}
66
67
public static long checkSum(long[] a) {
68
long sum = 0;
69
for (int j = 0; j < a.length; j++) {
70
sum += (a[j] / (j + 1) + a[j] % (j + 1));
71
}
72
return sum;
73
}
74
75
public static long checkSum(long[][] a) {
76
long sum = 0;
77
for (int j = 0; j < a.length; j++) {
78
sum += checkSum(a[j]);
79
}
80
return sum;
81
}
82
83
public static int[] int1array(int sz, int seed) {
84
int[] ret = new int[sz];
85
init(ret, seed);
86
return ret;
87
}
88
89
public static void init(int[] a, int seed) {
90
for (int j = 0; j < a.length; j++) {
91
a[j] = (j % 2 == 0) ? seed + j : seed - j;
92
}
93
}
94
95
}
96
97