xref: /freebsd/contrib/llvm-project/llvm/lib/CodeGen/CodeGen.cpp (revision 734e82fe33aa764367791a7d603b383996c6b40b)
1 //===-- CodeGen.cpp -------------------------------------------------------===//
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 file implements the common initialization routines for the
10 // CodeGen library.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "llvm-c/Initialization.h"
15 #include "llvm/InitializePasses.h"
16 #include "llvm/PassRegistry.h"
17 
18 using namespace llvm;
19 
20 /// initializeCodeGen - Initialize all passes linked into the CodeGen library.
21 void llvm::initializeCodeGen(PassRegistry &Registry) {
22   initializeAssignmentTrackingAnalysisPass(Registry);
23   initializeAtomicExpandPass(Registry);
24   initializeBasicBlockSectionsPass(Registry);
25   initializeBranchFolderPassPass(Registry);
26   initializeBranchRelaxationPass(Registry);
27   initializeCFGuardLongjmpPass(Registry);
28   initializeCFIFixupPass(Registry);
29   initializeCFIInstrInserterPass(Registry);
30   initializeCheckDebugMachineModulePass(Registry);
31   initializeCodeGenPreparePass(Registry);
32   initializeDeadMachineInstructionElimPass(Registry);
33   initializeDebugifyMachineModulePass(Registry);
34   initializeDetectDeadLanesPass(Registry);
35   initializeDwarfEHPrepareLegacyPassPass(Registry);
36   initializeEarlyIfConverterPass(Registry);
37   initializeEarlyIfPredicatorPass(Registry);
38   initializeEarlyMachineLICMPass(Registry);
39   initializeEarlyTailDuplicatePass(Registry);
40   initializeExpandLargeDivRemLegacyPassPass(Registry);
41   initializeExpandLargeFpConvertLegacyPassPass(Registry);
42   initializeExpandMemCmpPassPass(Registry);
43   initializeExpandPostRAPass(Registry);
44   initializeFEntryInserterPass(Registry);
45   initializeFinalizeISelPass(Registry);
46   initializeFinalizeMachineBundlesPass(Registry);
47   initializeFixupStatepointCallerSavedPass(Registry);
48   initializeFuncletLayoutPass(Registry);
49   initializeGCMachineCodeAnalysisPass(Registry);
50   initializeGCModuleInfoPass(Registry);
51   initializeHardwareLoopsPass(Registry);
52   initializeIfConverterPass(Registry);
53   initializeImplicitNullChecksPass(Registry);
54   initializeIndirectBrExpandPassPass(Registry);
55   initializeInterleavedLoadCombinePass(Registry);
56   initializeInterleavedAccessPass(Registry);
57   initializeJMCInstrumenterPass(Registry);
58   initializeLiveDebugValuesPass(Registry);
59   initializeLiveDebugVariablesPass(Registry);
60   initializeLiveIntervalsPass(Registry);
61   initializeLiveRangeShrinkPass(Registry);
62   initializeLiveStacksPass(Registry);
63   initializeLiveVariablesPass(Registry);
64   initializeLocalStackSlotPassPass(Registry);
65   initializeLowerGlobalDtorsLegacyPassPass(Registry);
66   initializeLowerIntrinsicsPass(Registry);
67   initializeMIRAddFSDiscriminatorsPass(Registry);
68   initializeMIRCanonicalizerPass(Registry);
69   initializeMIRNamerPass(Registry);
70   initializeMIRProfileLoaderPassPass(Registry);
71   initializeMachineBlockFrequencyInfoPass(Registry);
72   initializeMachineBlockPlacementPass(Registry);
73   initializeMachineBlockPlacementStatsPass(Registry);
74   initializeMachineCFGPrinterPass(Registry);
75   initializeMachineCSEPass(Registry);
76   initializeMachineCombinerPass(Registry);
77   initializeMachineCopyPropagationPass(Registry);
78   initializeMachineCycleInfoPrinterPassPass(Registry);
79   initializeMachineCycleInfoWrapperPassPass(Registry);
80   initializeMachineDominatorTreePass(Registry);
81   initializeMachineFunctionPrinterPassPass(Registry);
82   initializeMachineLateInstrsCleanupPass(Registry);
83   initializeMachineLICMPass(Registry);
84   initializeMachineLoopInfoPass(Registry);
85   initializeMachineModuleInfoWrapperPassPass(Registry);
86   initializeMachineOptimizationRemarkEmitterPassPass(Registry);
87   initializeMachineOutlinerPass(Registry);
88   initializeMachinePipelinerPass(Registry);
89   initializeMachineSanitizerBinaryMetadataPass(Registry);
90   initializeModuloScheduleTestPass(Registry);
91   initializeMachinePostDominatorTreePass(Registry);
92   initializeMachineRegionInfoPassPass(Registry);
93   initializeMachineSchedulerPass(Registry);
94   initializeMachineSinkingPass(Registry);
95   initializeMachineUniformityAnalysisPassPass(Registry);
96   initializeMachineUniformityInfoPrinterPassPass(Registry);
97   initializeMachineVerifierPassPass(Registry);
98   initializeObjCARCContractLegacyPassPass(Registry);
99   initializeOptimizePHIsPass(Registry);
100   initializePEIPass(Registry);
101   initializePHIEliminationPass(Registry);
102   initializePatchableFunctionPass(Registry);
103   initializePeepholeOptimizerPass(Registry);
104   initializePostMachineSchedulerPass(Registry);
105   initializePostRAHazardRecognizerPass(Registry);
106   initializePostRAMachineSinkingPass(Registry);
107   initializePostRASchedulerPass(Registry);
108   initializePreISelIntrinsicLoweringLegacyPassPass(Registry);
109   initializeProcessImplicitDefsPass(Registry);
110   initializeRABasicPass(Registry);
111   initializeRAGreedyPass(Registry);
112   initializeRegAllocFastPass(Registry);
113   initializeRegUsageInfoCollectorPass(Registry);
114   initializeRegUsageInfoPropagationPass(Registry);
115   initializeRegisterCoalescerPass(Registry);
116   initializeRemoveRedundantDebugValuesPass(Registry);
117   initializeRenameIndependentSubregsPass(Registry);
118   initializeSafeStackLegacyPassPass(Registry);
119   initializeSelectOptimizePass(Registry);
120   initializeShadowStackGCLoweringPass(Registry);
121   initializeShrinkWrapPass(Registry);
122   initializeSjLjEHPreparePass(Registry);
123   initializeSlotIndexesPass(Registry);
124   initializeStackColoringPass(Registry);
125   initializeStackFrameLayoutAnalysisPassPass(Registry);
126   initializeStackMapLivenessPass(Registry);
127   initializeStackProtectorPass(Registry);
128   initializeStackSlotColoringPass(Registry);
129   initializeStripDebugMachineModulePass(Registry);
130   initializeTailDuplicatePass(Registry);
131   initializeTargetPassConfigPass(Registry);
132   initializeTwoAddressInstructionPassPass(Registry);
133   initializeTypePromotionLegacyPass(Registry);
134   initializeUnpackMachineBundlesPass(Registry);
135   initializeUnreachableBlockElimLegacyPassPass(Registry);
136   initializeUnreachableMachineBlockElimPass(Registry);
137   initializeVirtRegMapPass(Registry);
138   initializeVirtRegRewriterPass(Registry);
139   initializeWasmEHPreparePass(Registry);
140   initializeWinEHPreparePass(Registry);
141   initializeXRayInstrumentationPass(Registry);
142 }
143 
144 void LLVMInitializeCodeGen(LLVMPassRegistryRef R) {
145   initializeCodeGen(*unwrap(R));
146 }
147