<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 20, 2016, at 11:30 PM, Chandler Carruth <<a href="mailto:chandlerc@gmail.com" class="">chandlerc@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi James and Hal, any update on this?<div class=""><br class=""></div><div class="">Last state I recall is that SimplifyCFG is partitioning the loop pass pipeline in two preventing LICM from running after LoopUnroll in the inside-out pass ordering.</div><div class=""><br class=""></div><div class="">It'd be really good to work on adding the missing functionality to LoopSimplifyCFG so we can switch to that and get a single loop pipeline. (We should also add other loop pass harnesses like LoopInstCombine necessary to expose the invariant code here).</div></div></div></blockquote>FWIW, I was going to look into it soon (maybe in a couple of weeks or so). But if anyone else handles it first, I’ll be happy too:)</div><div><br class=""></div><div>Michael<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">-Chandler<br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Feb 19, 2016 at 6:06 AM Chandler Carruth <<a href="mailto:chandlerc@gmail.com" class="">chandlerc@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">(Sorry for repeat mail for some, forgot to fix the mailing list address)<br class=""><br class=""><div class="gmail_quote"></div></div><div dir="ltr" class=""><div class="gmail_quote"><div dir="ltr" class="">On Mon, Feb 16, 2015 at 11:04 AM James Molloy <<a href="mailto:james.molloy@arm.com" target="_blank" class="">james.molloy@arm.com</a>> wrote:<br class=""></div></div></div><div dir="ltr" class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: jamesm<br class="">
Date: Mon Feb 16 12:59:54 2015<br class="">
New Revision: 229419<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=229419&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=229419&view=rev</a><br class="">
Log:<br class="">
Run LICM as part of the cleanup phase from the scalar optimizer.<br class="">
<br class="">
Things like LoopUnrolling can produce loop invariant values - make sure<br class="">
we pick them up.<br class=""></blockquote><div class=""><br class=""></div></div></div><div dir="ltr" class=""><div class="gmail_quote"><div style="font-size:13px;line-height:19.5px" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div class="">Sorry for the commit archaeology, but this patch really doesn't make sense to me.</div><div class=""><br class=""></div><div class="">In order to do this, we have to re-canonicalize all the loops and build a new loop pass manager to do LICM and nothing other than LICM. Notably, we don't do any of the other obvious loop passes afterward like loop deletion.</div><div class=""><br class=""></div><div class="">The explanation also doesn't completely make sense to me because of how the loop pass pipeline works. When we unroll an inner loop, we should start the loop pass pipeline again on the outer loop, which should allow LICM to see the suddenly invariant values.</div><div class=""><br class=""></div><div class="">I think that you may have been trying to fix symptoms of the loop pass pipeline being split up by function passes as described in PR24804. If that's the case, the fix really isn't to add a late LICM run, but to get the loop pass pipeline to be cohesive and complete.</div><div class=""><br class=""></div><div class="">And if we need to have two loop pass pipelines, we really need each of them to be "complete" loop optimization pipelines, including rotation, LICM, deletion, and unrolling (likely in that exact order).</div></div></div></div></div><div class=""><br class=""></div></div></div><div dir="ltr" class=""><div class="gmail_quote"><div class="">What do folks think? I'm about to land a test that should also make it more clear what the structure of the pass pipeline happens to be. Enhancements there would be welcome.</div><div class=""><br class=""></div><div class="">Also, it would be great to have functional test cases for what this catches James... Is there any hope of crafting one?</div></div></div><div dir="ltr" class=""><div class="gmail_quote"><div class=""><br class=""></div><div class="">-Chandler</div></div></div><div dir="ltr" class=""><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="">
Modified:<br class="">
    llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp<br class="">
<br class="">
Modified: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=229419&r1=229418&r2=229419&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=229419&r1=229418&r2=229419&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)<br class="">
+++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Mon Feb 16 12:59:54 2015<br class="">
@@ -259,6 +259,7 @@ void PassManagerBuilder::populateModuleP<br class="">
   MPM.add(createJumpThreadingPass());         // Thread jumps<br class="">
   MPM.add(createCorrelatedValuePropagationPass());<br class="">
   MPM.add(createDeadStoreEliminationPass());  // Delete dead stores<br class="">
+  MPM.add(createLICMPass());<br class="">
<br class="">
   addExtensionsToPM(EP_ScalarOptimizerLate, MPM);<br class="">
<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div></div></blockquote></div></div></div>
</div></blockquote></div><br class=""></body></html>