<div dir="ltr">Hello, <div>I have written the following code. when i try to vectorize it through opt. i am not getting vectorized instructions.</div><div><br></div><div><div>#include <stdio.h></div><div>#include<stdlib.h></div><div>int main(int argc, char** argv) {</div><div>int sum=0; int a=atoi(argv[1]); int b=atoi(argv[2]);</div><div>for (int i=0;i<1000;i++)</div><div>{</div><div>sum+=a+b;<br></div><div>}</div><div><br></div><div>printf("sum: %d\n", sum);</div><div>return 0;</div><div>}</div></div><div>i use following commands:</div><div><div>clang  -S -emit-llvm sum-main.c -march=knl -O3 -mllvm -disable-llvm-optzns -o sum-main.ll</div></div><div><div>opt  -S -O3 -force-vector-width=64 sum-main.ll -o sum-main03.ll</div></div><div><br></div><div>why is that so? where am i doing mistake? i am not getting vectorized operations rather getting scalar operations.</div><div><br></div><div>Please help.</div><div><br></div><div>Thank You</div><div><br></div><div>Regards</div><div><br></div></div>