<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">If the inner loop can be flatten [1] (not sure if I use the right word), which means transforming the nested loop into 1-level loop, I think you can continue using your pass on it.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">[1] <a href="https://stackoverflow.com/questions/18369260/flattening-a-very-nested-loop">https://stackoverflow.com/questions/18369260/flattening-a-very-nested-loop</a></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">HTH,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">chenwj</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-10-22 13:51 GMT+08:00 Shen Liu via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi everyone,<div><br></div><div>I hope to implement a feature to transform an IR with "while" or "for" loops to a new IR with no loop. Instead, I just want to use if-else statements in the new IR to implement the original semantics.</div><div><br></div><div>I can easily write a transform pass to handle the 1-level loop case, but for nested loops it seems a little harder. </div><div><br></div><div>Can you show me some hints? Thank you very much!</div><div><br></div><div>Best regards,</div><div><br></div><div>Shen</div></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Wei-Ren Chen (陳韋任)<br>Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" target="_blank">https://people.cs.nctu.edu.tw/~chenwj</a></div></div></div>
</div>