LLVM  8.0.0svn
Macros | Functions | Variables
WebAssemblyISelLowering.cpp File Reference

This file implements the WebAssemblyTargetLowering class. More...

#include "WebAssemblyISelLowering.h"
#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
#include "WebAssemblyMachineFunctionInfo.h"
#include "WebAssemblySubtarget.h"
#include "WebAssemblyTargetMachine.h"
#include "llvm/CodeGen/Analysis.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/DiagnosticPrinter.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetOptions.h"
#include "WebAssemblyISD.def"
Include dependency graph for WebAssemblyISelLowering.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "wasm-lower"
 
#define HANDLE_NODETYPE(NODE)
 

Functions

static MachineBasicBlockLowerFPToInt (MachineInstr &MI, DebugLoc DL, MachineBasicBlock *BB, const TargetInstrInfo &TII, bool IsUnsigned, bool Int64, bool Float64, unsigned LoweredOpcode)
 
static void fail (const SDLoc &DL, SelectionDAG &DAG, const char *msg)
 
static bool CallingConvSupported (CallingConv::ID CallConv)
 

Variables

cl::opt< boolEnableUnimplementedWasmSIMDInstrs ("wasm-enable-unimplemented-simd", cl::desc("Emit potentially-unimplemented WebAssembly SIMD instructions"), cl::init(false))
 

Detailed Description

This file implements the WebAssemblyTargetLowering class.

Definition in file WebAssemblyISelLowering.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "wasm-lower"

Definition at line 36 of file WebAssemblyISelLowering.cpp.

◆ HANDLE_NODETYPE

#define HANDLE_NODETYPE (   NODE)
Value:
return "WebAssemblyISD::" #NODE;
#define NODE(name)

Function Documentation

◆ CallingConvSupported()

static bool CallingConvSupported ( CallingConv::ID  CallConv)
static

Definition at line 523 of file WebAssemblyISelLowering.cpp.

References llvm::MCID::Add, llvm::ISD::ADD, llvm::MachineRegisterInfo::addLiveIn(), llvm::SmallVectorImpl< T >::append(), Arg, assert(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::ISD::BlockAddress, llvm::ISD::BR_JT, llvm::ISD::BRIND, llvm::CallingConv::C, Callee, llvm::CallingConv::Cold, llvm::ComputeSignatureVTs(), llvm::ISD::CopyToReg, llvm::MachineFrameInfo::CreateStackObject(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::CallingConv::CXX_FAST_TLS, llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::ISD::ExternalSymbol, fail(), llvm::CallingConv::Fast, llvm::ISD::OutputArg::Flags, llvm::ISD::FRAMEADDR, llvm::ISD::FrameIndex, llvm::CCValAssign::Full, llvm::SelectionDAG::getBasicBlock(), llvm::ISD::ArgFlagsTy::getByValAlign(), llvm::ISD::ArgFlagsTy::getByValSize(), llvm::SelectionDAG::getConstant(), llvm::SDValue::getConstantOperandVal(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getCopyFromReg(), llvm::SelectionDAG::getCopyToReg(), llvm::MachineFunction::getDataLayout(), llvm::SelectionDAG::getEntryNode(), llvm::MachinePointerInfo::getFixedStack(), llvm::SelectionDAG::getFrameIndex(), llvm::MachineFunction::getFrameInfo(), llvm::WebAssemblyRegisterInfo::getFrameRegister(), llvm::MachineFunction::getFunction(), llvm::JumpTableSDNode::getIndex(), llvm::MachineFunction::getInfo(), llvm::SelectionDAG::getIntPtrConstant(), llvm::MachineFunction::getJumpTableInfo(), llvm::MachineJumpTableInfo::getJumpTables(), llvm::SelectionDAG::getMachineFunction(), llvm::SelectionDAG::getMachineNode(), llvm::CCValAssign::getMem(), llvm::SelectionDAG::getMemcpy(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDValue::getNumOperands(), llvm::SDNode::getNumValues(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::TargetLoweringBase::getPointerTy(), getReg(), llvm::TargetLoweringBase::getRegClassFor(), llvm::MachineFunction::getRegInfo(), llvm::WebAssemblySubtarget::getRegisterInfo(), llvm::EVT::getSimpleVT(), llvm::SelectionDAG::getStore(), llvm::SelectionDAG::getTarget(), llvm::MachineFunction::getTarget(), llvm::SelectionDAG::getTargetConstant(), llvm::SelectionDAG::getTargetExternalSymbol(), llvm::JumpTableSDNode::getTargetFlags(), llvm::SelectionDAG::getTargetFrameIndex(), llvm::SelectionDAG::getTargetGlobalAddress(), llvm::SelectionDAG::getTargetJumpTable(), llvm::EVT::getTypeForEVT(), llvm::SelectionDAG::getUNDEF(), llvm::SDValue::getValue(), llvm::SDValue::getValueType(), llvm::SelectionDAG::getVTList(), llvm::ISD::GlobalAddress, llvm::TargetOptions::GuaranteedTailCallOpt, llvm::MVT::i32, llvm::tgtok::In, llvm::MipsISD::Ins, llvm::ISD::INTRINSIC_WO_CHAIN, llvm::MVT::iPTR, llvm::ISD::ArgFlagsTy::isByVal(), llvm::ISD::OutputArg::IsFixed, llvm::ISD::ArgFlagsTy::isInAlloca(), llvm::ISD::ArgFlagsTy::isInConsecutiveRegs(), llvm::ISD::ArgFlagsTy::isInConsecutiveRegsLast(), llvm::ISD::ArgFlagsTy::isNest(), llvm::HexagonISD::JT, llvm::ISD::JumpTable, llvm_unreachable, llvm::make_range(), llvm::WebAssemblyII::MO_SYMBOL_FUNCTION, NumFixedArgs, llvm::TargetMachine::Options, llvm::MVT::Other, llvm::CallingConv::PreserveAll, llvm::CallingConv::PreserveMost, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), Reg, Results, llvm::NVPTXISD::RETURN, llvm::ISD::RETURNADDR, llvm::MachineFrameInfo::setFrameAddressIsTaken(), llvm::SmallVectorBase::size(), llvm::ISD::TokenFactor, llvm::ISD::VASTART, and llvm::ARMISD::Wrapper.

◆ fail()

static void fail ( const SDLoc DL,
SelectionDAG DAG,
const char msg 
)
static

◆ LowerFPToInt()

static MachineBasicBlock* LowerFPToInt ( MachineInstr MI,
DebugLoc  DL,
MachineBasicBlock BB,
const TargetInstrInfo TII,
bool  IsUnsigned,
bool  Int64,
bool  Float64,
unsigned  LoweredOpcode 
)
static

Definition at line 221 of file WebAssemblyISelLowering.cpp.

References llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::addSuccessor(), AS, assert(), llvm::MachineBasicBlock::begin(), llvm::ISD::BR, llvm::BuildMI(), C, llvm::EVT::changeVectorElementTypeToInteger(), Context, llvm::MachineFunction::CreateMachineBasicBlock(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::eraseFromParent(), F(), llvm::CallingConv::Fast, llvm::WebAssemblyISD::FIRST_NUMBER, llvm::AArch64CC::GE, llvm::MCInstrInfo::get(), llvm::ConstantFP::get(), llvm::CallBase< InstTy >::getArgOperand(), llvm::MachineBasicBlock::getBasicBlock(), llvm::Function::getContext(), llvm::MachineInstr::getDebugLoc(), llvm::Type::getDoubleTy(), llvm::Type::getFloatTy(), llvm::MachineFunction::getFunction(), llvm::WebAssemblySubtarget::getInstrInfo(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::TargetLowering::getRegForInlineAsmConstraint(), llvm::MachineFunction::getRegInfo(), llvm::TargetLoweringBase::getSetCCResultType(), llvm::MVT::getSizeInBits(), llvm::WebAssemblySubtarget::hasSIMD128(), I, llvm::MVT::i32, llvm::MVT::i64, llvm::MachineFunction::insert(), INT64_MIN, llvm::ISD::INTRINSIC_W_CHAIN, llvm::MVT::iPTR, llvm::MVT::isInteger(), llvm::EVT::isVector(), llvm::MVT::isVector(), llvm_unreachable, llvm::AArch64CC::LT, MI, llvm::MachineMemOperand::MOLoad, llvm::MachineMemOperand::MOVolatile, MRI, llvm::StringRef::size(), llvm::MachineBasicBlock::splice(), TII, llvm::MachineBasicBlock::transferSuccessorsAndUpdatePHIs(), and TRI.

Variable Documentation

◆ EnableUnimplementedWasmSIMDInstrs

cl::opt<bool> EnableUnimplementedWasmSIMDInstrs("wasm-enable-unimplemented-simd", cl::desc("Emit potentially-unimplemented WebAssembly SIMD instructions"), cl::init(false))