Path: blob/master/test/hotspot/jtreg/compiler/loopstripmining/DeadNodesInOuterLoopAtLoopCloning.java
41152 views
/*1* Copyright (c) 2019, Red Hat, Inc. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/**24* @test25* @bug 823006126* @summary loop unrolling breaks when outer strip mined loop contains dead node27*28* @run main/othervm -Xmx1G DeadNodesInOuterLoopAtLoopCloning29*30*/3132public class DeadNodesInOuterLoopAtLoopCloning {3334public static final int N = 400;3536public static long instanceCount=-2288355609708559532L;3738public static double checkSum(double[] a) {39double sum = 0;40for (int j = 0; j < a.length; j++) {41sum += (a[j] / (j + 1) + a[j] % (j + 1));42}43return sum;44}4546public static int iMeth(double d1) {4748int i4=6022, i5=-211, i6=-15841, iArr[]=new int[N];49double d2=-8.78129, dArr[]=new double[N];5051i5 = 1;52do {53i6 = 1;54while (++i6 < 5) {55i4 = -933;56i4 *= i4;57dArr[i5 + 1] = i4;58i4 -= i4;59d2 = 1;60do {61iArr[(int)(d2 + 1)] += (int)instanceCount;62try {63i4 = (i4 % -51430);64i4 = (iArr[i6] % 31311);65iArr[i6 + 1] = (24197 / i5);66} catch (ArithmeticException a_e) {}67i4 -= (int)instanceCount;68i4 <<= i5;69i4 &= 12;70} while (++d2 < 1);71}72} while (++i5 < 320);73long meth_res = Double.doubleToLongBits(checkSum(dArr));74return (int)meth_res;75}7677public static void main(String[] strArr) {78DeadNodesInOuterLoopAtLoopCloning _instance = new DeadNodesInOuterLoopAtLoopCloning();79for (int i = 0; i < 10 * 320; i++ ) {80_instance.iMeth(0.8522);81}82}83}848586