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 8078262
27 * @summary Tests correct dominator information after loop peeling.
28 * @run main/othervm -Xcomp -XX:CompileCommand=compileonly,TestLoopPeeling::test* TestLoopPeeling
29 */
30 public class TestLoopPeeling {
31
32 public int[] array = new int[100];
33
34 public static void main(String args[]) {
35 TestLoopPeeling test = new TestLoopPeeling();
36 try {
37 test.testArrayAccess(0, 1);
38 test.testArrayAllocation(0, 1);
39 } catch (Exception e) {
40 // Ignore exceptions
41 }
42 }
43
44 public void testArrayAccess(int index, int inc) {
45 int storeIndex = -1;
46
47 for (; index < 10; index += inc) {
48 // This loop invariant check triggers loop peeling because it can
49 // be moved out of the loop (see 'IdealLoopTree::policy_peeling').
|
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 8078262
27 * @summary Tests correct dominator information after loop peeling.
28 *
29 * @run main/othervm -Xcomp
30 * -XX:CompileCommand=compileonly,compiler.loopopts.TestLoopPeeling::test*
31 * compiler.loopopts.TestLoopPeeling
32 */
33
34 package compiler.loopopts;
35
36 public class TestLoopPeeling {
37
38 public int[] array = new int[100];
39
40 public static void main(String args[]) {
41 TestLoopPeeling test = new TestLoopPeeling();
42 try {
43 test.testArrayAccess(0, 1);
44 test.testArrayAllocation(0, 1);
45 } catch (Exception e) {
46 // Ignore exceptions
47 }
48 }
49
50 public void testArrayAccess(int index, int inc) {
51 int storeIndex = -1;
52
53 for (; index < 10; index += inc) {
54 // This loop invariant check triggers loop peeling because it can
55 // be moved out of the loop (see 'IdealLoopTree::policy_peeling').
|