[PATCH] D25963: [LoopUnroll] Implement profile-based loop peeling

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 11:51:45 PST 2016


mkuper added inline comments.


================
Comment at: include/llvm/Transforms/Utils/LoopUtils.h:465
+/// \brief Get a loop's estimated trip count based on branch weight metadata.
+unsigned getLoopEstimatedTripCount(Loop *L);
+
----------------
danielcdh wrote:
> danielcdh wrote:
> > Is it possible to have this helper function in another patch (maybe NFC) and submit it first? I'd like to use it in another patch: https://reviews.llvm.org/D26527. Or if this patch is going in pretty soon, it's also fine. Thanks.
> Also, this function does not distinguish between "0-trip count" and "unknown tripcount". Maybe change the return value to int so that <0 means unknown tripcount? Or simply use Optional<unsigned> as return value.
I hope this can go in pretty soon. :-)

In any case, I'd rather not commit unused API as an NFC patch, but feel free to "steal" this into your patch in case that goes in first.
Re "0-trip count" and "unknown trip count" - fair point. I'll change the interface to use Optional<>.


https://reviews.llvm.org/D25963





More information about the llvm-commits mailing list