#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
#include "WebAssembly.h"
#include "WebAssemblyDebugValueManager.h"
#include "WebAssemblyMachineFunctionInfo.h"
#include "WebAssemblySubtarget.h"
#include "WebAssemblyUtilities.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.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"
usingnamespacellvm;
#define DEBUG_TYPE …
namespace {
class WebAssemblyExplicitLocals final : public MachineFunctionPass { … };
}
char WebAssemblyExplicitLocals::ID = …;
INITIALIZE_PASS(…)
FunctionPass *llvm::createWebAssemblyExplicitLocals() { … }
static void checkFrameBase(WebAssemblyFunctionInfo &MFI, unsigned Local,
unsigned Reg) { … }
static unsigned getLocalId(DenseMap<unsigned, unsigned> &Reg2Local,
WebAssemblyFunctionInfo &MFI, unsigned &CurLocal,
unsigned Reg) { … }
static unsigned getDropOpcode(const TargetRegisterClass *RC) { … }
static unsigned getLocalGetOpcode(const TargetRegisterClass *RC) { … }
static unsigned getLocalSetOpcode(const TargetRegisterClass *RC) { … }
static unsigned getLocalTeeOpcode(const TargetRegisterClass *RC) { … }
static MVT typeForRegClass(const TargetRegisterClass *RC) { … }
static MachineInstr *findStartOfTree(MachineOperand &MO,
MachineRegisterInfo &MRI,
const WebAssemblyFunctionInfo &MFI) { … }
bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) { … }