[all-commits] [llvm/llvm-project] 85af42: [lld] add context-sensitive PGO options for MachO

Ellis Hoag via All-commits all-commits at lists.llvm.org
Wed May 31 17:54:00 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 85af42df5dbb964d767feb16a5551dddb36fd4f1
  Author: Ellis Hoag <ellis.sparky.hoag at gmail.com>
  Date:   2023-05-31 (Wed, 31 May 2023)

  Changed paths:
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M clang/lib/Driver/ToolChains/CommonArgs.h
    M clang/lib/Driver/ToolChains/Darwin.cpp
    M clang/test/Driver/cspgo-lto.c
    M lld/MachO/Config.h
    M lld/MachO/Driver.cpp
    M lld/MachO/LTO.cpp
    M lld/MachO/Options.td
    A lld/test/MachO/cspgo-gen.ll
    A lld/test/MachO/cspgo-use.ll
    M lld/test/lit.cfg.py

  Log Message:
  [lld] add context-sensitive PGO options for MachO

Enable support for CSPGO for lld MachO targets.

Since lld MachO does not support `-plugin-opt=`, we need to create the `--cs-profile-generate` and `--cs-profile-path=` options and propagate them in `Darwin.cpp`. These flags are not supported by ld64.

Also outline code into `getLastCSProfileGenerateArg()` to share between `CommonArgs.cpp` and `Darwin.cpp`.

CSPGO is already implemented for ELF (https://reviews.llvm.org/D56675) and COFF (https://reviews.llvm.org/D98763).

Reviewed By: MaskRay

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

More information about the All-commits mailing list