[all-commits] [llvm/llvm-project] 4f86d4: [llvm][fatlto] Add FatLTOCleanup pass

Paul Kirth via All-commits all-commits at lists.llvm.org
Thu Feb 13 11:23:21 PST 2025


  Branch: refs/heads/users/ilovepi/fatlto_cfi
  Home:   https://github.com/llvm/llvm-project
  Commit: 4f86d4f5e2a39414bf0f59e18e2723b9fc0595cc
      https://github.com/llvm/llvm-project/commit/4f86d4f5e2a39414bf0f59e18e2723b9fc0595cc
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2025-02-13 (Thu, 13 Feb 2025)

  Changed paths:
    M clang/test/CodeGen/fat-lto-objects-cfi.cpp
    A llvm/include/llvm/Transforms/IPO/FatLTOCleanup.h
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Passes/PassBuilderPipelines.cpp
    M llvm/lib/Passes/PassRegistry.def
    M llvm/lib/Transforms/IPO/CMakeLists.txt
    A llvm/lib/Transforms/IPO/FatLTOCleanup.cpp
    A llvm/test/Transforms/FatLTOCleanup/remove-type-checked-load.ll

  Log Message:
  -----------
  [llvm][fatlto] Add FatLTOCleanup pass

When using FatLTO, it is common to want to enable certain types of whole
program optimizations (WPD) or security transforms (CFI), so that they
can be made available when performing LTO. However, these transforms
should not be used when compiling the non-LTO object code. Since the
frontend must emit different IR, we cannot simply clone the module and
optimize the LTO section and non-LTO section differently to work around
this. Instead, we need to remove any problematic instruction sequences.

This patch adds a new pass whose responsibility is to clean up the IR
in the FatLTO pipeline after creating the bitcode section, which is
after running the pre-link pipeline but before running module
optimization. This allows us to safely drop any conflicting instructions
or IR constructs that are inappropriate for non-LTO compilation.



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