hotspot/test/compiler/loopopts/superword/TestBestAlign.java
author kvn
Tue, 10 Nov 2015 21:36:35 -0800
changeset 34168 dbdc6907b55d
child 35594 cc13089c6327
permissions -rw-r--r--
8141624: Limit calculation of pre loop during super word optimization is wrong Reviewed-by: vlivanov, kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34168
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
     1
/*
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
     2
 * Copyright 2015 SAP AG.  All Rights Reserved.
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
     4
 *
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
     7
 * published by the Free Software Foundation.
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
     8
 *
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    13
 * accompanied this code).
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    14
 *
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    18
 *
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    21
 * questions.
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    22
 */
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    23
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    24
/*
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    25
 * @test
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    26
 * @bug 8141624
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    27
 * @summary Limit calculation of pre loop during super word optimization is wrong
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    28
 * @run main/othervm TestBestAlign
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    29
 * @author gunter.haug@sap.com
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    30
 */
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    31
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    32
public class TestBestAlign {
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    33
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    34
    static final int initVal = -1;
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    35
    static int intArray [];
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    36
    static boolean boolArray[];
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    37
    static int limit;
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    38
    static public void clear() {
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    39
        for (int i = 0; i < limit; i++) {
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    40
            boolArray[1] = true;
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    41
            intArray[i] = initVal;
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    42
            boolArray[2] = true;
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    43
        }
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    44
    }
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    45
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    46
    public static void main(String argv[]) throws Exception {
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    47
        limit = 64;
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    48
        boolArray = new boolean[8];
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    49
        intArray = new int[limit + 4];
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    50
        for (int i = 0; i < 10000000; ++i) {
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    51
            if(i % 1000000 == 0)
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    52
                System.out.println(i);
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    53
            clear();
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    54
        }
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    55
    }
dbdc6907b55d 8141624: Limit calculation of pre loop during super word optimization is wrong
kvn
parents:
diff changeset
    56
}