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