Huan Luo
2013-01-17 07:25:41 UTC
Hi,
Lately we've been trying to use open64 to vectorize our
program and dump the tree for later analysis. But we are not
sure which option is available. Could anybody tell us?
A similar purpose can be achieved by gcc. For example:
fun.c
===========================================
int i, j;
int a[1024], b[1024], c[1024];
main()
{
for (i=0; i<100; i++) {
a[i]=a[i]+b[i]*c[i];
}
}
============================================
We use the option -ftree-vectorize to apply vectorization, and
-fdump-tree-uncprop to dump the functions after vectorization.
the command is:
gcc -O -dA -msse2 -ffast-math -ftree-vectorize -fdump-tree-uncprop fun.c
and the file looks like this:
fun.c.136t.uncprop
============================================
;; Function main (main) (executed once)
main ()
{
long unsigned int ivtmp.30;
vector(4) int vect_var_.21;
vector(4) int vect_var_.20;
vector(4) int vect_var_.19;
vector(4) int vect_var_.14;
vector(4) int vect_var_.9;
<bb 2>:
<bb 3>:
# ivtmp.30_15 = PHI <ivtmp.30_7(3), 0(2)>
vect_var_.9_18 = MEM[symbol: a, index: ivtmp.30_15, offset: 0B];
vect_var_.14_22 = MEM[symbol: b, index: ivtmp.30_15, offset: 0B];
vect_var_.19_26 = MEM[symbol: c, index: ivtmp.30_15, offset: 0B];
vect_var_.20_27 = vect_var_.14_22 * vect_var_.19_26;
vect_var_.21_28 = vect_var_.9_18 + vect_var_.20_27;
MEM[symbol: a, index: ivtmp.30_15, offset: 0B] = vect_var_.21_28;
ivtmp.30_7 = ivtmp.30_15 + 16;
if (ivtmp.30_7 != 400)
goto <bb 3>;
else
goto <bb 4>;
<bb 4>:
i = 100;
return;
}
============================================
However, gcc is not enough for analysis. So I wonder if there is a way to do it in open64
and maybe it will provide more convenience than gcc.
Your help would be greatly appreciated.
--
Best wishes.
Huan Luo
Lately we've been trying to use open64 to vectorize our
program and dump the tree for later analysis. But we are not
sure which option is available. Could anybody tell us?
A similar purpose can be achieved by gcc. For example:
fun.c
===========================================
int i, j;
int a[1024], b[1024], c[1024];
main()
{
for (i=0; i<100; i++) {
a[i]=a[i]+b[i]*c[i];
}
}
============================================
We use the option -ftree-vectorize to apply vectorization, and
-fdump-tree-uncprop to dump the functions after vectorization.
the command is:
gcc -O -dA -msse2 -ffast-math -ftree-vectorize -fdump-tree-uncprop fun.c
and the file looks like this:
fun.c.136t.uncprop
============================================
;; Function main (main) (executed once)
main ()
{
long unsigned int ivtmp.30;
vector(4) int vect_var_.21;
vector(4) int vect_var_.20;
vector(4) int vect_var_.19;
vector(4) int vect_var_.14;
vector(4) int vect_var_.9;
<bb 2>:
<bb 3>:
# ivtmp.30_15 = PHI <ivtmp.30_7(3), 0(2)>
vect_var_.9_18 = MEM[symbol: a, index: ivtmp.30_15, offset: 0B];
vect_var_.14_22 = MEM[symbol: b, index: ivtmp.30_15, offset: 0B];
vect_var_.19_26 = MEM[symbol: c, index: ivtmp.30_15, offset: 0B];
vect_var_.20_27 = vect_var_.14_22 * vect_var_.19_26;
vect_var_.21_28 = vect_var_.9_18 + vect_var_.20_27;
MEM[symbol: a, index: ivtmp.30_15, offset: 0B] = vect_var_.21_28;
ivtmp.30_7 = ivtmp.30_15 + 16;
if (ivtmp.30_7 != 400)
goto <bb 3>;
else
goto <bb 4>;
<bb 4>:
i = 100;
return;
}
============================================
However, gcc is not enough for analysis. So I wonder if there is a way to do it in open64
and maybe it will provide more convenience than gcc.
Your help would be greatly appreciated.
--
Best wishes.
Huan Luo