| 1 | //===- SPIRVPassRegistry.def - Registry of SPIRV passes -----*- C++--*-===// |
| 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 is used as the registry of passes that are part of the |
| 10 | // SPIRV backend. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | // NOTE: NO INCLUDE GUARD DESIRED! |
| 15 | |
| 16 | #ifndef MODULE_PASS |
| 17 | #define MODULE_PASS(NAME, CREATE_PASS) |
| 18 | #endif |
| 19 | MODULE_PASS("spirv-asm-printer-begin" , SPIRVAsmPrinterBeginPass()) |
| 20 | MODULE_PASS("spirv-asm-printer-end" , SPIRVAsmPrinterEndPass()) |
| 21 | MODULE_PASS("spirv-cbuffer-access" , SPIRVCBufferAccessPass()) |
| 22 | MODULE_PASS("spirv-emit-intrinsics" , SPIRVEmitIntrinsicsPass(*static_cast<const SPIRVTargetMachine *>(this))) |
| 23 | MODULE_PASS("spirv-finalize-shader-linkage" , SPIRVFinalizeShaderLinkagePass(*static_cast<const SPIRVTargetMachine *>(this))) |
| 24 | MODULE_PASS("spirv-legalize-implicit-binding" , SPIRVLegalizeImplicitBindingPass()) |
| 25 | MODULE_PASS("spirv-legalize-zero-size-arrays" , SPIRVLegalizeZeroSizeArraysPass(*static_cast<const SPIRVTargetMachine *>(this))) |
| 26 | MODULE_PASS("spirv-lower-ctor-dtor" , SPIRVCtorDtorLoweringPass()) |
| 27 | MODULE_PASS("spirv-prepare-functions" , SPIRVPrepareFunctionsPass(*static_cast<const SPIRVTargetMachine *>(this))) |
| 28 | MODULE_PASS("spirv-prepare-globals" , SPIRVPrepareGlobalsPass()) |
| 29 | MODULE_PASS("spirv-pushconstant-access" , SPIRVPushConstantAccessPass(*static_cast<const SPIRVTargetMachine *>(this))) |
| 30 | #undef MODULE_PASS |
| 31 | |
| 32 | #ifndef FUNCTION_PASS |
| 33 | #define FUNCTION_PASS(NAME, CREATE_PASS) |
| 34 | #endif |
| 35 | FUNCTION_PASS("spirv-legalize-pointer-cast" , SPIRVLegalizePointerCastPass(*static_cast<const SPIRVTargetMachine *>(this))) |
| 36 | FUNCTION_PASS("spirv-merge-region-exits" , SPIRVMergeRegionExitTargetsPass()) |
| 37 | FUNCTION_PASS("spirv-regularizer" , SPIRVRegularizerPass()) |
| 38 | FUNCTION_PASS("spirv-structurizer" , SPIRVStructurizerPass()) |
| 39 | #undef FUNCTION_PASS |
| 40 | |
| 41 | #ifndef FUNCTION_ANALYSIS |
| 42 | #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) |
| 43 | #endif |
| 44 | FUNCTION_ANALYSIS("spirv-convergence-region" , SPIRVConvergenceRegionAnalysis()) |
| 45 | #undef FUNCTION_ANALYSIS |
| 46 | |
| 47 | #ifndef MACHINE_FUNCTION_PASS |
| 48 | #define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) |
| 49 | #endif |
| 50 | MACHINE_FUNCTION_PASS("spirv-asm-printer" , SPIRVAsmPrinterPass()) |
| 51 | MACHINE_FUNCTION_PASS("spirv-postlegalizer" , SPIRVPostLegalizerPass()) |
| 52 | MACHINE_FUNCTION_PASS("spirv-prelegalizer" , SPIRVPreLegalizerPass()) |
| 53 | MACHINE_FUNCTION_PASS("spirv-prelegalizer-combiner" , SPIRVPreLegalizerCombinerPass()) |
| 54 | #undef MACHINE_FUNCTION_PASS |
| 55 | |