[PATCH] D38212: [PowerPC] Add profitablilty check for conversion to mtctr loops

Lei Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 05:04:22 PDT 2017


lei created this revision.

Add profitability checks for modifying counted loops to use the `mtctr` instruction.

The latency of `mtctr` is only justified if there are more than 4 comparisons that will be removed as a result.

Usually counted loops are formed relatively early and before unrolling, so most low trip count loops often don't survive.  However we want to ensure that if they do, we do not mistakenly update them to `mtctr` loops.


https://reviews.llvm.org/D38212

Files:
  lib/Target/PowerPC/PPCCTRLoops.cpp
  test/CodeGen/PowerPC/ctr-minmaxnum.ll
  test/CodeGen/PowerPC/ctrloop-shortLoops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38212.116448.patch
Type: text/x-patch
Size: 4991 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170925/f25efac0/attachment.bin>


More information about the llvm-commits mailing list