LLVM 17.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// createMetaRenamerPass - Rename everything with metasyntatic names.
25//
26ModulePass *createMetaRenamerPass();
27
28//===----------------------------------------------------------------------===//
29//
30// LowerInvoke - This pass removes invoke instructions, converting them to call
31// instructions.
32//
33FunctionPass *createLowerInvokePass();
34extern char &LowerInvokePassID;
35
36//===----------------------------------------------------------------------===//
37//
38// InstructionNamer - Give any unnamed non-void instructions "tmp" names.
39//
41extern char &InstructionNamerID;
42
43//===----------------------------------------------------------------------===//
44//
45// LowerSwitch - This pass converts SwitchInst instructions into a sequence of
46// chained binary branch instructions.
47//
49extern char &LowerSwitchID;
50
51//===----------------------------------------------------------------------===//
52//
53// BreakCriticalEdges - Break all of the critical edges in the CFG by inserting
54// a dummy basic block. This pass may be "required" by passes that cannot deal
55// with critical edges. For this usage, a pass must call:
56//
57// AU.addRequiredID(BreakCriticalEdgesID);
58//
59// This pass obviously invalidates the CFG, but can update forward dominator
60// (set, immediate dominators, tree, and frontier) information.
61//
63extern char &BreakCriticalEdgesID;
64
65//===----------------------------------------------------------------------===//
66//
67// LCSSA - This pass inserts phi nodes at loop boundaries to simplify other loop
68// optimizations.
69//
71extern char &LCSSAID;
72
73//===----------------------------------------------------------------------===//
74//
75// AddDiscriminators - Add DWARF path discriminators to the IR.
77
78//===----------------------------------------------------------------------===//
79//
80// PromoteMemoryToRegister - This pass is used to promote memory references to
81// be register references. A simple example of the transformation performed by
82// this pass is:
83//
84// FROM CODE TO CODE
85// %X = alloca i32, i32 1 ret i32 42
86// store i32 42, i32 *%X
87// %Y = load i32* %X
88// ret i32 %Y
89//
91
92//===----------------------------------------------------------------------===//
93//
94// LoopSimplify - Insert Pre-header blocks into the CFG for every function in
95// the module. This pass updates dominator information, loop information, and
96// does not add critical edges to the CFG.
97//
98// AU.addRequiredID(LoopSimplifyID);
99//
101extern char &LoopSimplifyID;
102
103//===----------------------------------------------------------------------===//
104//
105// InjectTLIMappingsLegacy - populates the VFABI attribute with the
106// scalar-to-vector mappings from the TargetLibraryInfo.
107//
109
110//===----------------------------------------------------------------------===//
111//
112// UnifyLoopExits - For each loop, creates a new block N such that all exiting
113// blocks branch to N, and then N distributes control flow to all the original
114// exit blocks.
115//
117
118//===----------------------------------------------------------------------===//
119//
120// FixIrreducible - Convert each SCC with irreducible control-flow
121// into a natural loop.
122//
124
125//===----------------------------------------------------------------------===//
126//
127// AssumeSimplify - remove redundant assumes and merge assumes in the same
128// BasicBlock when possible.
129//
131
132//===----------------------------------------------------------------------===//
133//
134// CanonicalizeFreezeInLoops - Canonicalize freeze instructions in loops so they
135// don't block SCEV.
136//
138
139//===----------------------------------------------------------------------===//
140// LowerGlobalDtorsLegacy - Lower @llvm.global_dtors by creating wrapper
141// functions that are registered in @llvm.global_ctors and which contain a call
142// to `__cxa_atexit` to register their destructor functions.
144} // namespace llvm
145
146#endif
print lazy value Lazy Value Info Printer Pass
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:308
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition: Pass.h:248
Pass interface - Implemented by all 'passes'.
Definition: Pass.h:91
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Pass * createLCSSAPass()
Definition: LCSSA.cpp:491
FunctionPass * createAddDiscriminatorsPass()
char & LCSSAID
Definition: LCSSA.cpp:492
char & LoopSimplifyID
char & InstructionNamerID
char & LowerSwitchID
FunctionPass * createInjectTLIMappingsLegacyPass()
ModulePass * createLowerGlobalDtorsLegacyPass()
FunctionPass * createLowerInvokePass()
Definition: LowerInvoke.cpp:85
FunctionPass * createUnifyLoopExitsPass()
FunctionPass * createFixIrreduciblePass()
FunctionPass * createInstructionNamerPass()
char & BreakCriticalEdgesID
FunctionPass * createLowerSwitchPass()
ModulePass * createMetaRenamerPass()
FunctionPass * createBreakCriticalEdgesPass()
Pass * createCanonicalizeFreezeInLoopsPass()
FunctionPass * createAssumeSimplifyPass()
char & LowerInvokePassID
Definition: LowerInvoke.cpp:82
Pass * createLoopSimplifyPass()
FunctionPass * createPromoteMemoryToRegisterPass(bool IsForced=false)
Definition: Mem2Reg.cpp:118