50class WebAssemblyCodeGenPassBuilder
52 WebAssemblyTargetMachine> {
75 disablePass<RegisterCoalescerPass>();
78 void addIRPasses(PassManagerWrapper &PMW)
const;
79 void addISelPrepare(PassManagerWrapper &PMW)
const;
80 Error addInstSelector(PassManagerWrapper &PMW)
const;
81 void addPreEmitPass(PassManagerWrapper &PMW)
const;
87 addModulePass(WebAssemblyAddMissingPrototypesPass(), PMW);
90 addModulePass(LowerGlobalDtorsPass(), PMW);
94 addModulePass(WebAssemblyFixFunctionBitcastsPass(), PMW);
97 if (getOptLevel() != CodeGenOptLevel::None)
98 addFunctionPass(WebAssemblyOptimizeReturnedPass(), PMW);
107 addFunctionPass(LowerInvokePass(), PMW);
110 addFunctionPass(UnreachableBlockElimPass(), PMW);
119 addModulePass(WebAssemblyLowerEmscriptenEHSjLjPass(), PMW);
123 addFunctionPass(IndirectBrExpandPass(TM), PMW);
126 addFunctionPass(WebAssemblyReduceToAnyAllTruePass(TM), PMW);
128 Base::addIRPasses(PMW);
131void WebAssemblyCodeGenPassBuilder::addISelPrepare(
132 PassManagerWrapper &PMW)
const {
135 addFunctionPass(WebAssemblyRefTypeMem2LocalPass(), PMW);
138 addModulePass(WebAssemblyCoalesceFeaturesAndStripAtomicsPass(TM), PMW);
141 addFunctionPass(AtomicExpandPass(TM), PMW);
143 Base::addISelPrepare(PMW);
146Error WebAssemblyCodeGenPassBuilder::addInstSelector(
147 PassManagerWrapper &PMW)
const {
148 addMachineFunctionPass(WebAssemblyISelDAGToDAGPass(TM, getOptLevel()), PMW);
153 addMachineFunctionPass(WebAssemblyArgumentMovePass(), PMW);
170void WebAssemblyCodeGenPassBuilder::addPreEmitPass(
171 PassManagerWrapper &PMW)
const {
172 Base::addPreEmitPass(PMW);
175 addMachineFunctionPass(WebAssemblyNullifyDebugValueListsPass(), PMW);
179 addMachineFunctionPass(UnreachableMachineBlockElimPass(), PMW);
182 addMachineFunctionPass(WebAssemblyFixIrreducibleControlFlowPass(), PMW);
196 if (getOptLevel() != CodeGenOptLevel::None) {
211 if (getOptLevel() != CodeGenOptLevel::None) {
234 if (getOptLevel() != CodeGenOptLevel::None) {
253#define GET_PASS_REGISTRY "WebAssemblyPassRegistry.def"
262 auto CGPB = WebAssemblyCodeGenPassBuilder(*
this, Opt,
PIC);
263 return CGPB.buildPipeline(MPM,
MAM, Out, DwoOut, FileType, Ctx);
Interfaces for producing common pass manager configurations.
ModuleAnalysisManager MAM
PassInstrumentationCallbacks PIC
PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC)
This file defines the Pass Instrumentation classes that provide instrumentation points into the pass ...
cl::opt< bool > WasmEnableEH
cl::opt< bool > WasmEnableSjLj
cl::opt< bool > WasmEnableEmEH
cl::opt< bool > WasmEnableEmSjLj
cl::opt< bool > WasmDisableExplicitLocals
This file declares the WebAssembly-specific subclass of TargetMachine.
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end.
This class provides access to building LLVM's passes.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Context object for machine code objects.
This class provides access to building LLVM's passes.
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
ExceptionHandling ExceptionModel
What exception model to use.
void registerPassBuilderCallbacks(PassBuilder &PbB) override
Allow the target to modify the pass pipeline.
Error buildCodeGenPipeline(ModulePassManager &MPM, ModuleAnalysisManager &MAM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, const CGPassBuilderOption &Opt, MCContext &Ctx, PassInstrumentationCallbacks *PIC) override
An abstract base class for streams implementations that also support a pwrite operation.
Interfaces for registering analysis passes, producing common pass manager configurations,...
cl::opt< bool > WasmEnableEmEH
cl::opt< bool > WasmEnableEH
cl::opt< bool > WasmEnableSjLj
cl::opt< bool > WasmEnableEmSjLj
cl::opt< bool > WasmDisableExplicitLocals
cl::opt< bool > WasmEnableEH
cl::opt< bool > WasmEnableSjLj
cl::opt< bool > WasmEnableEmEH
cl::opt< bool > WasmEnableEmSjLj
cl::opt< bool > WasmDisableExplicitLocals
This is an optimization pass for GlobalISel generic memory operations.
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit,...
PassManager< Module > ModulePassManager
Convenience typedef for a pass manager over modules.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.