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 initializeBasicBlockSectionsPass(Registry); 24 initializeBranchFolderPassPass(Registry); 25 initializeBranchRelaxationPass(Registry); 26 initializeCFGuardLongjmpPass(Registry); 27 initializeCFIFixupPass(Registry); 28 initializeCFIInstrInserterPass(Registry); 29 initializeCheckDebugMachineModulePass(Registry); 30 initializeCodeGenPreparePass(Registry); 31 initializeDeadMachineInstructionElimPass(Registry); 32 initializeDebugifyMachineModulePass(Registry); 33 initializeDetectDeadLanesPass(Registry); 34 initializeDwarfEHPrepareLegacyPassPass(Registry); 35 initializeEarlyIfConverterPass(Registry); 36 initializeEarlyIfPredicatorPass(Registry); 37 initializeEarlyMachineLICMPass(Registry); 38 initializeEarlyTailDuplicatePass(Registry); 39 initializeExpandMemCmpPassPass(Registry); 40 initializeExpandPostRAPass(Registry); 41 initializeFEntryInserterPass(Registry); 42 initializeFinalizeISelPass(Registry); 43 initializeFinalizeMachineBundlesPass(Registry); 44 initializeFixupStatepointCallerSavedPass(Registry); 45 initializeFuncletLayoutPass(Registry); 46 initializeGCMachineCodeAnalysisPass(Registry); 47 initializeGCModuleInfoPass(Registry); 48 initializeHardwareLoopsPass(Registry); 49 initializeIfConverterPass(Registry); 50 initializeImplicitNullChecksPass(Registry); 51 initializeIndirectBrExpandPassPass(Registry); 52 initializeInterleavedLoadCombinePass(Registry); 53 initializeInterleavedAccessPass(Registry); 54 initializeJMCInstrumenterPass(Registry); 55 initializeLiveDebugValuesPass(Registry); 56 initializeLiveDebugVariablesPass(Registry); 57 initializeLiveIntervalsPass(Registry); 58 initializeLiveRangeShrinkPass(Registry); 59 initializeLiveStacksPass(Registry); 60 initializeLiveVariablesPass(Registry); 61 initializeLocalStackSlotPassPass(Registry); 62 initializeLowerGlobalDtorsLegacyPassPass(Registry); 63 initializeLowerIntrinsicsPass(Registry); 64 initializeMIRAddFSDiscriminatorsPass(Registry); 65 initializeMIRCanonicalizerPass(Registry); 66 initializeMIRNamerPass(Registry); 67 initializeMIRProfileLoaderPassPass(Registry); 68 initializeMachineBlockFrequencyInfoPass(Registry); 69 initializeMachineBlockPlacementPass(Registry); 70 initializeMachineBlockPlacementStatsPass(Registry); 71 initializeMachineCSEPass(Registry); 72 initializeMachineCombinerPass(Registry); 73 initializeMachineCopyPropagationPass(Registry); 74 initializeMachineCycleInfoPrinterPassPass(Registry); 75 initializeMachineCycleInfoWrapperPassPass(Registry); 76 initializeMachineDominatorTreePass(Registry); 77 initializeMachineFunctionPrinterPassPass(Registry); 78 initializeMachineLICMPass(Registry); 79 initializeMachineLoopInfoPass(Registry); 80 initializeMachineModuleInfoWrapperPassPass(Registry); 81 initializeMachineOptimizationRemarkEmitterPassPass(Registry); 82 initializeMachineOutlinerPass(Registry); 83 initializeMachinePipelinerPass(Registry); 84 initializeModuloScheduleTestPass(Registry); 85 initializeMachinePostDominatorTreePass(Registry); 86 initializeMachineRegionInfoPassPass(Registry); 87 initializeMachineSchedulerPass(Registry); 88 initializeMachineSinkingPass(Registry); 89 initializeMachineVerifierPassPass(Registry); 90 initializeOptimizePHIsPass(Registry); 91 initializePEIPass(Registry); 92 initializePHIEliminationPass(Registry); 93 initializePatchableFunctionPass(Registry); 94 initializePeepholeOptimizerPass(Registry); 95 initializePostMachineSchedulerPass(Registry); 96 initializePostRAHazardRecognizerPass(Registry); 97 initializePostRAMachineSinkingPass(Registry); 98 initializePostRASchedulerPass(Registry); 99 initializePreISelIntrinsicLoweringLegacyPassPass(Registry); 100 initializeProcessImplicitDefsPass(Registry); 101 initializeRABasicPass(Registry); 102 initializeRAGreedyPass(Registry); 103 initializeRegAllocFastPass(Registry); 104 initializeRegUsageInfoCollectorPass(Registry); 105 initializeRegUsageInfoPropagationPass(Registry); 106 initializeRegisterCoalescerPass(Registry); 107 initializeRemoveRedundantDebugValuesPass(Registry); 108 initializeRenameIndependentSubregsPass(Registry); 109 initializeSafeStackLegacyPassPass(Registry); 110 initializeSelectOptimizePass(Registry); 111 initializeShadowStackGCLoweringPass(Registry); 112 initializeShrinkWrapPass(Registry); 113 initializeSjLjEHPreparePass(Registry); 114 initializeSlotIndexesPass(Registry); 115 initializeStackColoringPass(Registry); 116 initializeStackMapLivenessPass(Registry); 117 initializeStackProtectorPass(Registry); 118 initializeStackSlotColoringPass(Registry); 119 initializeStripDebugMachineModulePass(Registry); 120 initializeTailDuplicatePass(Registry); 121 initializeTargetPassConfigPass(Registry); 122 initializeTwoAddressInstructionPassPass(Registry); 123 initializeTypePromotionPass(Registry); 124 initializeUnpackMachineBundlesPass(Registry); 125 initializeUnreachableBlockElimLegacyPassPass(Registry); 126 initializeUnreachableMachineBlockElimPass(Registry); 127 initializeVirtRegMapPass(Registry); 128 initializeVirtRegRewriterPass(Registry); 129 initializeWasmEHPreparePass(Registry); 130 initializeWinEHPreparePass(Registry); 131 initializeXRayInstrumentationPass(Registry); 132 } 133 134 void LLVMInitializeCodeGen(LLVMPassRegistryRef R) { 135 initializeCodeGen(*unwrap(R)); 136 } 137