1//===----------------------------------------------------------------------===//
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 WebAssembly
10// backend.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MODULE_PASS
15#define MODULE_PASS(NAME, CREATE_PASS)
16#endif
17MODULE_PASS("wasm-add-missing-prototypes", WebAssemblyAddMissingPrototypesPass())
18MODULE_PASS("wasm-coalesce-features-and-strip-atomics",
19 WebAssemblyCoalesceFeaturesAndStripAtomicsPass(*this))
20MODULE_PASS("wasm-fix-function-bitcasts", WebAssemblyFixFunctionBitcastsPass())
21MODULE_PASS("wasm-lower-em-ehsjlj", WebAssemblyLowerEmscriptenEHSjLjPass())
22#undef MODULE_PASS
23
24#ifndef FUNCTION_PASS
25#define FUNCTION_PASS(NAME, CREATE_PASS)
26#endif
27FUNCTION_PASS("wasm-optimize-returned", WebAssemblyOptimizeReturnedPass())
28FUNCTION_PASS("wasm-reduce-to-any-all-true", WebAssemblyReduceToAnyAllTruePass(*this))
29FUNCTION_PASS("wasm-ref-type-mem2local", WebAssemblyRefTypeMem2LocalPass())
30#undef FUNCTION_PASS
31
32#ifndef MACHINE_FUNCTION_PASS
33#define MACHINE_FUNCTION_PASS(NAME, CREATE_PASS)
34#endif
35MACHINE_FUNCTION_PASS("wasm-argument-move", WebAssemblyArgumentMovePass())
36MACHINE_FUNCTION_PASS("wasm-clean-code-after-trap",
37 WebAssemblyCleanCodeAfterTrapPass())
38MACHINE_FUNCTION_PASS("wasm-isel", WebAssemblyISelDAGToDAGPass(*this, getOptLevel()))
39MACHINE_FUNCTION_PASS("wasm-fix-br-table-defaults",
40 WebAssemblyFixBrTableDefaultsPass())
41MACHINE_FUNCTION_PASS("wasm-fix-irreducible-control-flow",
42 WebAssemblyFixIrreducibleControlFlowPass())
43MACHINE_FUNCTION_PASS("wasm-late-eh-prepare", WebAssemblyLateEHPreparePass())
44MACHINE_FUNCTION_PASS("wasm-nullify-dbg-value-lists",
45 WebAssemblyNullifyDebugValueListsPass())
46MACHINE_FUNCTION_PASS("wasm-replace-phys-regs", WebAssemblyReplacePhysRegsPass())
47MACHINE_FUNCTION_PASS("wasm-set-p2align-operands",
48 WebAssemblySetP2AlignOperandsPass())
49#undef MACHINE_FUNCTION_PASS
50