1//===- AMDGPUPassRegistry.def - Registry of AMDGPU 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// AMDGPU backend.
11//
12//===----------------------------------------------------------------------===//
13
14// NOTE: NO INCLUDE GUARD DESIRED!
15
16#ifndef MODULE_PASS
17#define MODULE_PASS(NAME, CREATE_PASS)
18#endif
19MODULE_PASS("amdgpu-always-inline", AMDGPUAlwaysInlinePass())
20MODULE_PASS("amdgpu-attributor", AMDGPUAttributorPass(*this))
21MODULE_PASS("amdgpu-lower-buffer-fat-pointers",
22 AMDGPULowerBufferFatPointersPass(*this))
23MODULE_PASS("amdgpu-lower-ctor-dtor", AMDGPUCtorDtorLoweringPass())
24MODULE_PASS("amdgpu-lower-module-lds", AMDGPULowerModuleLDSPass(*this))
25MODULE_PASS("amdgpu-printf-runtime-binding", AMDGPUPrintfRuntimeBindingPass())
26MODULE_PASS("amdgpu-unify-metadata", AMDGPUUnifyMetadataPass())
27#undef MODULE_PASS
28
29#ifndef FUNCTION_PASS
30#define FUNCTION_PASS(NAME, CREATE_PASS)
31#endif
32FUNCTION_PASS("amdgpu-codegenprepare", AMDGPUCodeGenPreparePass(*this))
33FUNCTION_PASS("amdgpu-image-intrinsic-opt",
34 AMDGPUImageIntrinsicOptimizerPass(*this))
35FUNCTION_PASS("amdgpu-lower-kernel-arguments",
36 AMDGPULowerKernelArgumentsPass(*this))
37FUNCTION_PASS("amdgpu-lower-kernel-attributes",
38 AMDGPULowerKernelAttributesPass())
39FUNCTION_PASS("amdgpu-simplifylib", AMDGPUSimplifyLibCallsPass())
40FUNCTION_PASS("amdgpu-promote-alloca", AMDGPUPromoteAllocaPass(*this))
41FUNCTION_PASS("amdgpu-promote-alloca-to-vector",
42 AMDGPUPromoteAllocaToVectorPass(*this))
43FUNCTION_PASS("amdgpu-promote-kernel-arguments",
44 AMDGPUPromoteKernelArgumentsPass())
45FUNCTION_PASS("amdgpu-rewrite-undef-for-phi", AMDGPURewriteUndefForPHIPass())
46FUNCTION_PASS("amdgpu-unify-divergent-exit-nodes",
47 AMDGPUUnifyDivergentExitNodesPass())
48FUNCTION_PASS("amdgpu-usenative", AMDGPUUseNativeCallsPass())
49#undef FUNCTION_PASS
50
51#ifndef FUNCTION_ANALYSIS
52#define FUNCTION_ANALYSIS(NAME, CREATE_PASS)
53#endif
54
55#ifndef FUNCTION_ALIAS_ANALYSIS
56#define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \
57 FUNCTION_ANALYSIS(NAME, CREATE_PASS)
58#endif
59FUNCTION_ALIAS_ANALYSIS("amdgpu-aa", AMDGPUAA())
60#undef FUNCTION_ALIAS_ANALYSIS
61#undef FUNCTION_ANALYSIS
62
63#ifndef FUNCTION_PASS_WITH_PARAMS
64#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS)
65#endif
66FUNCTION_PASS_WITH_PARAMS(
67 "amdgpu-atomic-optimizer",
68 "AMDGPUAtomicOptimizerPass",
69 [=](ScanOptions Strategy) {
70 return AMDGPUAtomicOptimizerPass(*this, Strategy);
71 },
72 parseAMDGPUAtomicOptimizerStrategy, "strategy=dpp|iterative|none")
73#undef FUNCTION_PASS_WITH_PARAMS
74
75#ifndef MACHINE_FUNCTION_PASS
76#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS)
77#endif
78MACHINE_FUNCTION_PASS("amdgpu-isel", AMDGPUISelDAGToDAGPass(*this))
79#undef MACHINE_FUNCTION_PASS
80