[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 15:04:23 PDT 2017


lei added inline comments.


================
Comment at: test/CodeGen/PowerPC/ctr-minmaxnum.ll:63
 ; QPX-LABEL: test1v:
-; QPX: mtctr
 ; QPX-NOT: bl fminf
----------------
hfinkel wrote:
> Please update the trip counts on these tests so we don't lose coverage.
This test case verifies that for short loops with a trip count of 2, we don't generate `mtctr` for for pwr7+ but we do generate `mtctr` for bluegene.  On power, these short loops are usually unrolled and never make it this far so naturally we don't see `mtctr`.  However now that we put in a check to not use `mtctr` for short loops, we should not see this instruction anymore even for short loops which were not unrolled previously.  As far as I can tell this should be the desired behaviour now.  Unless I am missing something, I don't think we are losing any coverage here.

I have added test case below to ensure we still generate the mtctr loops for trip counts >= 4.


https://reviews.llvm.org/D38212





More information about the llvm-commits mailing list