[all-commits] [llvm/llvm-project] b4a82b: [MemProf] Use new option/pass for profile feedback...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Mon Jul 10 16:43:16 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b4a82b62258c5f650a1cccf5b179933e6bae4867
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2023-07-10 (Mon, 10 Jul 2023)

  Changed paths:
    M clang/include/clang/Basic/CodeGenOptions.h
    M clang/include/clang/Driver/Options.td
    M clang/lib/CodeGen/BackendUtil.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/test/CodeGen/memprof.cpp
    M clang/test/Driver/fmemprof.cpp
    M llvm/include/llvm/Support/PGOOptions.h
    M llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h
    M llvm/lib/LTO/LTOBackend.cpp
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Passes/PassBuilderPipelines.cpp
    M llvm/lib/Passes/PassRegistry.def
    M llvm/lib/Support/PGOOptions.cpp
    M llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
    M llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
    M llvm/test/Transforms/PGOProfile/memprof.ll
    M llvm/test/Transforms/PGOProfile/memprofmissingfunc.ll
    M llvm/tools/opt/NewPMDriver.cpp

  Log Message:
  [MemProf] Use new option/pass for profile feedback and matching

Previously the MemProf profile was expected to be in the same profile
file as a normal PGO profile, passed via the usual -fprofile-use=
option, and was matched in the same pass. To simplify profile
preparation, since the raw MemProf profile requires the binary for
symbolization and may be simpler to index separately from the raw PGO
profile, and also to enable providing a MemProf profile for a SamplePGO
build, separate out the MemProf feedback option and matching pass.

This patch adds the -fmemory-profile-use=${file} option, and the
provided file is passed down to LLVM and ultimately used in a new
MemProfUsePass which performs the matching of just the memory profile
contents of that file.

Note that a single profile file containing both normal PGO and MemProf
profile data is still supported, and the relevant profile data is
matched by the appropriate matching pass(es) based on which option(s)
the profile is provided with (the same profile file can be supplied to
both feedback options).

Differential Revision: https://reviews.llvm.org/D154856

More information about the All-commits mailing list