<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>We're not actively using this, but from a design perspective I'm
wondering if we should be using this or something like it. At the
moment, our various loop optimization assume mostly canonical
input. Some of the passes have been taught to deal with limited
amounts of non-canonical-ism, but there's a strong code simplicity
argument in favor of only handling canonical input and then having
something else canonicalize if necessary. Given our loop passes
are iterated to a fixed point, having that canonicalization done
in another loop pass seems appropriate. This pass seems like a
start down that path.</p>
<p>Since we don't really document this anywhere, let me describe
what I see as a canonical loop:</p>
<ul>
<li>Use LCSSA, and LoopSimplify form. Meaning no-uses of
instructions defined in loop outside of loop and phis of loop
exit blocks. Preheaders available. Unique (unshared) exit
blocks. <br>
</li>
<li>All trivial CSE done. I include both arithmetic and load
elimination for constant memory.<br>
</li>
<li>All instsimplify style simplifications available within the
loop and preheader done. There's an argument for doing
instcombine style optimizations within the loop as well, but
that's less clear to me. <br>
</li>
<li>All trivial LICM done. By this I mean LICM which does not
require aliasing or speculation safety logic. This is
Loop::makeInvariant. <br>
</li>
<li>All trivial branches discharged. By this I mean both
CFGSimplify style elimination of constant branch conditions, but
also CVP, KnownBits, and SCEV. (Today, this is often true on
entry to a loop pass manager, but is not upheld as passes run.)<br>
</li>
</ul>
To be clear, the above list is aspirational. We definitely don't do
all of the above today. :)<br>
<br>
Philip<br>
<br>
<div class="moz-cite-prefix">On 03/02/2018 04:36 PM, Vedant Kumar
via llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:D18FB05F-9CE4-42E2-8865-3E0B028DDF1E@apple.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
Hi,
<div class=""><br class="">
</div>
<div class="">I think we should remove the LoopInstSimplify pass,
as it has no test coverage and no users (afaik).</div>
<div class=""><br class="">
</div>
<div class="">If you are using the pass, or think that it should
stay in tree for some other reason, please let me know.</div>
<div class=""><br class="">
</div>
<div class="">Here's the patch: <a
href="https://reviews.llvm.org/D44053" class=""
moz-do-not-send="true">https://reviews.llvm.org/D44053</a></div>
<div class=""><br class="">
</div>
<div class="">vedant</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>
</body>
</html>