<div dir="ltr">That's a good idea, thanks!<div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 21, 2018 at 7:25 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><span class="">
<br>
<div class="m_-2169122858877478035moz-cite-prefix">On 06/21/2018 01:07 PM, Jon
Chesterfield via llvm-dev wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi,
<div><br>
</div>
<div>Hexagon has a MIR pass for detecting loops that map onto
hardware support. I think a similar approach would be viable
for my target but am put off by the complexity of determining
whether a given loop is legal to transform.</div>
</div>
</blockquote>
<br></span>
I think that it is easier to do this legality checking at the IR
level (where we can take advantage of the ScalarEvolution analysis).
This is what PowerPC does (see lib/Target/PowerPC/<wbr>PPCCTRLoops.cpp).
I recommend that you take this approach if possible.<br>
<br>
-Hal<br></div></blockquote></div></div></div>