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