<div dir="ltr">Thanks Arnold, r192460.<div><br></div><div>--renato</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 11 October 2013 17:11, Arnold Schwaighofer <span dir="ltr"><<a href="mailto:aschwaighofer@apple.com" target="_blank">aschwaighofer@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">LGTM.<br>
<br>
Thanks.<br>
<br>
On Oct 11, 2013, at 9:45 AM, Renato Golin <<a href="mailto:renato.golin@linaro.org">renato.golin@linaro.org</a>> wrote:<br>
<br>
> Hi nadav,<br>
><br>
> Just moving code around to make it easier to spot basic-blocks of loops that can't be if-converted. No functional change.<br>
><br>
> <a href="http://llvm-reviews.chandlerc.com/D1897" target="_blank">http://llvm-reviews.chandlerc.com/D1897</a><br>
><br>
> Files:<br>
> lib/Transforms/Vectorize/LoopVectorize.cpp<br>
><br>
> Index: lib/Transforms/Vectorize/LoopVectorize.cpp<br>
> ===================================================================<br>
> --- lib/Transforms/Vectorize/LoopVectorize.cpp<br>
> +++ lib/Transforms/Vectorize/LoopVectorize.cpp<br>
> @@ -2745,19 +2745,17 @@<br>
> if (!TheLoop->getExitingBlock())<br>
> return false;<br>
><br>
> - unsigned NumBlocks = TheLoop->getNumBlocks();<br>
> + // We need to have a loop header.<br>
> + DEBUG(dbgs() << "LV: Found a loop: " <<<br>
> + TheLoop->getHeader()->getName() << '\n');<br>
><br>
> // Check if we can if-convert non single-bb loops.<br>
> + unsigned NumBlocks = TheLoop->getNumBlocks();<br>
> if (NumBlocks != 1 && !canVectorizeWithIfConvert()) {<br>
> DEBUG(dbgs() << "LV: Can't if-convert the loop.\n");<br>
> return false;<br>
> }<br>
><br>
> - // We need to have a loop header.<br>
> - BasicBlock *Latch = TheLoop->getLoopLatch();<br>
> - DEBUG(dbgs() << "LV: Found a loop: " <<<br>
> - TheLoop->getHeader()->getName() << '\n');<br>
> -<br>
> // ScalarEvolution needs to be able to find the exit count.<br>
> const SCEV *ExitCount = SE->getBackedgeTakenCount(TheLoop);<br>
> if (ExitCount == SE->getCouldNotCompute()) {<br>
> @@ -2766,6 +2764,7 @@<br>
> }<br>
><br>
> // Do not loop-vectorize loops with a tiny trip count.<br>
> + BasicBlock *Latch = TheLoop->getLoopLatch();<br>
> unsigned TC = SE->getSmallConstantTripCount(TheLoop, Latch);<br>
> if (TC > 0u && TC < TinyTripCountVectorThreshold) {<br>
> DEBUG(dbgs() << "LV: Found a loop with a very small trip count. " <<<br>
> <D1897.1.patch>_______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br>
</blockquote></div><br></div>