[all-commits] [llvm/llvm-project] 8fa16c: [LTO][lld] Add lto-pgo-warn-mismatch option

Yolanda-Chen via All-commits all-commits at lists.llvm.org
Wed Aug 11 09:46:09 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8fa16cc628cb642798b3c218594cafa7426064e2
      https://github.com/llvm/llvm-project/commit/8fa16cc628cb642798b3c218594cafa7426064e2
  Author: Yolanda Chen <yolanda.chen at intel.com>
  Date:   2021-08-11 (Wed, 11 Aug 2021)

  Changed paths:
    M lld/COFF/Config.h
    M lld/COFF/Driver.cpp
    M lld/COFF/LTO.cpp
    M lld/COFF/Options.td
    M lld/ELF/Config.h
    M lld/ELF/Driver.cpp
    M lld/ELF/LTO.cpp
    M lld/ELF/Options.td
    A lld/test/COFF/pgo-warn-mismatch.ll
    A lld/test/ELF/lto/pgo-warn-mismatch.ll
    M llvm/include/llvm/LTO/Config.h
    M llvm/lib/LTO/CMakeLists.txt
    M llvm/lib/LTO/LTOBackend.cpp
    M llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp

  Log Message:
  -----------
  [LTO][lld] Add lto-pgo-warn-mismatch option

When enable CSPGO for ThinLTO, there are profile cfg mismatch warnings that will cause lld-link errors (with /WX)
due to source changes (e.g. `#if` code runs for profile generation but not for profile use)
To disable it we have to use an internal "/mllvm:-no-pgo-warn-mismatch" option.
In contrast clang uses option ”-Wno-backend-plugin“ to avoid such warnings and gcc has an explicit "-Wno-coverage-mismatch" option.

Add "lto-pgo-warn-mismatch" option to lld COFF/ELF to help turn on/off the profile mismatch warnings explicitly when build with ThinLTO and CSPGO.

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




More information about the All-commits mailing list