xref: /freebsd/contrib/llvm-project/llvm/lib/CodeGen/CodeGen.cpp (revision e40139ff33b48b56a24c808b166b04b8ee6f5b21)
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   initializeAtomicExpandPass(Registry);
23   initializeBranchFolderPassPass(Registry);
24   initializeBranchRelaxationPass(Registry);
25   initializeCFIInstrInserterPass(Registry);
26   initializeCodeGenPreparePass(Registry);
27   initializeDeadMachineInstructionElimPass(Registry);
28   initializeDetectDeadLanesPass(Registry);
29   initializeDwarfEHPreparePass(Registry);
30   initializeEarlyIfConverterPass(Registry);
31   initializeEarlyIfPredicatorPass(Registry);
32   initializeEarlyMachineLICMPass(Registry);
33   initializeEarlyTailDuplicatePass(Registry);
34   initializeExpandMemCmpPassPass(Registry);
35   initializeExpandPostRAPass(Registry);
36   initializeFEntryInserterPass(Registry);
37   initializeFinalizeISelPass(Registry);
38   initializeFinalizeMachineBundlesPass(Registry);
39   initializeFuncletLayoutPass(Registry);
40   initializeGCMachineCodeAnalysisPass(Registry);
41   initializeGCModuleInfoPass(Registry);
42   initializeHardwareLoopsPass(Registry);
43   initializeIfConverterPass(Registry);
44   initializeImplicitNullChecksPass(Registry);
45   initializeIndirectBrExpandPassPass(Registry);
46   initializeInterleavedLoadCombinePass(Registry);
47   initializeInterleavedAccessPass(Registry);
48   initializeLiveDebugValuesPass(Registry);
49   initializeLiveDebugVariablesPass(Registry);
50   initializeLiveIntervalsPass(Registry);
51   initializeLiveRangeShrinkPass(Registry);
52   initializeLiveStacksPass(Registry);
53   initializeLiveVariablesPass(Registry);
54   initializeLocalStackSlotPassPass(Registry);
55   initializeLowerIntrinsicsPass(Registry);
56   initializeMIRCanonicalizerPass(Registry);
57   initializeMIRNamerPass(Registry);
58   initializeMachineBlockFrequencyInfoPass(Registry);
59   initializeMachineBlockPlacementPass(Registry);
60   initializeMachineBlockPlacementStatsPass(Registry);
61   initializeMachineCSEPass(Registry);
62   initializeMachineCombinerPass(Registry);
63   initializeMachineCopyPropagationPass(Registry);
64   initializeMachineDominatorTreePass(Registry);
65   initializeMachineFunctionPrinterPassPass(Registry);
66   initializeMachineLICMPass(Registry);
67   initializeMachineLoopInfoPass(Registry);
68   initializeMachineModuleInfoWrapperPassPass(Registry);
69   initializeMachineOptimizationRemarkEmitterPassPass(Registry);
70   initializeMachineOutlinerPass(Registry);
71   initializeMachinePipelinerPass(Registry);
72   initializeModuloScheduleTestPass(Registry);
73   initializeMachinePostDominatorTreePass(Registry);
74   initializeMachineRegionInfoPassPass(Registry);
75   initializeMachineSchedulerPass(Registry);
76   initializeMachineSinkingPass(Registry);
77   initializeMachineVerifierPassPass(Registry);
78   initializeOptimizePHIsPass(Registry);
79   initializePEIPass(Registry);
80   initializePHIEliminationPass(Registry);
81   initializePatchableFunctionPass(Registry);
82   initializePeepholeOptimizerPass(Registry);
83   initializePostMachineSchedulerPass(Registry);
84   initializePostRAHazardRecognizerPass(Registry);
85   initializePostRAMachineSinkingPass(Registry);
86   initializePostRASchedulerPass(Registry);
87   initializePreISelIntrinsicLoweringLegacyPassPass(Registry);
88   initializeProcessImplicitDefsPass(Registry);
89   initializeRABasicPass(Registry);
90   initializeRAGreedyPass(Registry);
91   initializeRegAllocFastPass(Registry);
92   initializeRegUsageInfoCollectorPass(Registry);
93   initializeRegUsageInfoPropagationPass(Registry);
94   initializeRegisterCoalescerPass(Registry);
95   initializeRenameIndependentSubregsPass(Registry);
96   initializeSafeStackLegacyPassPass(Registry);
97   initializeScalarizeMaskedMemIntrinPass(Registry);
98   initializeShrinkWrapPass(Registry);
99   initializeSlotIndexesPass(Registry);
100   initializeStackColoringPass(Registry);
101   initializeStackMapLivenessPass(Registry);
102   initializeStackProtectorPass(Registry);
103   initializeStackSlotColoringPass(Registry);
104   initializeTailDuplicatePass(Registry);
105   initializeTargetPassConfigPass(Registry);
106   initializeTwoAddressInstructionPassPass(Registry);
107   initializeUnpackMachineBundlesPass(Registry);
108   initializeUnreachableBlockElimLegacyPassPass(Registry);
109   initializeUnreachableMachineBlockElimPass(Registry);
110   initializeVirtRegMapPass(Registry);
111   initializeVirtRegRewriterPass(Registry);
112   initializeWasmEHPreparePass(Registry);
113   initializeWinEHPreparePass(Registry);
114   initializeXRayInstrumentationPass(Registry);
115 }
116 
117 void LLVMInitializeCodeGen(LLVMPassRegistryRef R) {
118   initializeCodeGen(*unwrap(R));
119 }
120