LLVM  4.0.0
Macros | Functions
WebAssemblyExplicitLocals.cpp File Reference

This file converts any remaining registers into WebAssembly locals. More...

#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
#include "WebAssembly.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"
Include dependency graph for WebAssemblyExplicitLocals.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "wasm-explicit-locals"
 

Functions

static unsigned getLocalId (DenseMap< unsigned, unsigned > &Reg2Local, unsigned &CurLocal, unsigned Reg)
 Return a local id number for the given register, assigning it a new one if it doesn't yet have one. More...
 
static unsigned getGetLocalOpcode (const TargetRegisterClass *RC)
 Get the appropriate get_local opcode for the given register class. More...
 
static unsigned getSetLocalOpcode (const TargetRegisterClass *RC)
 Get the appropriate set_local opcode for the given register class. More...
 
static unsigned getTeeLocalOpcode (const TargetRegisterClass *RC)
 Get the appropriate tee_local opcode for the given register class. More...
 
static MVT typeForRegClass (const TargetRegisterClass *RC)
 Get the type associated with the given register class. More...
 
static MachineInstrFindStartOfTree (MachineOperand &MO, MachineRegisterInfo &MRI, WebAssemblyFunctionInfo &MFI)
 Given a MachineOperand of a stackified vreg, return the instruction at the start of the expression tree. More...
 

Detailed Description

This file converts any remaining registers into WebAssembly locals.

After register stackification and register coloring, convert non-stackified registers into locals, inserting explicit get_local and set_local instructions.

Definition in file WebAssemblyExplicitLocals.cpp.

Macro Definition Documentation

#define DEBUG_TYPE   "wasm-explicit-locals"

Definition at line 32 of file WebAssemblyExplicitLocals.cpp.

Function Documentation

static MachineInstr* FindStartOfTree ( MachineOperand MO,
MachineRegisterInfo MRI,
WebAssemblyFunctionInfo MFI 
)
static

Given a MachineOperand of a stackified vreg, return the instruction at the start of the expression tree.

Definition at line 126 of file WebAssemblyExplicitLocals.cpp.

References assert(), llvm::tgtok::Def, llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getVRegDef(), and llvm::WebAssemblyFunctionInfo::isVRegStackified().

static unsigned getGetLocalOpcode ( const TargetRegisterClass RC)
static

Get the appropriate get_local opcode for the given register class.

Definition at line 67 of file WebAssemblyExplicitLocals.cpp.

References llvm_unreachable.

static unsigned getLocalId ( DenseMap< unsigned, unsigned > &  Reg2Local,
unsigned CurLocal,
unsigned  Reg 
)
static

Return a local id number for the given register, assigning it a new one if it doesn't yet have one.

Definition at line 61 of file WebAssemblyExplicitLocals.cpp.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert().

static unsigned getSetLocalOpcode ( const TargetRegisterClass RC)
static

Get the appropriate set_local opcode for the given register class.

Definition at line 82 of file WebAssemblyExplicitLocals.cpp.

References llvm_unreachable.

static unsigned getTeeLocalOpcode ( const TargetRegisterClass RC)
static

Get the appropriate tee_local opcode for the given register class.

Definition at line 97 of file WebAssemblyExplicitLocals.cpp.

References llvm_unreachable.

static MVT typeForRegClass ( const TargetRegisterClass RC)
static

Get the type associated with the given register class.

Definition at line 112 of file WebAssemblyExplicitLocals.cpp.

References llvm::MVT::f32, llvm::MVT::f64, llvm::MVT::i32, llvm::MVT::i64, and llvm_unreachable.