<div dir="ltr">Nothing uses the array after the loop and the program exits after that. Thus the compiler optimized out the loop because the computation was unnecessary. It had not affect on the observable behavior of the program.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br><div class="gmail_quote">On Fri, Nov 10, 2017 at 1:24 PM, hameeza ahmed <span dir="ltr"><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div>I am trying to vectorize copy statement in LLVM but unable to do so why? my code is follows:</div><div><br></div><div><div>int main()</div><div><br></div><div>{</div><div><br></div><div>int c[2048], a[2048];</div><div><br></div><div>for (int j=0; j<2048; j++)</div><div><br></div><div><span style="white-space:pre-wrap">   </span>  { a[j]=2;</div><div>  c[j] = a[j];</div><div><br></div><div>}</div></div><div>}</div><div><br></div><div>the command is follows:</div><div>opt  -S -O3 -force-vector-width=64 s.ll -o s_o3.ll<br></div><div><br></div><div>how to do this?</div></div>
</blockquote></div><br></div>