/*========================== 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 initializeKernelFunctionCloningPass(llvm::PassRegistry &);
void initializePredefinedConstantResolvingPass(llvm::PassRegistry &);
void initializePushAnalysisPass(llvm::PassRegistry &);
void initializeUniformAssumptionsPass(llvm::PassRegistry &);
void initializeTypeDemotePass(llvm::PassRegistry &);
void initializeCallMergerPass(llvm::PassRegistry &);
void initializeExtractValuePairFixupPass(llvm::PassRegistry &);
void initializeAddrSpaceCastFixingPass(llvm::PassRegistry &);
void initializePreRARematFlagPass(llvm::PassRegistry &);
void initializeFoldKnownWorkGroupSizesPass(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 initializeSimplifyConstantPass(llvm::PassRegistry &);
void initializePromoteConstantPass(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 initializeFreezeIntDivPass(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) {
  initializeAccuracyDecoratedCallsBiFResolutionPass(Registry);
  initializeAddImplicitArgsPass(Registry);
  initializeAddressSpaceAAWrapperPassPass(Registry);
  initializeRayTracingAddressSpaceAAWrapperPassPass(Registry);
  initializeIGCExternalAAWrapperPass(Registry);
  initializeAggregateArgumentsAnalysisPass(Registry);
  initializeAlignmentAnalysisPass(Registry);
  initializePreBIImportAnalysisPass(Registry);
  initializeBIImportPass(Registry);
  initializeBlockMemOpAddrScalarizationPassPass(Registry);
  initializeGenerateBlockMemOpsPassPass(Registry);
  initializeBreakConstantExprPass(Registry);
  initializeBuiltinsConverterPass(Registry);
  initializeCastToGASAnalysisPass(Registry);
  initializeCastToGASInfoPass(Registry);
  initializeCastToGASInfoWrapperPass(Registry);
  initializeConstantCoalescingPass(Registry);
  initializeCorrectlyRoundedDivSqrtPass(Registry);
  initializeConvertMSAAPayloadTo16BitPass(Registry);
  initializeCustomSafeOptPassPass(Registry);
  initializeCustomUnsafeOptPassPass(Registry);
  initializeDpasScanPass(Registry);
  initializeDynamicTextureFoldingPass(Registry);
  initializeSampleMultiversioningPass(Registry);
  initializeSimd32ProfitabilityAnalysisPass(Registry);
  initializeCheckInstrTypesPass(Registry);
  initializeExtensionArgAnalysisPass(Registry);
  initializeExtensionFuncsAnalysisPass(Registry);
  initializeExtensionFuncsResolutionPass(Registry);
  initializeFCmpPaternMatchPass(Registry);
  IGC::initializeFixInvalidFuncNamePass(Registry);
  initializeGenericAddressDynamicResolutionPass(Registry);
  initializeGenericNullPtrPropagationPass(Registry);
  initializeGenIRLoweringPass(Registry);
  initializeGenSpecificPatternPass(Registry);
  initializeHandleLoadStoreInstructionsPass(Registry);
  initializeIGCConstPropPass(Registry);
  initializeLowerSIMDSizePass(Registry);
  initializeImageFuncResolutionPass(Registry);
  initializeImageFuncsAnalysisPass(Registry);
  initializeIntDivRemCombinePass(Registry);
  initializeIntDivRemIncrementReductionPass(Registry);
  initializeIntDivConstantReductionPass(Registry);
  initializeInlineLocalsResolutionPass(Registry);
  initializePromoteInt8TypePass(Registry);
  initializeBfloatBuiltinsResolutionPass(Registry);
  initializeBfloatFuncsResolutionPass(Registry);
  initializeDpasFuncsResolutionPass(Registry);
  initializeDecompose2DBlockFuncsWithHoistingPass(Registry);
  initializeDecompose2DBlockFuncsPass(Registry);
  initializeLSCFuncsResolutionPass(Registry);
  initializePartialEmuI64OpsPass(Registry);
  initializePrepareInlineSamplerForBindlessPass(Registry);
  initializeLSCCacheOptimizationPassPass(Registry);
  IGC::initializeLSCCacheHintsPass(Registry);
  initializeResolveImageImplicitArgsForBindlessPass(Registry);
  initializeResolveInlineSamplerForBindlessPass(Registry);
  initializeResolveOCLRaytracingBuiltinsPass(Registry);
  initializeRayTracingIntrinsicResolutionPass(Registry);
  initializeRayTracingIntrinsicAnalysisPass(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);
  initializeOpenCLPrintfAnalysisPass(Registry);
  initializeOpenCLPrintfResolutionPass(Registry);
  initializePreCompiledFuncImportPass(Registry);
  initializePrivateMemoryResolutionPass(Registry);
  initializePrivateMemoryToSLMPass(Registry);
  initializePrivateMemoryUsageAnalysisPass(Registry);
  initializeProcessFuncAttributesPass(Registry);
  initializeProcessBuiltinMetaDataPass(Registry);
  initializePromoteConstantStructsPass(Registry);
  initializeInsertDummyKernelForSymbolTablePass(Registry);
  initializeCleanupIndirectlyReferencedFunctionsPass(Registry);
  initializeProgramScopeConstantAnalysisPass(Registry);
  initializeProgramScopeConstantResolutionPass(Registry);
  initializePropagateCmpUniformityPass(Registry);
  initializeReduceOptPassPass(Registry);
  initializeTypesLegalizationPassPass(Registry);
  initializeRegisterPressureEstimatePass(Registry);
  initializeReplaceUnsupportedIntrinsicsPass(Registry);
  initializeResolveAggregateArgumentsPass(Registry);
  initializeResolveOCLAtomicsPass(Registry);
  initializeResourceAllocatorPass(Registry);
  initializeRuntimeValueLegalizationPassPass(Registry);
  initializeScalarArgAsPointerAnalysisPass(Registry);
  initializeScalarizeFunctionPass(Registry);
  initializeSetFastMathFlagsPass(Registry);
  initializeSPIRMetaDataTranslationPass(Registry);
  initializeSplitStructurePhisPassPass(Registry);
  initializeMergeScalarPhisPassPass(Registry);
  initializeTypeLegalizerPass(Registry);
  initializeVectorPreProcessPass(Registry);
  initializeVectorProcessPass(Registry);
  initializeVerificationPassPass(Registry);
  initializeWaveAllJointReductionPass(Registry);
  initializeWGFuncResolutionPass(Registry);
  initializeWIAnalysisPass(Registry);
  initializeWIFuncResolutionPass(Registry);
  initializeWIFuncsAnalysisPass(Registry);
  initializeWorkaroundAnalysisPass(Registry);
  initializeTranslationTablePass(Registry);
  initializeTrivialUnnecessaryTGMFenceEliminationPass(Registry);
  initializeSynchronizationObjectCoalescingPass(Registry);
  initializeHandleFRemInstructionsPass(Registry);
  initializeRewriteLocalSizePass(Registry);
  initializeBIFTransformsPass(Registry);
  IGC::initializeKernelFunctionCloningPass(Registry);
  initializeMoveStaticAllocasPass(Registry);
  initializeCodeAssumptionPass(Registry);
  initializeNamedBarriersResolutionPass(Registry);
  initializeUndefinedReferencesPassPass(Registry);
  initializePurgeMetaDataUtilsPass(Registry);
  initializeLegalizeFunctionSignaturesPass(Registry);
  initializeBreakdownIntrinsicPassPass(Registry);
  initializeCatchAllLineNumberPass(Registry);
  initializeIGCLivenessAnalysisPass(Registry);
  initializeIGCRegisterPressurePrinterPass(Registry);
  initializeIGCRegisterPressurePublisherPass(Registry);
  initializeIGCVectorizerPass(Registry);
  initializeIGCVectorCoalescerPass(Registry);
  initializeIGCFunctionExternalRegPressureAnalysisPass(Registry);
  initializeSubGroupFuncsResolutionPass(Registry);
  initializeSubGroupReductionPatternPass(Registry);
  initializeDeviceEnqueueFuncsAnalysisPass(Registry);
  initializeDeviceEnqueueFuncsResolutionPass(Registry);
  initializeGASResolvingPass(Registry);
  initializeGASRetValuePropagatorPass(Registry);
  initializeStaticGASResolutionPass(Registry);
  initializeLowerByValAttributePass(Registry);
  initializeLowerGPCallArgPass(Registry);
  IGC::initializePredefinedConstantResolvingPass(Registry);
  initializePromoteToPredicatedMemoryAccessPass(Registry);
  initializeHoistConvOpToDomPass(Registry);
  initializeFixResourcePtrPass(Registry);
  IGC::initializePushAnalysisPass(Registry);
  initializeTransformUnmaskedFunctionsPassPass(Registry);
  initializeDisableInliningPass(Registry);
  initializeDropTargetFunctionsPass(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::initializeAddrSpaceCastFixingPass(Registry);
  initializePeepholeTypeLegalizerPass(Registry);
  initializeScalarizerCodeGenPass(Registry);
  initializeRegisterEstimatorPass(Registry);
  IGC::initializePreRARematFlagPass(Registry);
  IGC::initializeFoldKnownWorkGroupSizesPass(Registry);
  IGC::initializeDeadPHINodeEliminationPass(Registry);
  IGC::initializeSinkCommonOffsetFromGEPPass(Registry);
  initializeSampleCmpToDiscardPass(Registry);
  initializeLowerInvokeSIMDPass(Registry);
  initializeErrorCheckPass(Registry);
  initializeRemoveNonPositionOutputPass(Registry);
  initializeImage3dToImage2darrayPass(Registry);
  initializeBuiltinCallGraphAnalysisPass(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::initializeSimplifyConstantPass(Registry);
  IGC::initializePromoteConstantPass(Registry);
  initializeBlendToDiscardPass(Registry);
  initializeMarkReadOnlyLoadPass(Registry);
  initializeGenericCastToPtrOptPass(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);
  initializeResolveSampledImageBuiltinsPass(Registry);
  initializeLowerImplicitArgIntrinsicsPass(Registry);
  initializeCanonicalizeMulAddPass(Registry);
  initializeCleanPHINodePass(Registry);
  IGC::initializeAddressArithmeticSinkingPass(Registry);
  initializeInsertBranchOptPass(Registry);
  initializeJointMatrixFuncsResolutionPassPass(Registry);
  IGC::initializeMCSOptimizationPass(Registry);
  IGC::initializeAdvCodeMotionPass(Registry);
  initializeMadLoopSlicePass(Registry);
  IGC::initializeRematAddressArithmeticPass(Registry);
  IGC::initializeCloneAddressArithmeticPass(Registry);
  initializeRemoveCodeAssumptionsPass(Registry);
  IGC::initializeShrinkArrayAllocaPassPass(Registry);
  initializePoisonFP64KernelsPass(Registry);
  initializeUnreachableHandlingPass(Registry);
  initializeClampICBOOBAccessPass(Registry);
  initializeGenUpdateCBPass(Registry);
  initializeRuntimeValueVectorExtractPassPass(Registry);
  IGC::initializeIndirectCallOptimizationPass(Registry);
  initializeCoalescingEnginePass(Registry);
  initializeVariableReuseAnalysisPass(Registry);
  initializePreprocessSPVIRPass(Registry);
  initializeConvertUserSemanticDecoratorOnFunctionsPass(Registry);
  initializePromoteSubBytePass(Registry);
  initializeHandleSpirvDecorationMetadataPass(Registry);
  initializeResolveConstExprCallsPass(Registry);
  initializeDebugInfoPassPass(Registry);
  IGC::initializePrintCodeGenContextPassPass(Registry);
  initializeCodeGenContextWrapperPass(Registry);
  initializeSubroutineInlinerPass(Registry);
  IGC::initializeSerializePrintMetaDataPassPass(Registry);
  initializeBufferBoundsCheckingPass(Registry);
  initializeBufferBoundsCheckingPatcherPass(Registry);
  initializeFPRoundingModeCoalescingPass(Registry);
  initializeMinimumValidAddressCheckingPass(Registry);
  initializeTranslateToProgrammableOffsetsPassPass(Registry);
  initializeDynamicRayManagementPassPass(Registry);
  IGC::initializeFreezeIntDivPass(Registry);
  IGC::initializeEvaluateFreezePass(Registry);
  IGC::initializeGenerateFrequencyDataPass(Registry);
  IGC::initializeEmitPassPass(Registry);
  initializeNontemporalLoadsAndStoresInAssertPass(Registry);
  initializeHandleDevicelibAssertPass(Registry);
  initializeStackOverflowDetectionPassPass(Registry);
  initializeInlineRaytracingPass(Registry);
  initializeBarrierControlFlowOptimizationPass(Registry);
  initializeLoopCountAnalysisPass(Registry);
  initializeRemoveLoopDependencyPass(Registry);
  initializeTraceRayInlineLoweringPassPass(Registry);
  initializeResourceLoopUnrollPass(Registry);
  initializeSpv2dBlockIOResolutionPass(Registry);
  initializeSpvSubgroupMMAResolutionPass(Registry);
  initializeInjectPrintfPass(Registry);
  initializeWaveShuffleIndexSinkingPass(Registry);
  IGC::initializeAddRequiredMemoryFencesPass(Registry);
  initializeInstructionHoistingOptimizationPass(Registry);
  initializeSinkPointerConstAddPassPass(Registry);
  initializeWaveBallotCSEPass(Registry);
  initializeSpvPredicatedIOResolutionPass(Registry);
  initializeProcessBICodeAssumptionPass(Registry);
  initializePrintFPRangeAnalysisPass(Registry);
  initializeSimpleAluVectorizerPass(Registry);
  initializeRedundantOpsCSEPassPass(Registry);
  initializeStateIndexAddrChainCanonicalizePass(Registry);
}
