* loop unswitching
@ 2007-05-27 21:29 ranjith kumar
0 siblings, 0 replies; only message in thread
From: ranjith kumar @ 2007-05-27 21:29 UTC (permalink / raw)
To: gcc-help
It is said that gcc implements loop unswitching on
SSA and RTL representations.
At the same time, in this link
http://gcc.gnu.org/projects/tree-ssa/vectorization.html
it is said that loop unswitching is not done to
overcome branch statements to vectorize loops.
When I run a simple code which has a loop with 'if'
statement gcc-4.1.2 is unable to vectorize loop.
The prg is at bottom. It was compiled as 'gcc
-march=pentium4 -O3 -S -ftree-vectorize'
-funswitch-loops 6.c
Can anyone resolve this ambiguity?
--------------------------------------------------------
1 #include<stdio.h>
2
3 int main()
4 {
5
6 int c[100],a[100],b[100];
7 int i,j,n=80;
8 for(i=0;i<n;i++)
9 a[i]=b[i]=c[i]=i;
10
11 for (i=0;i<n;i++)
12 {
13 a[i] = b[i]-1;
14 if(c[i])
15 c[i]=b[i]*2;
16 //b[i+10] = a[i]+5;
17 }
18
19 for (i=0;i<n;i++)
20 printf("\n %d %d %d\n",b[i],c[i],a[i]);
21 }
___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-05-27 18:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-27 21:29 loop unswitching ranjith kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).