LLVM  8.0.0svn
Enumerations | Functions | Variables
llvm::WebAssembly Namespace Reference

Enumerations

enum  Fixups {
  fixup_code_sleb128_i32 = FirstTargetFixupKind, fixup_code_sleb128_i64, fixup_code_uleb128_i32, LastTargetFixupKind,
  NumTargetFixupKinds = LastTargetFixupKind - FirstTargetFixupKind
}
 
enum  OperandType {
  OPERAND_BASIC_BLOCK = MCOI::OPERAND_FIRST_TARGET, OPERAND_LOCAL, OPERAND_GLOBAL, OPERAND_I32IMM,
  OPERAND_I64IMM, OPERAND_F32IMM, OPERAND_F64IMM, OPERAND_VEC_I8IMM,
  OPERAND_VEC_I16IMM, OPERAND_VEC_I32IMM, OPERAND_VEC_I64IMM, OPERAND_FUNCTION32,
  OPERAND_OFFSET32, OPERAND_P2ALIGN, OPERAND_SIGNATURE, OPERAND_TYPEINDEX,
  OPERAND_EVENT
}
 
enum  ExprType : unsigned {
  ExprType::Void = 0x40, ExprType::I32 = 0x7F, ExprType::I64 = 0x7E, ExprType::F32 = 0x7D,
  ExprType::F64 = 0x7C, ExprType::V128 = 0x7B, ExprType::ExceptRef = 0x68
}
 This is used to indicate block signatures. More...
 

Functions

const charTypeToString (wasm::ValType Ty)
 
unsigned GetDefaultP2Align (unsigned Opcode)
 Return the default p2align value for a load or store with the given opcode. More...
 
wasm::ValType toValType (const MVT &Ty)
 
FastISelcreateFastISel (FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo)
 
bool isArgument (const MachineInstr &MI)
 
bool isCopy (const MachineInstr &MI)
 
bool isTee (const MachineInstr &MI)
 
bool isChild (const MachineInstr &MI, const WebAssemblyFunctionInfo &MFI)
 Test whether MI is a child of some other node in an expression tree. More...
 
bool isCallDirect (const MachineInstr &MI)
 
bool isCallIndirect (const MachineInstr &MI)
 
bool isMarker (const MachineInstr &MI)
 
bool isThrow (const MachineInstr &MI)
 
bool isRethrow (const MachineInstr &MI)
 
bool isCatch (const MachineInstr &MI)
 
bool mayThrow (const MachineInstr &MI)
 
unsigned getCalleeOpNo (const MachineInstr &MI)
 Returns the operand number of a callee, assuming the argument is a call instruction. More...
 
bool isCatchTerminatePad (const MachineBasicBlock &MBB)
 Returns if the given BB is a single BB terminate pad which starts with a 'catch' instruction. More...
 
bool isCatchAllTerminatePad (const MachineBasicBlock &MBB)
 Returns if the given BB is a single BB terminate pad which starts with a 'catch_all' insrtruction. More...
 
template<typename T >
MachineBasicBlockgetBottom (const T *Unit)
 Return the "bottom" block of an entity, which can be either a MachineLoop or WebAssemblyException. More...
 

Variables

static const unsigned LoadAddressOperandNo = 3
 The operand number of the load or store address in load/store instructions. More...
 
static const unsigned StoreAddressOperandNo = 2
 
static const unsigned LoadP2AlignOperandNo = 1
 The operand number of the load or store p2align in load/store instructions. More...
 
static const unsigned StoreP2AlignOperandNo = 0
 
static const unsigned Nop = 0x01
 Instruction opcodes emitted via means other than CodeGen. More...
 
static const unsigned End = 0x0b
 
const char *const ClangCallTerminateFn = "__clang_call_terminate"
 
const char *const CxaBeginCatchFn = "__cxa_begin_catch"
 
const char *const CxaRethrowFn = "__cxa_rethrow"
 
const char *const StdTerminateFn = "_ZSt9terminatev"
 
const char *const PersonalityWrapperFn
 

Enumeration Type Documentation

◆ ExprType

This is used to indicate block signatures.

Enumerator
Void 
I32 
I64 
F32 
F64 
V128 
ExceptRef 

Definition at line 350 of file WebAssemblyMCTargetDesc.h.

◆ Fixups

Enumerator
fixup_code_sleb128_i32 
fixup_code_sleb128_i64 
fixup_code_uleb128_i32 
LastTargetFixupKind 
NumTargetFixupKinds 

Definition at line 17 of file WebAssemblyFixupKinds.h.

◆ OperandType

Enumerator
OPERAND_BASIC_BLOCK 

Basic block label in a branch construct.

OPERAND_LOCAL 

Local index.

OPERAND_GLOBAL 

Global index.

OPERAND_I32IMM 

32-bit integer immediates.

OPERAND_I64IMM 

64-bit integer immediates.

OPERAND_F32IMM 

32-bit floating-point immediates.

OPERAND_F64IMM 

64-bit floating-point immediates.

OPERAND_VEC_I8IMM 

8-bit vector lane immediate

OPERAND_VEC_I16IMM 

16-bit vector lane immediate

OPERAND_VEC_I32IMM 

32-bit vector lane immediate

OPERAND_VEC_I64IMM 

64-bit vector lane immediate

OPERAND_FUNCTION32 

32-bit unsigned function indices.

OPERAND_OFFSET32 

32-bit unsigned memory offsets.

OPERAND_P2ALIGN 

p2align immediate for load and store address alignment.

OPERAND_SIGNATURE 

signature immediate for block/loop.

OPERAND_TYPEINDEX 

type signature immediate for call_indirect.

OPERAND_EVENT 

Event index.

Definition at line 47 of file WebAssemblyMCTargetDesc.h.

Function Documentation

◆ createFastISel()

FastISel * llvm::WebAssembly::createFastISel ( FunctionLoweringInfo funcInfo,
const TargetLibraryInfo libInfo 
)

◆ getBottom()

template<typename T >
MachineBasicBlock* llvm::WebAssembly::getBottom ( const T Unit)

Return the "bottom" block of an entity, which can be either a MachineLoop or WebAssemblyException.

This differs from MachineLoop::getBottomBlock in that it works even if the entity is discontiguous.

Definition at line 60 of file WebAssemblyUtilities.h.

References llvm::MachineBasicBlock::getNumber().

Referenced by SortBlocks().

◆ getCalleeOpNo()

unsigned llvm::WebAssembly::getCalleeOpNo ( const MachineInstr MI)

Returns the operand number of a callee, assuming the argument is a call instruction.

Definition at line 169 of file WebAssemblyUtilities.cpp.

References llvm::MachineInstr::getOpcode(), and llvm_unreachable.

Referenced by isCatchAllTerminatePad(), isCatchTerminatePad(), mayThrow(), and Query().

◆ GetDefaultP2Align()

unsigned llvm::WebAssembly::GetDefaultP2Align ( unsigned  Opcode)
inline

Return the default p2align value for a load or store with the given opcode.

Definition at line 127 of file WebAssemblyMCTargetDesc.h.

References llvm_unreachable.

Referenced by llvm::WebAssemblyInstPrinter::printWebAssemblyP2AlignOperand(), and RewriteP2Align().

◆ isArgument()

bool llvm::WebAssembly::isArgument ( const MachineInstr MI)

◆ isCallDirect()

bool llvm::WebAssembly::isCallDirect ( const MachineInstr MI)

Definition at line 105 of file WebAssemblyUtilities.cpp.

References llvm::MachineInstr::getOpcode().

◆ isCallIndirect()

bool llvm::WebAssembly::isCallIndirect ( const MachineInstr MI)

◆ isCatch()

bool llvm::WebAssembly::isCatch ( const MachineInstr MI)

◆ isCatchAllTerminatePad()

bool llvm::WebAssembly::isCatchAllTerminatePad ( const MachineBasicBlock MBB)

Returns if the given BB is a single BB terminate pad which starts with a 'catch_all' insrtruction.

Definition at line 333 of file WebAssemblyUtilities.cpp.

References getCalleeOpNo(), llvm::MachineOperand::getGlobal(), llvm::Value::getName(), llvm::MachineBasicBlock::isEHPad(), llvm::MachineOperand::isGlobal(), MI, and StdTerminateFn.

Referenced by AppendEndToFunction(), and llvm::WebAssemblyExceptionInfo::recalculate().

◆ isCatchTerminatePad()

bool llvm::WebAssembly::isCatchTerminatePad ( const MachineBasicBlock MBB)

Returns if the given BB is a single BB terminate pad which starts with a 'catch' instruction.

Definition at line 313 of file WebAssemblyUtilities.cpp.

References ClangCallTerminateFn, getCalleeOpNo(), llvm::MachineOperand::getGlobal(), llvm::Value::getName(), llvm::MachineBasicBlock::isEHPad(), llvm::MachineOperand::isGlobal(), and MI.

Referenced by eraseDeadBBsAndChildren(), and llvm::WebAssemblyExceptionInfo::getAnalysisUsage().

◆ isChild()

bool llvm::WebAssembly::isChild ( const MachineInstr MI,
const WebAssemblyFunctionInfo MFI 
)

◆ isCopy()

bool llvm::WebAssembly::isCopy ( const MachineInstr MI)

Definition at line 56 of file WebAssemblyUtilities.cpp.

References llvm::MachineInstr::getOpcode().

Referenced by findStartOfTree().

◆ isMarker()

bool llvm::WebAssembly::isMarker ( const MachineInstr MI)

◆ isRethrow()

bool llvm::WebAssembly::isRethrow ( const MachineInstr MI)

Definition at line 258 of file WebAssemblyUtilities.cpp.

References llvm::MachineInstr::getOpcode().

Referenced by ExplicitlyBranchesTo().

◆ isTee()

bool llvm::WebAssembly::isTee ( const MachineInstr MI)

Definition at line 74 of file WebAssemblyUtilities.cpp.

References llvm::MachineInstr::getOpcode().

Referenced by findStartOfTree().

◆ isThrow()

bool llvm::WebAssembly::isThrow ( const MachineInstr MI)

Definition at line 246 of file WebAssemblyUtilities.cpp.

References llvm::MachineInstr::getOpcode().

Referenced by eraseDeadBBsAndChildren().

◆ mayThrow()

bool llvm::WebAssembly::mayThrow ( const MachineInstr MI)

◆ toValType()

wasm::ValType llvm::WebAssembly::toValType ( const MVT Ty)

◆ TypeToString()

const char * llvm::WebAssembly::TypeToString ( wasm::ValType  Ty)

Variable Documentation

◆ ClangCallTerminateFn

const char *const llvm::WebAssembly::ClangCallTerminateFn = "__clang_call_terminate"

Definition at line 21 of file WebAssemblyUtilities.cpp.

Referenced by eraseDeadBBsAndChildren(), isCatchTerminatePad(), and mayThrow().

◆ CxaBeginCatchFn

const char *const llvm::WebAssembly::CxaBeginCatchFn = "__cxa_begin_catch"

Definition at line 22 of file WebAssemblyUtilities.cpp.

Referenced by mayThrow().

◆ CxaRethrowFn

const char *const llvm::WebAssembly::CxaRethrowFn = "__cxa_rethrow"

Definition at line 23 of file WebAssemblyUtilities.cpp.

Referenced by eraseDeadBBsAndChildren().

◆ End

const unsigned llvm::WebAssembly::End = 0x0b
static

Definition at line 362 of file WebAssemblyMCTargetDesc.h.

◆ LoadAddressOperandNo

const unsigned llvm::WebAssembly::LoadAddressOperandNo = 3
static

The operand number of the load or store address in load/store instructions.

Definition at line 342 of file WebAssemblyMCTargetDesc.h.

Referenced by llvm::WebAssemblyRegisterInfo::eliminateFrameIndex().

◆ LoadP2AlignOperandNo

const unsigned llvm::WebAssembly::LoadP2AlignOperandNo = 1
static

The operand number of the load or store p2align in load/store instructions.

Definition at line 346 of file WebAssemblyMCTargetDesc.h.

Referenced by RewriteP2Align().

◆ Nop

const unsigned llvm::WebAssembly::Nop = 0x01
static

Instruction opcodes emitted via means other than CodeGen.

Definition at line 361 of file WebAssemblyMCTargetDesc.h.

Referenced by llvm::HexagonMCInstrInfo::padEndloop().

◆ PersonalityWrapperFn

const char *const llvm::WebAssembly::PersonalityWrapperFn
Initial value:
=
"_Unwind_Wasm_CallPersonality"

Definition at line 25 of file WebAssemblyUtilities.cpp.

Referenced by mayThrow().

◆ StdTerminateFn

const char *const llvm::WebAssembly::StdTerminateFn = "_ZSt9terminatev"

◆ StoreAddressOperandNo

const unsigned llvm::WebAssembly::StoreAddressOperandNo = 2
static

◆ StoreP2AlignOperandNo

const unsigned llvm::WebAssembly::StoreP2AlignOperandNo = 0
static

Definition at line 347 of file WebAssemblyMCTargetDesc.h.

Referenced by RewriteP2Align().