1 //===- FatLtoCleanup.h - clean up IR for the FatLTO pipeline ----*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file defines operations used to clean up IR for the FatLTO pipeline. 10 // Instrumentation that is beneficial for bitcode sections used in LTO may 11 // need to be cleaned up to finish non-LTO compilation. llvm.checked.load is 12 // an example of an instruction that we want to preserve for LTO, but is 13 // incorrect to leave unchanged during the per-TU compilation in FatLTO. 14 // 15 //===----------------------------------------------------------------------===// 16 17 #ifndef LLVM_TRANSFORMS_IPO_FATLTOCLEANUP_H 18 #define LLVM_TRANSFORMS_IPO_FATLTOCLEANUP_H 19 20 #include "llvm/IR/PassManager.h" 21 22 namespace llvm { 23 24 class Module; 25 class ModuleSummaryIndex; 26 27 class FatLtoCleanup : public PassInfoMixin<FatLtoCleanup> { 28 public: FatLtoCleanup()29 FatLtoCleanup() {} 30 PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); isRequired()31 static bool isRequired() { return true; } 32 }; 33 34 } // end namespace llvm 35 36 #endif // LLVM_TRANSFORMS_IPO_FATLTOCLEANUP_H 37