LLVM  8.0.1
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.

Macros

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

Functions

 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

◆ DEBUG_TYPE

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

Definition at line 40 of file WebAssemblyCallIndirectFixup.cpp.

Function Documentation

◆ GetNonPseudoCallIndirectOpcode()

static unsigned GetNonPseudoCallIndirectOpcode ( const MachineInstr MI)
static

Definition at line 64 of file WebAssemblyCallIndirectFixup.cpp.

References llvm::MachineInstr::getOpcode().

Referenced by IsPseudoCallIndirect().

◆ INITIALIZE_PASS()

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

Definition at line 57 of file WebAssemblyCallIndirectFixup.cpp.

◆ IsPseudoCallIndirect()

static bool IsPseudoCallIndirect ( const MachineInstr MI)
static