32#define DEBUG_TYPE "wasm-mclower-prepass"
35class WebAssemblyMCLowerPreLegacy final :
public ModulePass {
37 return "WebAssembly MC Lower Pre Pass";
45 bool runOnModule(
Module &M)
override;
49 WebAssemblyMCLowerPreLegacy() :
ModulePass(ID) {}
53char WebAssemblyMCLowerPreLegacy::ID = 0;
55 "Collects information ahead of time for MC lowering",
false,
59 return new WebAssemblyMCLowerPreLegacy();
79 "********** Function: "
83 for (
auto &
MI :
MBB) {
85 if (
MI.isDebugInstr() ||
MI.isInlineAsm())
97bool WebAssemblyMCLowerPreLegacy::runOnModule(
Module &M) {
98 auto *MMIWP = getAnalysisIfAvailable<MachineModuleInfoWrapperPass>();
101 MachineModuleInfo &MMI = MMIWP->getMMI();
102 mcLower(M, MMI, [MMIWP](Function *
F) {
103 return MMIWP->getMMI().getMachineFunction(*
F);
116 return MFA ? &MFA->
getMF() :
nullptr;
Module.h This file contains the declarations for the Module class.
This header defines various interfaces for pass management in LLVM.
ModuleAnalysisManager MAM
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
static void mcLower(Module &M, MachineModuleInfo &MMI, llvm::function_ref< MachineFunction *(Function *)> GetMF)
This file contains the declaration of the WebAssembly-specific utility functions.
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end.
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
MachineFunction & getMF()
This analysis create MachineFunction for given Function.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
An analysis that produces MachineModuleInfo for a module.
MachineModuleInfoWasm - This is a MachineModuleInfoImpl implementation for Wasm targets.
SetVector< StringRef > MachineSymbolsUsed
This class contains meta information specific to a module.
Ty & getObjFileInfo()
Keep track of various per-module pieces of information for backends that would like to do so.
MachineOperand class - Representation of each machine instruction operand.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
A Module instance is used to store all the information related to an LLVM module.
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
bool insert(const value_type &X)
Insert a new element into the SetVector.
Represent a constant reference to a string, i.e.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM)
An efficient, type-erasing, non-owning reference to a callable.
Pass manager infrastructure for declaring and invalidating analyses.
This is an optimization pass for GlobalISel generic memory operations.
ModulePass * createWebAssemblyMCLowerPreLegacyPass()
InnerAnalysisManagerProxy< FunctionAnalysisManager, Module > FunctionAnalysisManagerModuleProxy
Provide the FunctionAnalysisManager to Module proxy.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.