[PATCH] D63921: [Loop Peeling] Add support for peeling of loops with multiple exits

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 04:59:44 PDT 2019


fhahn added inline comments.


================
Comment at: lib/Transforms/Utils/LoopUnroll.cpp:412
       Preheader = L->getLoopPreheader();
       ULO.TripCount = SE->getSmallConstantTripCount(L, ExitingBlock);
       ULO.TripMultiple = SE->getSmallConstantTripMultiple(L, ExitingBlock);
----------------
skatkov wrote:
> fhahn wrote:
> > IIRC TripCount and TripMultiple would not be set for multi-exit loops (in LoopUnrollPass.cpp), but MaxTripCount would. But maybe I am missing the reasoning behind choosing the trip count of one of the exits?
> It is not only for multi exit but also for single exit.
> We support other exits only for deopts, so no need to worry about them.
> We support other exits only for deopts, so no need to worry about them.

Right, I missed that restriction. I think it is fine to have this restriction to start with, but it would be good to explicitly mention that here in a comment and in the commit message.




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63921/new/

https://reviews.llvm.org/D63921





More information about the llvm-commits mailing list