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

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 15:36:45 PDT 2017


nemanjai added inline comments.


================
Comment at: test/CodeGen/PowerPC/ctr-minmaxnum.ll:63
 ; QPX-LABEL: test1v:
-; QPX: mtctr
 ; QPX-NOT: bl fminf
----------------
lei wrote:
> 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.
Well, there are still two open questions here:
- Is this something we want on the A2 cores or would we **always** want an `mtctr`?
- can we add a "trip count >= 4" test case for the A2 core as well?


https://reviews.llvm.org/D38212





More information about the llvm-commits mailing list