<div dir="ltr">I've been told that clang/llc is handing because I'm creating a cycle in my instruction selection. I'm trying to figure out where exactly but unfortunately my knowledge is quite limited. I'd appreciate if someone could point me in the right direction. <div><br></div><div>Here is the test file I'm using:</div><div><div>#define N 32</div><div><br></div><div>int foo () {</div><div><br></div><div>  int a[N], b[N], c[N];</div><div><br></div><div>  for (int i = 0; i < N; ++i)</div><div>       c[i] = a[i] + b[i];</div><div><br></div><div>  int sum = 0;</div><div>  for (int i =0; i < N; i++)</div><div>    sum += c[i];</div><div><br></div><div>  return sum;</div><div><br></div><div>}</div><div><br></div><div>I generate a .ll file using<br></div><div><div>clang --target=esencia z.c -S -emit-llvm -o z.esencia.ll -O3</div></div><div><br></div><div>And then I run llc using</div><div><div>llc -mcpu=esencia -march=esencia z.esencia.ll -o z.esencia.s -O3 -debug-only=isel</div></div><div><br></div><div><br></div><div><div>setOperationAction(ISD::BUILD_VECTOR,      MVT::v4i32, Expand);</div><div>setOperationAction(ISD::EXTRACT_VECTOR_ELT,      MVT::v4i32, Expand);</div><div>setOperationAction(ISD::VECTOR_SHUFFLE,      MVT::v4i32, Expand);</div></div><div><br></div><div>At this point llc just hangs. I was explained that I create a cycle</div><div><br></div><div>I know that these three lines cause a problem (since none existed before I added them), but unfortunately my knowledge is limited and I have hard time understanding how I created it. Would someone be able to help me out?<br></div><div><br></div><div>The contents of the .ll file is located here: <a href="http://pastebin.com/daHnJWwB">http://pastebin.com/daHnJWwB</a></div><div><br></div><div>The output of the </div><div><br></div><div>llc -mcpu=esencia -march=esencia z.esencia.ll -o z.esencia.s -O3 -debug-only=isel</div><div><br></div><div>command is provided here: <a href="http://pastebin.com/ErDaxJ4J">http://pastebin.com/ErDaxJ4J</a></div><div><br></div><div>I realize that the output is quite big and would love find a way to reduce, but quite frankly I'm not sure how to do it. I tried using bugpoint but it hung as well.</div><div><br></div><div>I would really appreciate any help on this, i.e. how am i creating cycles and how to eliminate them?</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Rail Shafigulin<br></div>Software Engineer <br>Esencia Technologies<br></div></div></div></div>
</div></div>