[all-commits] [llvm/llvm-project] 52d348: Fix and reapply IR PGO support for Flang (#142892)

FYK via All-commits all-commits at lists.llvm.org
Fri Jun 13 11:05:37 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 52d34865b9db3485c8a671a88cc571270349f720
      https://github.com/llvm/llvm-project/commit/52d34865b9db3485c8a671a88cc571270349f720
  Author: FYK <fanju110 at 163.com>
  Date:   2025-06-13 (Fri, 13 Jun 2025)

  Changed paths:
    M clang/include/clang/Basic/CodeGenOptions.def
    M clang/include/clang/Basic/CodeGenOptions.h
    M clang/include/clang/Basic/ProfileList.h
    M clang/include/clang/Driver/Options.td
    M clang/lib/Basic/ProfileList.cpp
    M clang/lib/CodeGen/BackendUtil.cpp
    M clang/lib/CodeGen/CodeGenAction.cpp
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/Driver/ToolChains/Flang.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    M flang/include/flang/Frontend/CodeGenOptions.def
    M flang/include/flang/Frontend/CodeGenOptions.h
    M flang/lib/Frontend/CompilerInvocation.cpp
    M flang/lib/Frontend/FrontendActions.cpp
    M flang/test/Driver/flang-f-opts.f90
    A flang/test/Profile/Inputs/gcc-flag-compatibility_IR.proftext
    A flang/test/Profile/Inputs/gcc-flag-compatibility_IR_entry.proftext
    A flang/test/Profile/gcc-flag-compatibility.f90
    M llvm/include/llvm/Frontend/Driver/CodeGenOptions.h
    M llvm/lib/Frontend/Driver/CMakeLists.txt
    M llvm/lib/Frontend/Driver/CodeGenOptions.cpp

  Log Message:
  -----------
  Fix and reapply IR PGO support for Flang (#142892)

This PR resubmits the changes from #136098, which was previously
reverted due to a build failure during the linking stage:

```
undefined reference to `llvm::DebugInfoCorrelate'  
undefined reference to `llvm::ProfileCorrelate'
```

The root cause was that `llvm/lib/Frontend/Driver/CodeGenOptions.cpp`
references symbols from the `Instrumentation` component, but the
`LINK_COMPONENTS` in the `llvm/lib/Frontend/CMakeLists.txt` for
`LLVMFrontendDriver` did not include it. As a result, linking failed in
configurations where these components were not transitively linked.

### Fix:

This updated patch explicitly adds `Instrumentation` to
`LINK_COMPONENTS` in the relevant `llvm/lib/Frontend/CMakeLists.txt`
file to ensure the required symbols are properly resolved.

---------

Co-authored-by: ict-ql <168183727+ict-ql at users.noreply.github.com>
Co-authored-by: Chyaka <52224511+liliumshade at users.noreply.github.com>
Co-authored-by: Tarun Prabhu <tarunprabhu at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list