[PATCH] D32451: Improve profile-guided heuristics to use estimated trip count.
Taewook Oh via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 24 13:50:09 PDT 2017
twoh created this revision.
Herald added a subscriber: mzolotukhin.
Existing heuristic uses the ratio between the function entry
frequency and the loop invocation frequency to find cold loops. However,
even if the loop executes frequently, if it has a small trip count per
each invocation, vectorization is not beneficial. On the other hand,
even if the loop invocation frequency is much smaller than the function
invocation frequency, if the trip count is high it is still beneficial
to vectorize the loop.
This patch uses estimated trip count computed from the profile metadata
as a primary metric to determine coldness of the loop. If the estimated
trip count cannot be computed, it falls back to the original heuristics.
https://reviews.llvm.org/D32451
Files:
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/tripcount.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32451.96460.patch
Type: text/x-patch
Size: 8266 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170424/8f83e7a7/attachment.bin>
More information about the llvm-commits
mailing list