[PATCH] D152833: A new code layout algorithm for function reordering [1/3]

Sergey Pupyrev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 13:14:41 PDT 2023


spupyrev created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
spupyrev edited the summary of this revision.
spupyrev added reviewers: hoy, wenlei, wlei.
spupyrev added subscribers: Amir, maksfb.
spupyrev published this revision for review.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We are brining a new algorithm for function layout (reordering) based on the
call graph (extracted from a profile data). The algorithm is an improvement of
top of a known heuristic, C^3. It tries to co-locate hot and frequently executed
together functions in the resulting ordering. Unlike C^3, it explores a larger
search space and have an objective closely tied to the performance of 
instruction and i-TLB caches. Hence, the name CDS = Cache-Directed Sort.
The algorithm can be used at the linking or post-linking (e.g., BOLT) stage.

This diff modifies the existing data structures to facilitate the implementation 
(down the stack). This is a no-op change.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152833

Files:
  llvm/lib/Transforms/Utils/CodeLayout.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152833.530966.patch
Type: text/x-patch
Size: 47865 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230613/974040ab/attachment.bin>


More information about the llvm-commits mailing list