<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">On 06/21/2018 01:07 PM, Jon
      Chesterfield via llvm-dev wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAOUYtQBiB_6YL_pTPc-sE7NTg_skhQX+J2geEOFoX8ZnDVA-uw@mail.gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <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>
    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/PPCCTRLoops.cpp).
    I recommend that you take this approach if possible.<br>
    <br>
     -Hal<br>
    <br>
    <blockquote type="cite"
cite="mid:CAOUYtQBiB_6YL_pTPc-sE7NTg_skhQX+J2geEOFoX8ZnDVA-uw@mail.gmail.com">
      <div dir="ltr">
        <div><br>
        </div>
        <div>Instead, I would like to pass the responsibility for
          determining legality onto the C programmer who is assumed
          sufficiently familiar with the architecture.</div>
        <div><br>
        </div>
        <div>I think this would require a pair of intrinsics to denote
          the start and end of the loop. Is there a reasonable way to
          model this in llvm?</div>
        <div><br>
        </div>
        <div>If not, would anyone suggest a compiler programmer
          friendly, even if application programmer hostile, way to
          target a loop instruction with many constraints on validity.</div>
        <div><br>
        </div>
        <div>Thanks!</div>
        <div><br>
        </div>
        <div>Jon</div>
      </div>
      <!--'"--><br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
  </body>
</html>