LLVM 24.0.0git
WebAssembly.h
Go to the documentation of this file.
1//===-- WebAssembly.h - Top-level interface for WebAssembly ----*- 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/// \file
10/// This file contains the entry points for global functions defined in
11/// the LLVM WebAssembly back-end.
12///
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLY_H
16#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLY_H
17
24#include "llvm/IR/Analysis.h"
25#include "llvm/IR/PassManager.h"
26#include "llvm/PassRegistry.h"
28
29namespace llvm {
30
32class ModulePass;
33class FunctionPass;
34
35// LLVM IR passes.
37 : public RequiredPassInfoMixin<WebAssemblyLowerEmscriptenEHSjLjPass> {
38public:
40};
41
43
45 : public RequiredPassInfoMixin<WebAssemblyAddMissingPrototypesPass> {
46public:
48};
49
51
53 : public RequiredPassInfoMixin<WebAssemblyFixFunctionBitcastsPass> {
54public:
56};
57
59
61 : public OptionalPassInfoMixin<WebAssemblyOptimizeReturnedPass> {
62public:
64};
65
67
69 : public RequiredPassInfoMixin<WebAssemblyRefTypeMem2LocalPass> {
70public:
72};
73
75
77 : public RequiredPassInfoMixin<WebAssemblyReduceToAnyAllTruePass> {
78private:
79 Module *CachedModule = nullptr;
80 bool ModuleHasInterestingIntrinsics = false;
82
83public:
86};
87
88FunctionPass *
89createWebAssemblyReduceToAnyAllTrueLegacyPass(WebAssemblyTargetMachine &TM);
90
101
104
105// GlobalISel
108 const WebAssemblySubtarget &,
110
113
116
117// ISel and immediate followup passes.
123
125 CodeGenOptLevel OptLevel);
126
128 : public RequiredPassInfoMixin<WebAssemblyArgumentMovePass> {
129public:
132};
133
135
137 : public RequiredPassInfoMixin<WebAssemblySetP2AlignOperandsPass> {
138public:
141};
142
144
146 : public RequiredPassInfoMixin<WebAssemblyCleanCodeAfterTrapPass> {
147public:
150};
151
153
154// Late passes.
156 : public RequiredPassInfoMixin<WebAssemblyReplacePhysRegsPass> {
157public:
160};
161
163
165 : public RequiredPassInfoMixin<WebAssemblyNullifyDebugValueListsPass> {
166public:
169};
170
176
178 : public RequiredPassInfoMixin<WebAssemblyFixBrTableDefaultsPass> {
179public:
182};
183
185
187 : public RequiredPassInfoMixin<WebAssemblyFixIrreducibleControlFlowPass> {
188public:
191};
192
194
196 : public RequiredPassInfoMixin<WebAssemblyLateEHPreparePass> {
197public:
200};
201
212
213// PassRegistry initialization declarations.
243 PassRegistry &);
244
245namespace WebAssembly {
247 // Followed by a local index (ULEB).
249 // Followed by an absolute global index (ULEB). DEPRECATED.
251 // Followed by the index from the bottom of the Wasm stack.
253 // Followed by a compilation unit relative global index (uint32_t)
254 // that will have an associated relocation.
256 // Like TI_LOCAL, but indicates an indirect value (e.g. byval arg
257 // passed by pointer).
259};
260} // end namespace WebAssembly
261
262} // end namespace llvm
263
264#endif
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition MD5.cpp:54
FunctionAnalysisManager FAM
ModuleAnalysisManager MAM
This file declares the targeting of the RegisterBankInfo class for WebAssembly.
This file declares the WebAssembly-specific subclass of TargetSubtarget.
FunctionPass class - This class is used to implement most global optimizations.
Definition Pass.h:314
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition Pass.h:255
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
SelectionDAGISelPass(std::unique_ptr< SelectionDAGISel > Selector)
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM)
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
WebAssemblyCoalesceFeaturesAndStripAtomicsPass(WebAssemblyTargetMachine &TM)
Definition WebAssembly.h:97
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM)
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
WebAssemblyISelDAGToDAGPass(WebAssemblyTargetMachine &TM, CodeGenOptLevel OptLevel)
This pass converts a legalized DAG into a WebAssembly-specific DAG, ready for instruction scheduling.
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM)
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
WebAssemblyReduceToAnyAllTruePass(WebAssemblyTargetMachine &TM)
Definition WebAssembly.h:84
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
This class provides the information for the target register banks.
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
Pass manager infrastructure for declaring and invalidating analyses.
This is an optimization pass for GlobalISel generic memory operations.
void initializeWebAssemblyLowerBrUnlessPass(PassRegistry &)
FunctionPass * createWebAssemblyRegNumbering()
FunctionPass * createWebAssemblyCleanCodeAfterTrapLegacyPass()
void initializeWebAssemblySetP2AlignOperandsLegacyPass(PassRegistry &)
void initializeWebAssemblyPostLegalizerCombinerPass(PassRegistry &)
void initializeWebAssemblyExceptionInfoPass(PassRegistry &)
void initializeWebAssemblyRegNumberingPass(PassRegistry &)
void initializeWebAssemblyDAGToDAGISelLegacyPass(PassRegistry &)
void initializeWebAssemblyCleanCodeAfterTrapLegacyPass(PassRegistry &)
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
FunctionPass * createWebAssemblySetP2AlignOperandsLegacyPass()
FunctionPass * createWebAssemblyRegStackify(CodeGenOptLevel OptLevel)
void initializeWebAssemblyLateEHPrepareLegacyPass(PassRegistry &)
void initializeWebAssemblyRegColoringPass(PassRegistry &)
void initializeWebAssemblyNullifyDebugValueListsLegacyPass(PassRegistry &)
FunctionPass * createWebAssemblyArgumentMoveLegacyPass()
FunctionPass * createWebAssemblyMemIntrinsicResults()
void initializeWebAssemblyRefTypeMem2LocalLegacyPass(PassRegistry &)
FunctionPass * createWebAssemblyDebugFixup()
void initializeWebAssemblyFixFunctionBitcastsLegacyPass(PassRegistry &)
FunctionPass * createWebAssemblyReduceToAnyAllTrueLegacyPass(WebAssemblyTargetMachine &TM)
void initializeWebAssemblyRegStackifyPass(PassRegistry &)
FunctionPass * createWebAssemblyCFGStackify()
FunctionPass * createWebAssemblyOptimizeLiveIntervals()
FunctionPass * createWebAssemblyFixIrreducibleControlFlowLegacyPass()
void initializeWebAssemblyCoalesceFeaturesAndStripAtomicsLegacyPass(PassRegistry &)
CodeGenOptLevel
Code generation optimization level.
Definition CodeGen.h:82
ModulePass * createWebAssemblyCoalesceFeaturesAndStripAtomicsLegacyPass(WebAssemblyTargetMachine &TM)
FunctionPass * createWebAssemblyRefTypeMem2LocalLegacyPass()
void initializeWebAssemblyArgumentMoveLegacyPass(PassRegistry &)
void initializeWebAssemblyOptimizeLiveIntervalsPass(PassRegistry &)
void initializeWebAssemblyOptimizeReturnedLegacyPass(PassRegistry &)
ModulePass * createWebAssemblyFixFunctionBitcastsLegacyPass()
void initializeWebAssemblyPreLegalizerCombinerPass(PassRegistry &)
FunctionPass * createWebAssemblyVecReduce()
void initializeWebAssemblyLowerEmscriptenEHSjLjLegacyPass(PassRegistry &)
FunctionPass * createWebAssemblyExplicitLocals()
FunctionPass * createWebAssemblyOptimizeReturnedLegacyPass()
ModulePass * createWebAssemblyLowerEmscriptenEHSjLjLegacyPass()
void initializeWebAssemblyFixBrTableDefaultsLegacyPass(PassRegistry &)
void initializeWebAssemblyMemIntrinsicResultsPass(PassRegistry &)
void initializeWebAssemblyMCLowerPrePassPass(PassRegistry &)
void initializeWebAssemblyExplicitLocalsPass(PassRegistry &)
FunctionPass * createWebAssemblyPreLegalizerCombiner()
void initializeWebAssemblyAddMissingPrototypesLegacyPass(PassRegistry &)
FunctionPass * createWebAssemblyLowerBrUnless()
FunctionPass * createWebAssemblyFixBrTableDefaultsLegacyPass()
FunctionPass * createWebAssemblyISelDagLegacyPass(WebAssemblyTargetMachine &TM, CodeGenOptLevel OptLevel)
FunctionPass * createWebAssemblyRegColoring()
FunctionPass * createWebAssemblyNullifyDebugValueListsLegacyPass()
InstructionSelector * createWebAssemblyInstructionSelector(const WebAssemblyTargetMachine &TM, const WebAssemblySubtarget &Subtarget, const WebAssemblyRegisterBankInfo &RBI)
void initializeWebAssemblyPeepholePass(PassRegistry &)
ModulePass * createWebAssemblyMCLowerPrePass()
void initializeWebAssemblyFixIrreducibleControlFlowLegacyPass(PassRegistry &)
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
ModulePass * createWebAssemblyAddMissingPrototypesLegacyPass()
FunctionPass * createWebAssemblyCFGSort()
void initializeWebAssemblyCFGSortPass(PassRegistry &)
FunctionPass * createWebAssemblyReplacePhysRegsLegacyPass()
FunctionPass * createWebAssemblyPostLegalizerCombiner()
void initializeWebAssemblyAsmPrinterPass(PassRegistry &)
void initializeWebAssemblyReplacePhysRegsLegacyPass(PassRegistry &)
void initializeWebAssemblyCFGStackifyPass(PassRegistry &)
void initializeWebAssemblyDebugFixupPass(PassRegistry &)
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
FunctionPass * createWebAssemblyLateEHPrepareLegacyPass()
FunctionPass * createWebAssemblyPeephole()
A CRTP mix-in for passes that can be skipped.
A CRTP mix-in for passes that should not be skipped.