[PATCH] D69384: Add unlikely attribute to outlined function

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 24 10:57:02 PDT 2019


tejohnson added a comment.

In D69384#1720142 <https://reviews.llvm.org/D69384#1720142>, @vsk wrote:

> Yes, this does need a test, but I'm also not sure why this belongs in the hot/cold splitting pass.
>
> It's possible to mark functions with the `cold` attribute outside of the splitting pass. Shouldn't all of these cold functions should have a `.unlikely` section prefix? If so, setting the section prefix should be done later (say, in PreISelLowering).


It's normally done in CodeGenPrepare.cpp, search there for the calls to setSectionPrefix. It's based on the profile counts, and since the entry count is being set to 0 it should behave as expected, unless this is being done without PGO.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69384





More information about the llvm-commits mailing list