LLVM 19.0.0git
Utils.h
Go to the documentation of this file.
1//===- llvm/Transforms/Utils.h - Utility Transformations --------*- 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 header file defines prototypes for accessor functions that expose passes
10// in the Utils transformations library.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TRANSFORMS_UTILS_H
15#define LLVM_TRANSFORMS_UTILS_H
16
17namespace llvm {
18
19class ModulePass;
20class FunctionPass;
21class Pass;
22
23//===----------------------------------------------------------------------===//
24//
25// LowerInvoke - This pass removes invoke instructions, converting them to call
26// instructions.
27//
28FunctionPass *createLowerInvokePass();
29extern char &LowerInvokePassID;
30
31//===----------------------------------------------------------------------===//
32//
33// LowerSwitch - This pass converts SwitchInst instructions into a sequence of
34// chained binary branch instructions.
35//
36FunctionPass *createLowerSwitchPass();
37extern char &LowerSwitchID;
38
39//===----------------------------------------------------------------------===//
40//
41// EntryExitInstrumenter pass - Instrument function entry/exit with calls to
42// mcount(), @__cyg_profile_func_{enter,exit} and the like. There are two
43// variants, intended to run pre- and post-inlining, respectively. Only the
44// post-inlining variant is used with the legacy pass manager.
45//
47
48//===----------------------------------------------------------------------===//
49//
50// BreakCriticalEdges - Break all of the critical edges in the CFG by inserting
51// a dummy basic block. This pass may be "required" by passes that cannot deal
52// with critical edges. For this usage, a pass must call:
53//
54// AU.addRequiredID(BreakCriticalEdgesID);
55//
56// This pass obviously invalidates the CFG, but can update forward dominator
57// (set, immediate dominators, tree, and frontier) information.
58//
60extern char &BreakCriticalEdgesID;
61
62//===----------------------------------------------------------------------===//
63//
64// LCSSA - This pass inserts phi nodes at loop boundaries to simplify other loop
65// optimizations.
66//
68extern char &LCSSAID;
69
70//===----------------------------------------------------------------------===//
71//
72// PromoteMemoryToRegister - This pass is used to promote memory references to
73// be register references. A simple example of the transformation performed by
74// this pass is:
75//
76// FROM CODE TO CODE
77// %X = alloca i32, i32 1 ret i32 42
78// store i32 42, i32 *%X
79// %Y = load i32* %X
80// ret i32 %Y
81//
83
84//===----------------------------------------------------------------------===//
85//
86// LoopSimplify - Insert Pre-header blocks into the CFG for every function in
87// the module. This pass updates dominator information, loop information, and
88// does not add critical edges to the CFG.
89//
90// AU.addRequiredID(LoopSimplifyID);
91//
93extern char &LoopSimplifyID;
94
95//===----------------------------------------------------------------------===//
96//
97// UnifyLoopExits - For each loop, creates a new block N such that all exiting
98// blocks branch to N, and then N distributes control flow to all the original
99// exit blocks.
100//
102
103//===----------------------------------------------------------------------===//
104//
105// FixIrreducible - Convert each SCC with irreducible control-flow
106// into a natural loop.
107//
109
110//===----------------------------------------------------------------------===//
111//
112// CanonicalizeFreezeInLoops - Canonicalize freeze instructions in loops so they
113// don't block SCEV.
114//
116
117//===----------------------------------------------------------------------===//
118// LowerGlobalDtorsLegacy - Lower @llvm.global_dtors by creating wrapper
119// functions that are registered in @llvm.global_ctors and which contain a call
120// to `__cxa_atexit` to register their destructor functions.
122} // namespace llvm
123
124#endif
aarch64 AArch64 CCMP Pass
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:311
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition: Pass.h:251
Pass interface - Implemented by all 'passes'.
Definition: Pass.h:94
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Pass * createLCSSAPass()
Definition: LCSSA.cpp:506
FunctionPass * createPromoteMemoryToRegisterPass()
Definition: Mem2Reg.cpp:114
FunctionPass * createPostInlineEntryExitInstrumenterPass()
char & LCSSAID
Definition: LCSSA.cpp:507
char & LoopSimplifyID
char & LowerSwitchID
ModulePass * createLowerGlobalDtorsLegacyPass()
FunctionPass * createLowerInvokePass()
Definition: LowerInvoke.cpp:85
FunctionPass * createUnifyLoopExitsPass()
FunctionPass * createFixIrreduciblePass()
char & BreakCriticalEdgesID
FunctionPass * createLowerSwitchPass()
FunctionPass * createBreakCriticalEdgesPass()
Pass * createCanonicalizeFreezeInLoopsPass()
char & LowerInvokePassID
Definition: LowerInvoke.cpp:82
Pass * createLoopSimplifyPass()