27#define DEBUG_TYPE "wasm-mclower-prepass"
30class WebAssemblyMCLowerPrePass final :
public ModulePass {
32 return "WebAssembly MC Lower Pre Pass";
40 bool runOnModule(
Module &M)
override;
48char WebAssemblyMCLowerPrePass::ID = 0;
51 "Collects information ahead of time for MC lowering",
55 return new WebAssemblyMCLowerPrePass();
65bool WebAssemblyMCLowerPrePass::runOnModule(
Module &M) {
66 auto *MMIWP = getAnalysisIfAvailable<MachineModuleInfoWrapperPass>();
70 MachineModuleInfo &MMI = MMIWP->getMMI();
71 MachineModuleInfoWasm &MMIW = MMI.
getObjFileInfo<MachineModuleInfoWasm>();
73 for (Function &
F : M) {
79 "********** Function: "
82 for (MachineBasicBlock &
MBB : *MF) {
83 for (
auto &
MI :
MBB) {
85 if (
MI.isDebugInstr() ||
MI.isInlineAsm())
87 for (MachineOperand &MO :
MI.uses()) {
Module.h This file contains the declarations for the Module class.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
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.
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
SetVector< StringRef > MachineSymbolsUsed
Ty & getObjFileInfo()
Keep track of various per-module pieces of information for backends that would like to do so.
LLVM_ABI MachineFunction * getMachineFunction(const Function &F) const
Returns the MachineFunction associated to IR function F if there is one, otherwise nullptr.
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...
StringRef - Represent a constant reference to a string, i.e.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
ModulePass * createWebAssemblyMCLowerPrePass()