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