LLVM 22.0.0git
AlwaysInliner.h
Go to the documentation of this file.
1//===-- AlwaysInliner.h - Pass to inline "always_inline" functions --------===//
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/// \file
10/// Provides passes to inlining "always_inline" functions.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TRANSFORMS_IPO_ALWAYSINLINER_H
15#define LLVM_TRANSFORMS_IPO_ALWAYSINLINER_H
16
17#include "llvm/IR/PassManager.h"
19
20namespace llvm {
21
22class Module;
23class Pass;
24
25/// Inlines functions marked as "always_inline".
26///
27/// Note that this does not inline call sites marked as always_inline and does
28/// not delete the functions even when all users are inlined. The normal
29/// inliner should be used to handle call site inlining, this pass's goal is to
30/// be the simplest possible pass to remove always_inline function definitions'
31/// uses by inlining them. The \c GlobalDCE pass can be used to remove these
32/// functions once all users are gone.
33class AlwaysInlinerPass : public PassInfoMixin<AlwaysInlinerPass> {
34 bool InsertLifetime;
35
36public:
37 AlwaysInlinerPass(bool InsertLifetime = true)
38 : InsertLifetime(InsertLifetime) {}
39
41 static bool isRequired() { return true; }
42};
43
44/// Create a legacy pass manager instance of a pass to inline and remove
45/// functions marked as "always_inline".
46LLVM_ABI Pass *createAlwaysInlinerLegacyPass(bool InsertLifetime = true);
47}
48
49#endif // LLVM_TRANSFORMS_IPO_ALWAYSINLINER_H
#define LLVM_ABI
Definition Compiler.h:213
This header defines various interfaces for pass management in LLVM.
Shrink Wrap Pass
AlwaysInlinerPass(bool InsertLifetime=true)
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &)
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
Pass interface - Implemented by all 'passes'.
Definition Pass.h:99
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI Pass * createAlwaysInlinerLegacyPass(bool InsertLifetime=true)
Create a legacy pass manager instance of a pass to inline and remove functions marked as "always_inli...
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition PassManager.h:70