/*========================== begin_copyright_notice ============================

Copyright (C) 2026 Intel Corporation

SPDX-License-Identifier: MIT

============================= end_copyright_notice ===========================*/

#include "InitializeAllIGCPasses.h"
#include "Compiler/InitializePasses.h"

// Forward declarations for initialization functions not covered by
// Compiler/InitializePasses.h. These are defined in their respective
// pass source files, which are part of the IGC library.

// Global namespace functions not in InitializePasses.h
void initializeAddressSpaceAAWrapperPassPass(llvm::PassRegistry &);
void initializeIGCExternalAAWrapperPass(llvm::PassRegistry &);
void initializePartialEmuI64OpsPass(llvm::PassRegistry &);
void initializeEmu64OpsPass(llvm::PassRegistry &);
void initializeTypeLegalizerPass(llvm::PassRegistry &);
void initializeMadLoopSlicePass(llvm::PassRegistry &);
void initializeMemOpt2Pass(llvm::PassRegistry &);
void initializeCodeGenContextWrapperPass(llvm::PassRegistry &);

namespace IGC {
void initializeLSCControlsAnalysisPassPass(llvm::PassRegistry &);
void initializeRayTracingShaderLoweringPass(llvm::PassRegistry &);
void initializeKernelFunctionCloningLPMPass(llvm::PassRegistry &);
void initializePredefinedConstantResolvingLPMPass(llvm::PassRegistry &);
void initializePushAnalysisPass(llvm::PassRegistry &);
void initializeUniformAssumptionsPass(llvm::PassRegistry &);
void initializeTypeDemotePass(llvm::PassRegistry &);
void initializeCallMergerPass(llvm::PassRegistry &);
void initializeExtractValuePairFixupPass(llvm::PassRegistry &);
void initializeAddrSpaceCastFixingLPMPass(llvm::PassRegistry &);
void initializePreRARematFlagPass(llvm::PassRegistry &);
void initializeFoldKnownWorkGroupSizesLPMPass(llvm::PassRegistry &);
void initializeDeadPHINodeEliminationPass(llvm::PassRegistry &);
void initializeSinkCommonOffsetFromGEPPass(llvm::PassRegistry &);
void initializeLoopDeadCodeEliminationPass(llvm::PassRegistry &);
void initializeHoistCongruentPHIPass(llvm::PassRegistry &);
void initializeCodeSchedulingPass(llvm::PassRegistry &);
void initializeLatencyHidingAnalysisPass(llvm::PassRegistry &);
void initializeCodeSinkingPass(llvm::PassRegistry &);
void initializeCodeLoopSinkingPass(llvm::PassRegistry &);
void initializeSimplifyConstantLPMPass(llvm::PassRegistry &);
void initializePromoteConstantLPMPass(llvm::PassRegistry &);
void initializeGenSimplificationPass(llvm::PassRegistry &);
void initializeAdvMemOptPass(llvm::PassRegistry &);
void initializeAddressArithmeticSinkingPass(llvm::PassRegistry &);
void initializeMCSOptimizationPass(llvm::PassRegistry &);
void initializeAdvCodeMotionPass(llvm::PassRegistry &);
void initializeRematAddressArithmeticPass(llvm::PassRegistry &);
void initializeCloneAddressArithmeticPass(llvm::PassRegistry &);
void initializeShrinkArrayAllocaPassPass(llvm::PassRegistry &);
void initializeIndirectCallOptimizationPass(llvm::PassRegistry &);
void initializeFreezeIntDivLPMPass(llvm::PassRegistry &);
void initializeEvaluateFreezePass(llvm::PassRegistry &);
void initializeGenerateFrequencyDataPass(llvm::PassRegistry &);
void initializeEmitPassPass(llvm::PassRegistry &);
void initializeAddRequiredMemoryFencesPass(llvm::PassRegistry &);
void initializeFixInvalidFuncNamePass(llvm::PassRegistry &);
void initializePrintCodeGenContextPassPass(llvm::PassRegistry &);
void initializeSerializePrintMetaDataPassPass(llvm::PassRegistry &);
void initializeLSCCacheHintsPass(llvm::PassRegistry &);
} // namespace IGC

void initializeAllIGCPasses(llvm::PassRegistry &Registry) {
  initializeAccuracyDecoratedCallsBiFResolutionLPMPass(Registry);
  initializeAddImplicitArgsLPMPass(Registry);
  initializeAddressSpaceAAWrapperPassPass(Registry);
  initializeRayTracingAddressSpaceAAWrapperPassPass(Registry);
  initializeIGCExternalAAWrapperPass(Registry);
  initializeAggregateArgumentsAnalysisLPMPass(Registry);
  initializeAlignmentAnalysisLPMPass(Registry);
  initializePreBIImportAnalysisLPMPass(Registry);
  initializeBIImportLPMPass(Registry);
  initializeBlockMemOpAddrScalarizationPassPass(Registry);
  initializeGenerateBlockMemOpsPassPass(Registry);
  initializeBreakConstantExprLPMPass(Registry);
  initializeBuiltinsConverterLPMPass(Registry);
  initializeCastToGASAnalysisPass(Registry);
  initializeCastToGASInfoPass(Registry);
  initializeCastToGASInfoWrapperPass(Registry);
  initializeConstantCoalescingPass(Registry);
  initializeCorrectlyRoundedDivSqrtLPMPass(Registry);
  initializeConvertMSAAPayloadTo16BitPass(Registry);
  initializeCustomSafeOptPassPass(Registry);
  initializeCustomUnsafeOptPassPass(Registry);
  initializeDpasScanPass(Registry);
  initializeDynamicTextureFoldingPass(Registry);
  initializeSampleMultiversioningPass(Registry);
  initializeSimd32ProfitabilityAnalysisPass(Registry);
  initializeCheckInstrTypesPass(Registry);
  initializeExtensionArgAnalysisLPMPass(Registry);
  initializeExtensionFuncsAnalysisLPMPass(Registry);
  initializeExtensionFuncsResolutionLPMPass(Registry);
  initializeFCmpPaternMatchPass(Registry);
  IGC::initializeFixInvalidFuncNamePass(Registry);
  initializeGenericAddressDynamicResolutionPass(Registry);
  initializeGenericNullPtrPropagationPass(Registry);
  initializeGenIRLoweringPass(Registry);
  initializeGenSpecificPatternPass(Registry);
  initializeHandleLoadStoreInstructionsPass(Registry);
  initializeIGCConstPropPass(Registry);
  initializeLowerSIMDSizePass(Registry);
  initializeImageFuncResolutionLPMPass(Registry);
  initializeImageFuncsAnalysisLPMPass(Registry);
  initializeIntDivRemCombinePass(Registry);
  initializeIntDivRemIncrementReductionPass(Registry);
  initializeIntDivConstantReductionPass(Registry);
  initializeInlineLocalsResolutionLPMPass(Registry);
  initializePromoteInt8TypePass(Registry);
  initializeBfloatBuiltinsResolutionLPMPass(Registry);
  initializeBfloatFuncsResolutionLPMPass(Registry);
  initializeDpasFuncsResolutionLPMPass(Registry);
  initializeDecompose2DBlockFuncsWithHoistingPass(Registry);
  initializeDecompose2DBlockFuncsPass(Registry);
  initializeLSCFuncsResolutionLPMPass(Registry);
  initializePartialEmuI64OpsPass(Registry);
  initializePrepareInlineSamplerForBindlessLPMPass(Registry);
  initializeLSCCacheOptimizationPassPass(Registry);
  IGC::initializeLSCCacheHintsPass(Registry);
  initializeResolveImageImplicitArgsForBindlessLPMPass(Registry);
  initializeResolveInlineSamplerForBindlessLPMPass(Registry);
  initializeResolveOCLRaytracingBuiltinsLPMPass(Registry);
  initializeRayTracingIntrinsicResolutionLPMPass(Registry);
  initializeRayTracingIntrinsicAnalysisLPMPass(Registry);
  IGC::initializeLSCControlsAnalysisPassPass(Registry);
  IGC::initializeRayTracingShaderLoweringPass(Registry);
  initializeLegalizationPass(Registry);
  initializeLowerGEPForPrivMemPass(Registry);
  initializeLowPrecisionOptPass(Registry);
  initializeMatchCommonKernelPatternsPass(Registry);
  initializeMetaDataUtilsWrapperInitializerPass(Registry);
  initializeMetaDataUtilsWrapperPass(Registry);
  initializeMemOptPass(Registry);
  initializeLdStCombinePass(Registry);
  initializeMSAAInsertDiscardPass(Registry);
  initializeOpenCLPrintfAnalysisLPMPass(Registry);
  initializeOpenCLPrintfResolutionLPMPass(Registry);
  initializePreCompiledFuncImportPass(Registry);
  initializePrivateMemoryResolutionPass(Registry);
  initializePrivateMemoryToSLMPass(Registry);
  initializePrivateMemoryUsageAnalysisLPMPass(Registry);
  initializeProcessFuncAttributesLPMPass(Registry);
  initializeProcessBuiltinMetaDataLPMPass(Registry);
  initializePromoteConstantStructsPass(Registry);
  initializeInsertDummyKernelForSymbolTableLPMPass(Registry);
  initializeCleanupIndirectlyReferencedFunctionsLPMPass(Registry);
  initializeProgramScopeConstantAnalysisLPMPass(Registry);
  initializeProgramScopeConstantResolutionLPMPass(Registry);
  initializePropagateCmpUniformityPass(Registry);
  initializeReduceOptPassLPMPass(Registry);
  initializeTypesLegalizationPassLPMPass(Registry);
  initializeRegisterPressureEstimatePass(Registry);
  initializeReplaceUnsupportedIntrinsicsPass(Registry);
  initializeResolveAggregateArgumentsLPMPass(Registry);
  initializeResolveOCLAtomicsLPMPass(Registry);
  initializeResourceAllocatorLPMPass(Registry);
  initializeRuntimeValueLegalizationPassPass(Registry);
  initializeScalarArgAsPointerAnalysisLPMPass(Registry);
  initializeScalarizeFunctionLPMPass(Registry);
  initializeSetFastMathFlagsLPMPass(Registry);
  initializeSPIRMetaDataTranslationLPMPass(Registry);
  initializeSplitStructurePhisPassPass(Registry);
  initializeMergeScalarPhisPassPass(Registry);
  initializeTypeLegalizerPass(Registry);
  initializeVectorPreProcessPass(Registry);
  initializeVectorProcessPass(Registry);
  initializeVerificationPassPass(Registry);
  initializeWaveAllJointReductionPass(Registry);
  initializeWGFuncResolutionLPMPass(Registry);
  initializeWIAnalysisPass(Registry);
  initializeWIFuncResolutionLPMPass(Registry);
  initializeWIFuncsAnalysisLPMPass(Registry);
  initializeWorkaroundAnalysisPass(Registry);
  initializeTranslationTablePass(Registry);
  initializeTrivialUnnecessaryTGMFenceEliminationPass(Registry);
  initializeSynchronizationObjectCoalescingPass(Registry);
  initializeHandleFRemInstructionsLPMPass(Registry);
  initializeRewriteLocalSizeLPMPass(Registry);
  initializeBIFTransformsLPMPass(Registry);
  IGC::initializeKernelFunctionCloningLPMPass(Registry);
  initializeMoveStaticAllocasLPMPass(Registry);
  initializeCodeAssumptionLPMPass(Registry);
  initializeNamedBarriersResolutionLPMPass(Registry);
  initializeUndefinedReferencesPassLPMPass(Registry);
  initializePurgeMetaDataUtilsLPMPass(Registry);
  initializeLegalizeFunctionSignaturesLPMPass(Registry);
  initializeBreakdownIntrinsicPassLPMPass(Registry);
  initializeCatchAllLineNumberLPMPass(Registry);
  initializeIGCLivenessAnalysisPass(Registry);
  initializeIGCRegisterPressurePrinterPass(Registry);
  initializeIGCRegisterPressurePublisherPass(Registry);
  initializeIGCVectorizerPass(Registry);
  initializeIGCVectorCoalescerPass(Registry);
  initializeIGCFunctionExternalRegPressureAnalysisPass(Registry);
  initializeSubGroupFuncsResolutionLPMPass(Registry);
  initializeSubGroupReductionPatternPass(Registry);
  initializeDeviceEnqueueFuncsAnalysisLPMPass(Registry);
  initializeDeviceEnqueueFuncsResolutionLPMPass(Registry);
  initializeGASResolvingLPMPass(Registry);
  initializeGASRetValuePropagatorLPMPass(Registry);
  initializeStaticGASResolutionLPMPass(Registry);
  initializeLowerByValAttributePass(Registry);
  initializeLowerGPCallArgLPMPass(Registry);
  IGC::initializePredefinedConstantResolvingLPMPass(Registry);
  initializePromoteToPredicatedMemoryAccessPass(Registry);
  initializeHoistConvOpToDomPass(Registry);
  initializeFixResourcePtrLPMPass(Registry);
  IGC::initializePushAnalysisPass(Registry);
  initializeTransformUnmaskedFunctionsPassLPMPass(Registry);
  initializeDisableInliningLPMPass(Registry);
  initializeDropTargetFunctionsLPMPass(Registry);
  initializeNanHandlingPass(Registry);
  initializeHalfPromotionPass(Registry);
  initializeCapLoopIterationsPass(Registry);
  initializeGenRotatePass(Registry);
  initializeVectorBitCastOptPass(Registry);
  initializeLoopCanonicalizationPass(Registry);
  initializeLoopSplitWidePHIsPass(Registry);
  initializeLoopAllocaUpperboundPass(Registry);
  initializeLoopHoistConstantPass(Registry);
  initializeSpecialCasesDisableLICMPass(Registry);
  initializePromoteResourceToDirectASPass(Registry);
  IGC::initializeUniformAssumptionsPass(Registry);
  initializeGEPLoopStrengthReductionPass(Registry);
  initializeGEPLoweringPass(Registry);
  initializePromoteStatelessToBindlessPass(Registry);
  IGC::initializeTypeDemotePass(Registry);
  IGC::initializeCallMergerPass(Registry);
  initializeMergeAllocasOCLPass(Registry);
  initializeMergeMemFromBranchOptPass(Registry);
  initializeGenXCodeGenModulePass(Registry);
  IGC::initializeExtractValuePairFixupPass(Registry);
  initializeEmu64OpsPass(Registry);
  initializeWAFMinFMaxPass(Registry);
  IGC::initializeAddrSpaceCastFixingLPMPass(Registry);
  initializePeepholeTypeLegalizerPass(Registry);
  initializeScalarizerCodeGenPass(Registry);
  initializeRegisterEstimatorPass(Registry);
  IGC::initializePreRARematFlagPass(Registry);
  IGC::initializeFoldKnownWorkGroupSizesLPMPass(Registry);
  IGC::initializeDeadPHINodeEliminationPass(Registry);
  IGC::initializeSinkCommonOffsetFromGEPPass(Registry);
  initializeSampleCmpToDiscardPass(Registry);
  initializeLowerInvokeSIMDLPMPass(Registry);
  initializeErrorCheckLPMPass(Registry);
  initializeRemoveNonPositionOutputPass(Registry);
  initializeImage3dToImage2darrayLPMPass(Registry);
  initializeBuiltinCallGraphAnalysisLPMPass(Registry);
  initializeEstimateFunctionSizePass(Registry);
  initializeDropTargetBBsPass(Registry);
  initializeLayoutPass(Registry);
  initializeGenFDIVEmulationPass(Registry);
  initializeLogicalAndToBranchPass(Registry);
  initializeFlattenSmallSwitchPass(Registry);
  initializeIGCIndirectICBPropagaionPass(Registry);
  initializeHoistFMulInLoopPassPass(Registry);
  IGC::initializeLoopDeadCodeEliminationPass(Registry);
  initializeDisableLoopUnrollOnRetryPass(Registry);
  initializeCustomLoopVersioningPass(Registry);
  initializeEarlyOutPatternsPass(Registry);
  initializeRematChainsAnalysisPass(Registry);
  initializeVectorShuffleAnalysisPass(Registry);
  IGC::initializeHoistCongruentPHIPass(Registry);
  IGC::initializeCodeSchedulingPass(Registry);
  IGC::initializeLatencyHidingAnalysisPass(Registry);
  IGC::initializeCodeSinkingPass(Registry);
  IGC::initializeCodeLoopSinkingPass(Registry);
  initializeSLMConstPropPass(Registry);
  IGC::initializeSimplifyConstantLPMPass(Registry);
  IGC::initializePromoteConstantLPMPass(Registry);
  initializeBlendToDiscardPass(Registry);
  initializeMarkReadOnlyLoadPass(Registry);
  initializeGenericCastToPtrOptLPMPass(Registry);
  initializeGenOptLegalizerPass(Registry);
  initializeLdShrinkPass(Registry);
  initializeSplitIndirectEEtoSelPass(Registry);
  initializeExpandNonUniformInsertElementPass(Registry);
  initializeAnnotateUniformAllocasPass(Registry);
  initializeAtomicOptPassPass(Registry);
  initializePrepareLoadsStoresPassPass(Registry);
  IGC::initializeGenSimplificationPass(Registry);
  initializeInlineUnmaskedFunctionsPassPass(Registry);
  initializePruneUnusedArgumentsPass(Registry);
  initializeGenStrengthReductionPass(Registry);
  initializeSamplerPerfOptPassPass(Registry);
  initializeGatingSimilarSamplesPass(Registry);
  IGC::initializeAdvMemOptPass(Registry);
  initializeStatelessToStatefulPass(Registry);
  initializeStatelessOffsetNarrowingPass(Registry);
  initializeMemOpt2Pass(Registry);
  initializeSplitLoadsPass(Registry);
  initializeResolveSampledImageBuiltinsLPMPass(Registry);
  initializeLowerImplicitArgIntrinsicsPass(Registry);
  initializeCanonicalizeMulAddPass(Registry);
  initializeCleanPHINodePass(Registry);
  IGC::initializeAddressArithmeticSinkingPass(Registry);
  initializeInsertBranchOptPass(Registry);
  initializeJointMatrixFuncsResolutionPassLPMPass(Registry);
  IGC::initializeMCSOptimizationPass(Registry);
  IGC::initializeAdvCodeMotionPass(Registry);
  initializeMadLoopSlicePass(Registry);
  IGC::initializeRematAddressArithmeticPass(Registry);
  IGC::initializeCloneAddressArithmeticPass(Registry);
  initializeRemoveCodeAssumptionsPass(Registry);
  IGC::initializeShrinkArrayAllocaPassPass(Registry);
  initializePoisonFP64KernelsLPMPass(Registry);
  initializeUnreachableHandlingPass(Registry);
  initializeClampICBOOBAccessPass(Registry);
  initializeGenUpdateCBPass(Registry);
  initializeRuntimeValueVectorExtractPassPass(Registry);
  IGC::initializeIndirectCallOptimizationPass(Registry);
  initializeCoalescingEnginePass(Registry);
  initializeVariableReuseAnalysisPass(Registry);
  initializePreprocessSPVIRLPMPass(Registry);
  initializeConvertUserSemanticDecoratorOnFunctionsLPMPass(Registry);
  initializePromoteSubByteLPMPass(Registry);
  initializeHandleSpirvDecorationMetadataLPMPass(Registry);
  initializeResolveConstExprCallsLPMPass(Registry);
  initializeDebugInfoPassPass(Registry);
  IGC::initializePrintCodeGenContextPassPass(Registry);
  initializeCodeGenContextWrapperPass(Registry);
  initializeSubroutineInlinerPass(Registry);
  IGC::initializeSerializePrintMetaDataPassPass(Registry);
  initializeBufferBoundsCheckingLPMPass(Registry);
  initializeBufferBoundsCheckingPatcherLPMPass(Registry);
  initializeFPRoundingModeCoalescingPass(Registry);
  initializeMinimumValidAddressCheckingLPMPass(Registry);
  initializeTranslateToProgrammableOffsetsPassPass(Registry);
  initializeDynamicRayManagementPassPass(Registry);
  IGC::initializeFreezeIntDivLPMPass(Registry);
  IGC::initializeEvaluateFreezePass(Registry);
  IGC::initializeGenerateFrequencyDataPass(Registry);
  IGC::initializeEmitPassPass(Registry);
  initializeNontemporalLoadsAndStoresInAssertLPMPass(Registry);
  initializeHandleDevicelibAssertLPMPass(Registry);
  initializeStackOverflowDetectionPassLPMPass(Registry);
  initializeInlineRaytracingPass(Registry);
  initializeBarrierControlFlowOptimizationPass(Registry);
  initializeLoopCountAnalysisPass(Registry);
  initializeRemoveLoopDependencyPass(Registry);
  initializeTraceRayInlineLoweringPassPass(Registry);
  initializeResourceLoopUnrollPass(Registry);
  initializeSubgroup2DBlockIoResolutionLPMPass(Registry);
  initializeSpvSubgroupMMAResolutionLPMPass(Registry);
  initializeInjectPrintfLPMPass(Registry);
  initializeWaveShuffleIndexSinkingPass(Registry);
  IGC::initializeAddRequiredMemoryFencesPass(Registry);
  initializeInstructionHoistingOptimizationPass(Registry);
  initializeSinkPointerConstAddPassPass(Registry);
  initializeWaveBallotCSEPass(Registry);
  initializeSpvPredicatedIOResolutionLPMPass(Registry);
  initializeProcessBICodeAssumptionLPMPass(Registry);
  initializePrintFPRangeAnalysisPass(Registry);
  initializeSimpleAluVectorizerPass(Registry);
  initializeRedundantOpsCSEPassPass(Registry);
  initializeStateIndexAddrChainCanonicalizePass(Registry);
}
