Auto-vectorization with gcj

Andrew Haley aph@redhat.com
Sun May 15 13:49:00 GMT 2005


Dietmar Lippold writes:
 > I tried to test auto-vectorization with the following java program:
 > 
 > public class Test {
 > private static int[] a = new int[256];
 > private static int[] b = new int[256];
 > private static int[] c = new int[256];
 > 
 > public static final void main(String[] args) {
 > for (int i = 0; i < 256; i++) {
 > b[i] = i;
 > c[i] = i;
 > }
 > for (int i = 0; i < 256; i++) {
 > a[i] = b[i] + c[i];
 > }
 > }
 > }
 > 
 > When I compile it with
 > 
 > gcj -msse2 -O2 -ftree-vectorize -ftree-vectorizer-verbose=5 -c Test.java
 > 
 > I get the following message:
 > 
 > Test.java:9: note: not vectorized: multiple exits.
 > Test.java:14: note: not vectorized: multiple exits.
 > Test.java:7: note: vectorized 0 loops in function.
 > 
 > Is it not possible to use auto-vectorization with gcj until now?
Not as far as I am aware, no. You may be the first person ever to
try it.
I don't know why the compiler believes the loops have multiple exits.
If you want to find out, it's time to start looking at dumps.
Andrew.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /