[PATCH] D102246: [SampleFDO] New hierarchical discriminator for Flow Sensitive SampleFDO

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 11 08:41:48 PDT 2021


xur created this revision.
xur added reviewers: davidxl, wmi, hoy, snehasish.
Herald added subscribers: dexonsmith, wenlei, pengfei, steven_wu, zzheng, hiraditya, mgorny.
xur requested review of this revision.
Herald added a project: LLVM.

This patch implements first part of Flow Sensitive SampleFDO (FSAFDO). It has
the following changes:
(1) disable current discriminator coding scheme,
(2) new hierarchical discriminator for FSAFDO.

For this patch, "-enable-fs-discriminator=true" turns on the new functionality.
"-enable-fs-discriminator=false" (the default) keeps the current SampleFDO
behavior. When the fs-discriminator is enabled, we insert a flag variable,
__llvm_fs_discriminator__, to the object.
This symbol will checked by create_llvm_prof tool, and used to generate a
profile with FS-AFDO discriminators enabled.
If this happens, for an extbinary format profile, create_llvm_prof tool will add a
flag to profile summary section. For other format profiles, the
users need to use an internal option (-profile-isfs) to tell the compiler that the
profile uses FS-AFDO discriminators.


https://reviews.llvm.org/D102246

Files:
  llvm/include/llvm/CodeGen/FSAFDODiscriminator.h
  llvm/include/llvm/CodeGen/Passes.h
  llvm/include/llvm/IR/DebugInfoMetadata.h
  llvm/include/llvm/InitializePasses.h
  llvm/include/llvm/LTO/Config.h
  llvm/include/llvm/ProfileData/SampleProf.h
  llvm/include/llvm/ProfileData/SampleProfReader.h
  llvm/include/llvm/Support/FSAFDODiscriminator.h
  llvm/lib/CodeGen/CMakeLists.txt
  llvm/lib/CodeGen/FSAFDODiscriminator.cpp
  llvm/lib/CodeGen/TargetPassConfig.cpp
  llvm/lib/LTO/LTOBackend.cpp
  llvm/lib/ProfileData/SampleProf.cpp
  llvm/lib/ProfileData/SampleProfReader.cpp
  llvm/lib/ProfileData/SampleProfWriter.cpp
  llvm/lib/Target/X86/X86InsertPrefetch.cpp
  llvm/lib/Transforms/IPO/SampleProfile.cpp
  llvm/lib/Transforms/Utils/LoopUnroll.cpp
  llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/CodeGen/X86/fsafdo_test1.ll
  llvm/test/CodeGen/X86/fsafdo_test2.ll
  llvm/test/Transforms/SampleProfile/Inputs/fsafdo.extbinary.afdo
  llvm/test/Transforms/SampleProfile/Inputs/fsafdo.prof
  llvm/test/Transforms/SampleProfile/fsafdo_test.ll
  llvm/tools/llvm-profdata/llvm-profdata.cpp
  llvm/unittests/ProfileData/SampleProfTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102246.344417.patch
Type: text/x-patch
Size: 66067 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210511/0011d61f/attachment.bin>


More information about the llvm-commits mailing list