LLVM
8.0.1
|
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"
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) |
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.
#define DEBUG_TYPE "wasm-call-indirect-fixup" |
Definition at line 40 of file WebAssemblyCallIndirectFixup.cpp.
|
static |
Definition at line 64 of file WebAssemblyCallIndirectFixup.cpp.
References llvm::MachineInstr::getOpcode().
Referenced by IsPseudoCallIndirect().
INITIALIZE_PASS | ( | WebAssemblyCallIndirectFixup | , |
DEBUG_TYPE | , | ||
"Rewrite call_indirect argument orderings" | , | ||
false | , | ||
false | |||
) |
Definition at line 57 of file WebAssemblyCallIndirectFixup.cpp.
|
static |
Definition at line 94 of file WebAssemblyCallIndirectFixup.cpp.
References llvm::MachineOperand::CreateImm(), llvm::dbgs(), llvm::MachineFunction::getName(), GetNonPseudoCallIndirectOpcode(), llvm::MachineFunction::getSubtarget(), LLVM_DEBUG, llvm::make_range(), MI, llvm::SmallVectorTemplateBase< T >::push_back(), and TII.