Path: blob/master/test/hotspot/jtreg/compiler/loopopts/TestIdomAfterLoopUnswitching.java
64478 views
/*1* Copyright (c) 2021, Oracle and/or its affiliates. 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 826826126* @summary Test idom data after unswitching loop following by full unroll.27* @run main/othervm -XX:CompileCommand=compileonly,TestIdomAfterLoopUnswitching::*28* -Xcomp -XX:-TieredCompilation TestIdomAfterLoopUnswitching29*/3031public class TestIdomAfterLoopUnswitching {3233public static void main(String[] k) {34test1();35test2();36}3738public static void test1() {39float h = 0;40for (int j = 0; j < 3; ++j) {41float k = 9;42float[] fla = new float[2];43for (int n = 0; n < 5; ++n) {44if (j >= 1) {45if (n <= 1) {46h += k;47}48}49}50for (int l12 = 0; l12 < 9; ++l12) {51for (int o = 0; o < 1; ++o) {52fla[0] += 1.0f;53}54}55}56}5758public static void test2() {59float[] fla = new float[1000];60for (int i = 0; i < 1000; i++) {61for (float fl2 : fla) {62fla[100] = 1.0f;63}64}65for (int i = 0; i < 3; i++) {66for (int j = 0; j < 14; j++) {67fla[2] = fla[j];68}69}70}71}727374