[PATCH] D32451: Improve profile-guided heuristics to use estimated trip count.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 20 06:40:56 PDT 2017


Ayal added a comment.

Thanks @twoh - this looks fine to me, and is pending @mkuper's approval following his original concern:

In https://reviews.llvm.org/D32451#735959, @mkuper wrote:

> When I tried to play with this kind of thing, I got rather inconsistent performance results, because of things like a cold loop within a relatively hot loop.
>  Do you have any performance numbers for this?


Having lifted the OptForSize constraint when vectorizing cold loops, do you see any increase in compile-time / code-size when compiling with profile information?

A follow-up thought raised by this patch, which deserves a separate discussion/patch: should loops whose trip-count is smaller than TinyTripCountVectorThreshold, statically or by profile, be vectorized under OptForSize constraint rather than non-vectorized? The OptForSize constraint implies little if any overheads outside of the vectorized loop body, so the current cost estimate of the vectorized-vs-scalar loop body should hopefully be more/sufficiently accurate.


https://reviews.llvm.org/D32451





More information about the llvm-commits mailing list