LLVM  10.0.0svn
Macros | Functions
WebAssemblyCallIndirectFixup.cpp File Reference

This file converts pseudo call_indirect instructions into real call_indirects. More...

#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
#include "WebAssembly.h"
#include "WebAssemblyMachineFunctionInfo.h"
#include "WebAssemblySubtarget.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
Include dependency graph for WebAssemblyCallIndirectFixup.cpp:

Go to the source code of this file.


#define DEBUG_TYPE   "wasm-call-indirect-fixup"


 INITIALIZE_PASS (WebAssemblyCallIndirectFixup, DEBUG_TYPE, "Rewrite call_indirect argument orderings", false, false) FunctionPass *llvm
static unsigned getNonPseudoCallIndirectOpcode (const MachineInstr &MI)
static bool isPseudoCallIndirect (const MachineInstr &MI)

Detailed Description

This file converts pseudo call_indirect instructions into real call_indirects.

The order of arguments for a call_indirect is the arguments to the function call, followed by the function pointer. There's no natural way to express a machineinstr with varargs followed by one more arg, so we express it as the function pointer followed by varargs, then rewrite it here.

We need to rewrite the order of the arguments on the machineinstrs themselves so that register stackification knows the order they'll be executed in.

Definition in file WebAssemblyCallIndirectFixup.cpp.

Macro Definition Documentation


#define DEBUG_TYPE   "wasm-call-indirect-fixup"

Definition at line 39 of file WebAssemblyCallIndirectFixup.cpp.

Function Documentation

◆ getNonPseudoCallIndirectOpcode()

static unsigned getNonPseudoCallIndirectOpcode ( const MachineInstr MI)

Definition at line 63 of file WebAssemblyCallIndirectFixup.cpp.

References llvm::MachineInstr::getOpcode().

Referenced by isPseudoCallIndirect().


INITIALIZE_PASS ( WebAssemblyCallIndirectFixup  ,
"Rewrite call_indirect argument orderings"  ,
false  ,

Definition at line 56 of file WebAssemblyCallIndirectFixup.cpp.

◆ isPseudoCallIndirect()

static bool isPseudoCallIndirect ( const MachineInstr MI)