xref: /aosp_15_r20/external/llvm/lib/Transforms/Scalar/Scalar.cpp (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //===-- Scalar.cpp --------------------------------------------------------===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // This file implements common infrastructure for libLLVMScalarOpts.a, which
11*9880d681SAndroid Build Coastguard Worker // implements several scalar transformations over the LLVM intermediate
12*9880d681SAndroid Build Coastguard Worker // representation, including the C bindings for that library.
13*9880d681SAndroid Build Coastguard Worker //
14*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
15*9880d681SAndroid Build Coastguard Worker 
16*9880d681SAndroid Build Coastguard Worker #include "llvm/Transforms/Scalar.h"
17*9880d681SAndroid Build Coastguard Worker #include "llvm-c/Initialization.h"
18*9880d681SAndroid Build Coastguard Worker #include "llvm-c/Transforms/Scalar.h"
19*9880d681SAndroid Build Coastguard Worker #include "llvm/Analysis/BasicAliasAnalysis.h"
20*9880d681SAndroid Build Coastguard Worker #include "llvm/Analysis/Passes.h"
21*9880d681SAndroid Build Coastguard Worker #include "llvm/Analysis/ScopedNoAliasAA.h"
22*9880d681SAndroid Build Coastguard Worker #include "llvm/Analysis/TypeBasedAliasAnalysis.h"
23*9880d681SAndroid Build Coastguard Worker #include "llvm/Transforms/Scalar/GVN.h"
24*9880d681SAndroid Build Coastguard Worker #include "llvm/IR/DataLayout.h"
25*9880d681SAndroid Build Coastguard Worker #include "llvm/IR/Verifier.h"
26*9880d681SAndroid Build Coastguard Worker #include "llvm/InitializePasses.h"
27*9880d681SAndroid Build Coastguard Worker #include "llvm/IR/LegacyPassManager.h"
28*9880d681SAndroid Build Coastguard Worker 
29*9880d681SAndroid Build Coastguard Worker using namespace llvm;
30*9880d681SAndroid Build Coastguard Worker 
31*9880d681SAndroid Build Coastguard Worker /// initializeScalarOptsPasses - Initialize all passes linked into the
32*9880d681SAndroid Build Coastguard Worker /// ScalarOpts library.
initializeScalarOpts(PassRegistry & Registry)33*9880d681SAndroid Build Coastguard Worker void llvm::initializeScalarOpts(PassRegistry &Registry) {
34*9880d681SAndroid Build Coastguard Worker   initializeADCELegacyPassPass(Registry);
35*9880d681SAndroid Build Coastguard Worker   initializeBDCELegacyPassPass(Registry);
36*9880d681SAndroid Build Coastguard Worker   initializeAlignmentFromAssumptionsPass(Registry);
37*9880d681SAndroid Build Coastguard Worker   initializeConstantHoistingLegacyPassPass(Registry);
38*9880d681SAndroid Build Coastguard Worker   initializeConstantPropagationPass(Registry);
39*9880d681SAndroid Build Coastguard Worker   initializeCorrelatedValuePropagationPass(Registry);
40*9880d681SAndroid Build Coastguard Worker   initializeDCELegacyPassPass(Registry);
41*9880d681SAndroid Build Coastguard Worker   initializeDeadInstEliminationPass(Registry);
42*9880d681SAndroid Build Coastguard Worker   initializeScalarizerPass(Registry);
43*9880d681SAndroid Build Coastguard Worker   initializeDSELegacyPassPass(Registry);
44*9880d681SAndroid Build Coastguard Worker   initializeGuardWideningLegacyPassPass(Registry);
45*9880d681SAndroid Build Coastguard Worker   initializeGVNLegacyPassPass(Registry);
46*9880d681SAndroid Build Coastguard Worker   initializeEarlyCSELegacyPassPass(Registry);
47*9880d681SAndroid Build Coastguard Worker   initializeFlattenCFGPassPass(Registry);
48*9880d681SAndroid Build Coastguard Worker   initializeInductiveRangeCheckEliminationPass(Registry);
49*9880d681SAndroid Build Coastguard Worker   initializeIndVarSimplifyLegacyPassPass(Registry);
50*9880d681SAndroid Build Coastguard Worker   initializeJumpThreadingPass(Registry);
51*9880d681SAndroid Build Coastguard Worker   initializeLegacyLICMPassPass(Registry);
52*9880d681SAndroid Build Coastguard Worker   initializeLoopDataPrefetchPass(Registry);
53*9880d681SAndroid Build Coastguard Worker   initializeLoopDeletionLegacyPassPass(Registry);
54*9880d681SAndroid Build Coastguard Worker   initializeLoopAccessLegacyAnalysisPass(Registry);
55*9880d681SAndroid Build Coastguard Worker   initializeLoopInstSimplifyPass(Registry);
56*9880d681SAndroid Build Coastguard Worker   initializeLoopInterchangePass(Registry);
57*9880d681SAndroid Build Coastguard Worker   initializeLoopRotateLegacyPassPass(Registry);
58*9880d681SAndroid Build Coastguard Worker   initializeLoopStrengthReducePass(Registry);
59*9880d681SAndroid Build Coastguard Worker   initializeLoopRerollPass(Registry);
60*9880d681SAndroid Build Coastguard Worker   initializeLoopUnrollPass(Registry);
61*9880d681SAndroid Build Coastguard Worker   initializeLoopUnswitchPass(Registry);
62*9880d681SAndroid Build Coastguard Worker   initializeLoopVersioningLICMPass(Registry);
63*9880d681SAndroid Build Coastguard Worker   initializeLoopIdiomRecognizeLegacyPassPass(Registry);
64*9880d681SAndroid Build Coastguard Worker   initializeLowerAtomicLegacyPassPass(Registry);
65*9880d681SAndroid Build Coastguard Worker   initializeLowerExpectIntrinsicPass(Registry);
66*9880d681SAndroid Build Coastguard Worker   initializeLowerGuardIntrinsicPass(Registry);
67*9880d681SAndroid Build Coastguard Worker   initializeMemCpyOptLegacyPassPass(Registry);
68*9880d681SAndroid Build Coastguard Worker   initializeMergedLoadStoreMotionLegacyPassPass(Registry);
69*9880d681SAndroid Build Coastguard Worker   initializeNaryReassociatePass(Registry);
70*9880d681SAndroid Build Coastguard Worker   initializePartiallyInlineLibCallsLegacyPassPass(Registry);
71*9880d681SAndroid Build Coastguard Worker   initializeReassociateLegacyPassPass(Registry);
72*9880d681SAndroid Build Coastguard Worker   initializeRegToMemPass(Registry);
73*9880d681SAndroid Build Coastguard Worker   initializeRewriteStatepointsForGCPass(Registry);
74*9880d681SAndroid Build Coastguard Worker   initializeSCCPLegacyPassPass(Registry);
75*9880d681SAndroid Build Coastguard Worker   initializeIPSCCPLegacyPassPass(Registry);
76*9880d681SAndroid Build Coastguard Worker   initializeSROALegacyPassPass(Registry);
77*9880d681SAndroid Build Coastguard Worker   initializeCFGSimplifyPassPass(Registry);
78*9880d681SAndroid Build Coastguard Worker   initializeStructurizeCFGPass(Registry);
79*9880d681SAndroid Build Coastguard Worker   initializeSinkingLegacyPassPass(Registry);
80*9880d681SAndroid Build Coastguard Worker   initializeTailCallElimPass(Registry);
81*9880d681SAndroid Build Coastguard Worker   initializeSeparateConstOffsetFromGEPPass(Registry);
82*9880d681SAndroid Build Coastguard Worker   initializeSpeculativeExecutionPass(Registry);
83*9880d681SAndroid Build Coastguard Worker   initializeStraightLineStrengthReducePass(Registry);
84*9880d681SAndroid Build Coastguard Worker   initializeLoadCombinePass(Registry);
85*9880d681SAndroid Build Coastguard Worker   initializePlaceBackedgeSafepointsImplPass(Registry);
86*9880d681SAndroid Build Coastguard Worker   initializePlaceSafepointsPass(Registry);
87*9880d681SAndroid Build Coastguard Worker   initializeFloat2IntLegacyPassPass(Registry);
88*9880d681SAndroid Build Coastguard Worker   initializeLoopDistributePass(Registry);
89*9880d681SAndroid Build Coastguard Worker   initializeLoopLoadEliminationPass(Registry);
90*9880d681SAndroid Build Coastguard Worker   initializeLoopSimplifyCFGLegacyPassPass(Registry);
91*9880d681SAndroid Build Coastguard Worker   initializeLoopVersioningPassPass(Registry);
92*9880d681SAndroid Build Coastguard Worker }
93*9880d681SAndroid Build Coastguard Worker 
LLVMInitializeScalarOpts(LLVMPassRegistryRef R)94*9880d681SAndroid Build Coastguard Worker void LLVMInitializeScalarOpts(LLVMPassRegistryRef R) {
95*9880d681SAndroid Build Coastguard Worker   initializeScalarOpts(*unwrap(R));
96*9880d681SAndroid Build Coastguard Worker }
97*9880d681SAndroid Build Coastguard Worker 
LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM)98*9880d681SAndroid Build Coastguard Worker void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM) {
99*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createAggressiveDCEPass());
100*9880d681SAndroid Build Coastguard Worker }
101*9880d681SAndroid Build Coastguard Worker 
LLVMAddBitTrackingDCEPass(LLVMPassManagerRef PM)102*9880d681SAndroid Build Coastguard Worker void LLVMAddBitTrackingDCEPass(LLVMPassManagerRef PM) {
103*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createBitTrackingDCEPass());
104*9880d681SAndroid Build Coastguard Worker }
105*9880d681SAndroid Build Coastguard Worker 
LLVMAddAlignmentFromAssumptionsPass(LLVMPassManagerRef PM)106*9880d681SAndroid Build Coastguard Worker void LLVMAddAlignmentFromAssumptionsPass(LLVMPassManagerRef PM) {
107*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createAlignmentFromAssumptionsPass());
108*9880d681SAndroid Build Coastguard Worker }
109*9880d681SAndroid Build Coastguard Worker 
LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM)110*9880d681SAndroid Build Coastguard Worker void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM) {
111*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createCFGSimplificationPass());
112*9880d681SAndroid Build Coastguard Worker }
113*9880d681SAndroid Build Coastguard Worker 
LLVMAddDeadStoreEliminationPass(LLVMPassManagerRef PM)114*9880d681SAndroid Build Coastguard Worker void LLVMAddDeadStoreEliminationPass(LLVMPassManagerRef PM) {
115*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createDeadStoreEliminationPass());
116*9880d681SAndroid Build Coastguard Worker }
117*9880d681SAndroid Build Coastguard Worker 
LLVMAddScalarizerPass(LLVMPassManagerRef PM)118*9880d681SAndroid Build Coastguard Worker void LLVMAddScalarizerPass(LLVMPassManagerRef PM) {
119*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createScalarizerPass());
120*9880d681SAndroid Build Coastguard Worker }
121*9880d681SAndroid Build Coastguard Worker 
LLVMAddGVNPass(LLVMPassManagerRef PM)122*9880d681SAndroid Build Coastguard Worker void LLVMAddGVNPass(LLVMPassManagerRef PM) {
123*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createGVNPass());
124*9880d681SAndroid Build Coastguard Worker }
125*9880d681SAndroid Build Coastguard Worker 
LLVMAddMergedLoadStoreMotionPass(LLVMPassManagerRef PM)126*9880d681SAndroid Build Coastguard Worker void LLVMAddMergedLoadStoreMotionPass(LLVMPassManagerRef PM) {
127*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createMergedLoadStoreMotionPass());
128*9880d681SAndroid Build Coastguard Worker }
129*9880d681SAndroid Build Coastguard Worker 
LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM)130*9880d681SAndroid Build Coastguard Worker void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM) {
131*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createIndVarSimplifyPass());
132*9880d681SAndroid Build Coastguard Worker }
133*9880d681SAndroid Build Coastguard Worker 
LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM)134*9880d681SAndroid Build Coastguard Worker void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM) {
135*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createInstructionCombiningPass());
136*9880d681SAndroid Build Coastguard Worker }
137*9880d681SAndroid Build Coastguard Worker 
LLVMAddJumpThreadingPass(LLVMPassManagerRef PM)138*9880d681SAndroid Build Coastguard Worker void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM) {
139*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createJumpThreadingPass());
140*9880d681SAndroid Build Coastguard Worker }
141*9880d681SAndroid Build Coastguard Worker 
LLVMAddLICMPass(LLVMPassManagerRef PM)142*9880d681SAndroid Build Coastguard Worker void LLVMAddLICMPass(LLVMPassManagerRef PM) {
143*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createLICMPass());
144*9880d681SAndroid Build Coastguard Worker }
145*9880d681SAndroid Build Coastguard Worker 
LLVMAddLoopDeletionPass(LLVMPassManagerRef PM)146*9880d681SAndroid Build Coastguard Worker void LLVMAddLoopDeletionPass(LLVMPassManagerRef PM) {
147*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createLoopDeletionPass());
148*9880d681SAndroid Build Coastguard Worker }
149*9880d681SAndroid Build Coastguard Worker 
LLVMAddLoopIdiomPass(LLVMPassManagerRef PM)150*9880d681SAndroid Build Coastguard Worker void LLVMAddLoopIdiomPass(LLVMPassManagerRef PM) {
151*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createLoopIdiomPass());
152*9880d681SAndroid Build Coastguard Worker }
153*9880d681SAndroid Build Coastguard Worker 
LLVMAddLoopRotatePass(LLVMPassManagerRef PM)154*9880d681SAndroid Build Coastguard Worker void LLVMAddLoopRotatePass(LLVMPassManagerRef PM) {
155*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createLoopRotatePass());
156*9880d681SAndroid Build Coastguard Worker }
157*9880d681SAndroid Build Coastguard Worker 
LLVMAddLoopRerollPass(LLVMPassManagerRef PM)158*9880d681SAndroid Build Coastguard Worker void LLVMAddLoopRerollPass(LLVMPassManagerRef PM) {
159*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createLoopRerollPass());
160*9880d681SAndroid Build Coastguard Worker }
161*9880d681SAndroid Build Coastguard Worker 
LLVMAddLoopSimplifyCFGPass(LLVMPassManagerRef PM)162*9880d681SAndroid Build Coastguard Worker void LLVMAddLoopSimplifyCFGPass(LLVMPassManagerRef PM) {
163*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createLoopSimplifyCFGPass());
164*9880d681SAndroid Build Coastguard Worker }
165*9880d681SAndroid Build Coastguard Worker 
LLVMAddLoopUnrollPass(LLVMPassManagerRef PM)166*9880d681SAndroid Build Coastguard Worker void LLVMAddLoopUnrollPass(LLVMPassManagerRef PM) {
167*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createLoopUnrollPass());
168*9880d681SAndroid Build Coastguard Worker }
169*9880d681SAndroid Build Coastguard Worker 
LLVMAddLoopUnswitchPass(LLVMPassManagerRef PM)170*9880d681SAndroid Build Coastguard Worker void LLVMAddLoopUnswitchPass(LLVMPassManagerRef PM) {
171*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createLoopUnswitchPass());
172*9880d681SAndroid Build Coastguard Worker }
173*9880d681SAndroid Build Coastguard Worker 
LLVMAddMemCpyOptPass(LLVMPassManagerRef PM)174*9880d681SAndroid Build Coastguard Worker void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM) {
175*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createMemCpyOptPass());
176*9880d681SAndroid Build Coastguard Worker }
177*9880d681SAndroid Build Coastguard Worker 
LLVMAddPartiallyInlineLibCallsPass(LLVMPassManagerRef PM)178*9880d681SAndroid Build Coastguard Worker void LLVMAddPartiallyInlineLibCallsPass(LLVMPassManagerRef PM) {
179*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createPartiallyInlineLibCallsPass());
180*9880d681SAndroid Build Coastguard Worker }
181*9880d681SAndroid Build Coastguard Worker 
LLVMAddLowerSwitchPass(LLVMPassManagerRef PM)182*9880d681SAndroid Build Coastguard Worker void LLVMAddLowerSwitchPass(LLVMPassManagerRef PM) {
183*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createLowerSwitchPass());
184*9880d681SAndroid Build Coastguard Worker }
185*9880d681SAndroid Build Coastguard Worker 
LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM)186*9880d681SAndroid Build Coastguard Worker void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM) {
187*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createPromoteMemoryToRegisterPass());
188*9880d681SAndroid Build Coastguard Worker }
189*9880d681SAndroid Build Coastguard Worker 
LLVMAddReassociatePass(LLVMPassManagerRef PM)190*9880d681SAndroid Build Coastguard Worker void LLVMAddReassociatePass(LLVMPassManagerRef PM) {
191*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createReassociatePass());
192*9880d681SAndroid Build Coastguard Worker }
193*9880d681SAndroid Build Coastguard Worker 
LLVMAddSCCPPass(LLVMPassManagerRef PM)194*9880d681SAndroid Build Coastguard Worker void LLVMAddSCCPPass(LLVMPassManagerRef PM) {
195*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createSCCPPass());
196*9880d681SAndroid Build Coastguard Worker }
197*9880d681SAndroid Build Coastguard Worker 
LLVMAddScalarReplAggregatesPass(LLVMPassManagerRef PM)198*9880d681SAndroid Build Coastguard Worker void LLVMAddScalarReplAggregatesPass(LLVMPassManagerRef PM) {
199*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createSROAPass());
200*9880d681SAndroid Build Coastguard Worker }
201*9880d681SAndroid Build Coastguard Worker 
LLVMAddScalarReplAggregatesPassSSA(LLVMPassManagerRef PM)202*9880d681SAndroid Build Coastguard Worker void LLVMAddScalarReplAggregatesPassSSA(LLVMPassManagerRef PM) {
203*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createSROAPass());
204*9880d681SAndroid Build Coastguard Worker }
205*9880d681SAndroid Build Coastguard Worker 
LLVMAddScalarReplAggregatesPassWithThreshold(LLVMPassManagerRef PM,int Threshold)206*9880d681SAndroid Build Coastguard Worker void LLVMAddScalarReplAggregatesPassWithThreshold(LLVMPassManagerRef PM,
207*9880d681SAndroid Build Coastguard Worker                                                   int Threshold) {
208*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createSROAPass());
209*9880d681SAndroid Build Coastguard Worker }
210*9880d681SAndroid Build Coastguard Worker 
LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM)211*9880d681SAndroid Build Coastguard Worker void LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM) {
212*9880d681SAndroid Build Coastguard Worker   // NOTE: The simplify-libcalls pass has been removed.
213*9880d681SAndroid Build Coastguard Worker }
214*9880d681SAndroid Build Coastguard Worker 
LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM)215*9880d681SAndroid Build Coastguard Worker void LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM) {
216*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createTailCallEliminationPass());
217*9880d681SAndroid Build Coastguard Worker }
218*9880d681SAndroid Build Coastguard Worker 
LLVMAddConstantPropagationPass(LLVMPassManagerRef PM)219*9880d681SAndroid Build Coastguard Worker void LLVMAddConstantPropagationPass(LLVMPassManagerRef PM) {
220*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createConstantPropagationPass());
221*9880d681SAndroid Build Coastguard Worker }
222*9880d681SAndroid Build Coastguard Worker 
LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM)223*9880d681SAndroid Build Coastguard Worker void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM) {
224*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createDemoteRegisterToMemoryPass());
225*9880d681SAndroid Build Coastguard Worker }
226*9880d681SAndroid Build Coastguard Worker 
LLVMAddVerifierPass(LLVMPassManagerRef PM)227*9880d681SAndroid Build Coastguard Worker void LLVMAddVerifierPass(LLVMPassManagerRef PM) {
228*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createVerifierPass());
229*9880d681SAndroid Build Coastguard Worker }
230*9880d681SAndroid Build Coastguard Worker 
LLVMAddCorrelatedValuePropagationPass(LLVMPassManagerRef PM)231*9880d681SAndroid Build Coastguard Worker void LLVMAddCorrelatedValuePropagationPass(LLVMPassManagerRef PM) {
232*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createCorrelatedValuePropagationPass());
233*9880d681SAndroid Build Coastguard Worker }
234*9880d681SAndroid Build Coastguard Worker 
LLVMAddEarlyCSEPass(LLVMPassManagerRef PM)235*9880d681SAndroid Build Coastguard Worker void LLVMAddEarlyCSEPass(LLVMPassManagerRef PM) {
236*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createEarlyCSEPass());
237*9880d681SAndroid Build Coastguard Worker }
238*9880d681SAndroid Build Coastguard Worker 
LLVMAddTypeBasedAliasAnalysisPass(LLVMPassManagerRef PM)239*9880d681SAndroid Build Coastguard Worker void LLVMAddTypeBasedAliasAnalysisPass(LLVMPassManagerRef PM) {
240*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createTypeBasedAAWrapperPass());
241*9880d681SAndroid Build Coastguard Worker }
242*9880d681SAndroid Build Coastguard Worker 
LLVMAddScopedNoAliasAAPass(LLVMPassManagerRef PM)243*9880d681SAndroid Build Coastguard Worker void LLVMAddScopedNoAliasAAPass(LLVMPassManagerRef PM) {
244*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createScopedNoAliasAAWrapperPass());
245*9880d681SAndroid Build Coastguard Worker }
246*9880d681SAndroid Build Coastguard Worker 
LLVMAddBasicAliasAnalysisPass(LLVMPassManagerRef PM)247*9880d681SAndroid Build Coastguard Worker void LLVMAddBasicAliasAnalysisPass(LLVMPassManagerRef PM) {
248*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createBasicAAWrapperPass());
249*9880d681SAndroid Build Coastguard Worker }
250*9880d681SAndroid Build Coastguard Worker 
LLVMAddLowerExpectIntrinsicPass(LLVMPassManagerRef PM)251*9880d681SAndroid Build Coastguard Worker void LLVMAddLowerExpectIntrinsicPass(LLVMPassManagerRef PM) {
252*9880d681SAndroid Build Coastguard Worker   unwrap(PM)->add(createLowerExpectIntrinsicPass());
253*9880d681SAndroid Build Coastguard Worker }
254