| 1 | //===- DirectXPassRegistry.def - Registry of DirectX 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 | // DirectX backend. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | // NOTE: NO INCLUDE GUARD DESIRED! |
| 15 | |
| 16 | #ifndef MODULE_ANALYSIS |
| 17 | #define MODULE_ANALYSIS(NAME, CREATE_PASS) |
| 18 | #endif |
| 19 | MODULE_ANALYSIS("dx-shader-flags" , dxil::ShaderFlagsAnalysis()) |
| 20 | MODULE_ANALYSIS("dxil-root-signature-analysis" , dxil::RootSignatureAnalysis()) |
| 21 | MODULE_ANALYSIS("dxil-signature-analysis" , dxil::SignatureAnalysis()) |
| 22 | #undef MODULE_ANALYSIS |
| 23 | |
| 24 | #ifndef MODULE_PASS |
| 25 | #define MODULE_PASS(NAME, CREATE_PASS) |
| 26 | #endif |
| 27 | MODULE_PASS("dxil-asm-printer-begin" , DXILAsmPrinterBeginPass()) |
| 28 | MODULE_PASS("dxil-asm-printer-end" , DXILAsmPrinterEndPass()) |
| 29 | MODULE_PASS("dxil-cbuffer-access" , DXILCBufferAccessPass()) |
| 30 | MODULE_PASS("dxil-container-globals" , DXILContainerGlobalsPass()) |
| 31 | MODULE_PASS("dxil-container-pdb" , DXILContainerPDBPass()) |
| 32 | MODULE_PASS("dxil-finalize-linkage" , DXILFinalizeLinkagePass()) |
| 33 | MODULE_PASS("dxil-data-scalarization" , DXILDataScalarizationPass()) |
| 34 | MODULE_PASS("dxil-flatten-arrays" , DXILFlattenArraysPass()) |
| 35 | MODULE_PASS("dxil-debug-info" , DXILDebugInfoPass()) |
| 36 | MODULE_PASS("dxil-embedder" , DXILEmbedderPass()) |
| 37 | MODULE_PASS("dxil-intrinsic-expansion" , DXILIntrinsicExpansionPass()) |
| 38 | MODULE_PASS("dxil-mem-intrinsics" , DXILMemIntrinsicsPass()) |
| 39 | MODULE_PASS("dxil-op-lower" , DXILOpLoweringPass()) |
| 40 | MODULE_PASS("dxil-prepare-module" , DXILPrepareModulePass()) |
| 41 | MODULE_PASS("dxil-pretty-printer" , DXILPrettyPrinterPass(dbgs())) |
| 42 | MODULE_PASS("dxil-translate-metadata" , DXILTranslateMetadataPass()) |
| 43 | MODULE_PASS("dxil-resource-implicit-binding" , DXILResourceImplicitBindingPass()) |
| 44 | MODULE_PASS("dxil-post-optimization-validation" , DXILPostOptimizationValidationPass()) |
| 45 | MODULE_PASS("dxil-writer" , DXILWriterPass()) |
| 46 | // TODO: rename to print<foo> after NPM switch |
| 47 | MODULE_PASS("print-dx-shader-flags" , dxil::ShaderFlagsAnalysisPrinterPass(dbgs())) |
| 48 | MODULE_PASS("print<dxil-root-signature>" , dxil::RootSignatureAnalysisPrinterPass(dbgs())) |
| 49 | MODULE_PASS("print<dxil-signature>" , dxil::SignatureAnalysisPrinterPass(dbgs())) |
| 50 | #undef MODULE_PASS |
| 51 | |
| 52 | #ifndef FUNCTION_PASS |
| 53 | #define FUNCTION_PASS(NAME, CREATE_PASS) |
| 54 | #endif |
| 55 | FUNCTION_PASS("dxil-forward-handle-accesses" , DXILForwardHandleAccessesPass()) |
| 56 | FUNCTION_PASS("dxil-remove-unused-resources" , DXILRemoveUnusedResourcesPass()) |
| 57 | FUNCTION_PASS("dxil-resource-access" , DXILResourceAccessPass()) |
| 58 | FUNCTION_PASS("dxil-legalize" , DXILLegalizePass()) |
| 59 | #undef FUNCTION_PASS |
| 60 | |
| 61 | #ifndef MACHINE_FUNCTION_PASS |
| 62 | #define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS) |
| 63 | #endif |
| 64 | MACHINE_FUNCTION_PASS("dxil-asm-printer" , DXILAsmPrinterPass()) |
| 65 | #undef MACHINE_FUNCTION_PASS |
| 66 | |