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