[PATCH] D149800: [WIP][PGO] Add ability to mark cold functions as optsize/minsize/optnone

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 3 16:43:26 PDT 2023


aeubanks created this revision.
Herald added subscribers: wlei, Enna1, ormris, wenlei, steven_wu, hiraditya.
Herald added a project: All.
aeubanks requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

The performance of cold functions shouldn't matter too much, so if we care about binary sizes, add an option to mark cold functions as optsize/minsize for binary size, or optnone for compile times [1]. Clang patch will be in a future patch

Chrome size (ThinLTO + instrumented PGO):
base:    371004392
optsize: 366883296
minsize: 342128928

[1] https://discourse.llvm.org/t/rfc-new-feature-proposal-de-optimizing-cold-functions-using-pgo-info/56388


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149800

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  llvm/include/llvm/Support/PGOOptions.h
  llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
  llvm/lib/LTO/LTOBackend.cpp
  llvm/lib/Passes/PassBuilderPipelines.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Support/PGOOptions.cpp
  llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  llvm/test/Transforms/PGOProfile/Inputs/cold-func-attr.proftext
  llvm/test/Transforms/PGOProfile/cold-func-attr.ll
  llvm/tools/opt/NewPMDriver.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149800.519302.patch
Type: text/x-patch
Size: 20294 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230503/11f389d7/attachment-0001.bin>


More information about the cfe-commits mailing list