[PATCH] D19950: Use frequency info to guide Loop Invariant Code Motion.

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 16:43:51 PDT 2016


hfinkel added a comment.

In http://reviews.llvm.org/D19950#425285, @davidxl wrote:

> Static prediction has been conservative in estimating loop trip count -- it produces something like 30ish iterations. If the a very hot loop has a big if-then-else (or switch), it is very likely to mark many bbs' to be colder than the loop header.   Turning on this for static prediction really depends on the false rate. It seems to be this can get wrong pretty easily for very hot loops (which is also the most important thing to optimize for).


This is a good point. There's no universal conservative choice (assuming a small trip count is conservative in some cases, and assuming a large trip count is conservative in other cases).


http://reviews.llvm.org/D19950





More information about the llvm-commits mailing list