LLVM 20.0.0git
EmbedBitcodePass.h
Go to the documentation of this file.
1//===-- EmbedBitcodePass.h - Embeds bitcode into global ---------*- 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/// \file
9///
10/// This file provides a pass which clones the current module and runs the
11/// provided pass pipeline on the clone. The optimized module is stored into a
12/// global variable in the `.llvm.lto` section. Primarily, this pass is used
13/// to support the FatLTO pipeline, but could be used to generate a bitcode
14/// section for any arbitrary pass pipeline without changing the current module.
15///
16//===----------------------------------------------------------------------===//
17//
18#ifndef LLVM_TRANSFORMS_IPO_EMBEDBITCODEPASS_H
19#define LLVM_TRANSFORMS_IPO_EMBEDBITCODEPASS_H
20
21#include "llvm/IR/PassManager.h"
22
23namespace llvm {
24class Module;
25class Pass;
26
33};
34
35/// Pass embeds a copy of the module optimized with the provided pass pipeline
36/// into a global variable.
37class EmbedBitcodePass : public PassInfoMixin<EmbedBitcodePass> {
38 bool IsThinLTO;
39 bool EmitLTOSummary;
40
41public:
43 : EmbedBitcodePass(Opts.IsThinLTO, Opts.EmitLTOSummary) {}
44 EmbedBitcodePass(bool IsThinLTO, bool EmitLTOSummary)
45 : IsThinLTO(IsThinLTO), EmitLTOSummary(EmitLTOSummary) {}
46
48
49 static bool isRequired() { return true; }
50};
51
52} // end namespace llvm.
53
54#endif
aarch64 AArch64 CCMP Pass
Machine Check Debug Module
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:253
Pass embeds a copy of the module optimized with the provided pass pipeline into a global variable.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &)
EmbedBitcodePass(bool IsThinLTO, bool EmitLTOSummary)
EmbedBitcodePass(EmbedBitcodeOptions Opts)
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:111
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
EmbedBitcodeOptions(bool IsThinLTO, bool EmitLTOSummary)
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:69