36 #define DEBUG_TYPE "wasm-lower" 52 Subtarget->
hasAddr64() ? WebAssembly::SP64 : WebAssembly::SP32);
160 FastISel *WebAssemblyTargetLowering::createFastISel(
165 bool WebAssemblyTargetLowering::isOffsetFoldingLegal(
171 MVT WebAssemblyTargetLowering::getScalarShiftAmountTy(
const DataLayout & ,
174 if (BitWidth > 1 && BitWidth < 8) BitWidth = 8;
181 "32-bit shift counts ought to be enough for anyone");
186 "Unable to represent scalar shift amount type");
202 unsigned LoweredOpcode
209 unsigned Abs = Float64 ? WebAssembly::ABS_F64 : WebAssembly::ABS_F32;
210 unsigned FConst = Float64 ? WebAssembly::CONST_F64 : WebAssembly::CONST_F32;
211 unsigned LT = Float64 ? WebAssembly::LT_F64 : WebAssembly::LT_F32;
212 unsigned GE = Float64 ? WebAssembly::GE_F64 : WebAssembly::GE_F32;
213 unsigned IConst = Int64 ? WebAssembly::CONST_I64 : WebAssembly::CONST_I32;
214 unsigned Eqz = WebAssembly::EQZ_I32;
215 unsigned And = WebAssembly::AND_I32;
216 int64_t Limit = Int64 ?
INT64_MIN : INT32_MIN;
217 int64_t Substitute = IsUnsigned ? 0 : Limit;
218 double CmpVal = IsUnsigned ? -(double)Limit * 2.0 : -(
double)Limit;
244 unsigned Tmp0, Tmp1, CmpReg, EqzReg, FalseReg, TrueReg;
291 BuildMI(FalseMBB, DL, TII.
get(LoweredOpcode), FalseReg)
295 BuildMI(TrueMBB, DL, TII.
get(IConst), TrueReg)
297 BuildMI(*DoneMBB, DoneMBB->
begin(), DL, TII.
get(TargetOpcode::PHI), OutReg)
307 WebAssemblyTargetLowering::EmitInstrWithCustomInserter(
316 case WebAssembly::FP_TO_SINT_I32_F32:
317 return LowerFPToInt(MI, DL, BB, TII,
false,
false,
false,
318 WebAssembly::I32_TRUNC_S_F32);
319 case WebAssembly::FP_TO_UINT_I32_F32:
320 return LowerFPToInt(MI, DL, BB, TII,
true,
false,
false,
321 WebAssembly::I32_TRUNC_U_F32);
322 case WebAssembly::FP_TO_SINT_I64_F32:
323 return LowerFPToInt(MI, DL, BB, TII,
false,
true,
false,
324 WebAssembly::I64_TRUNC_S_F32);
325 case WebAssembly::FP_TO_UINT_I64_F32:
327 WebAssembly::I64_TRUNC_U_F32);
328 case WebAssembly::FP_TO_SINT_I32_F64:
329 return LowerFPToInt(MI, DL, BB, TII,
false,
false,
true,
330 WebAssembly::I32_TRUNC_S_F64);
331 case WebAssembly::FP_TO_UINT_I32_F64:
333 WebAssembly::I32_TRUNC_U_F64);
334 case WebAssembly::FP_TO_SINT_I64_F64:
336 WebAssembly::I64_TRUNC_S_F64);
337 case WebAssembly::FP_TO_UINT_I64_F64:
339 WebAssembly::I64_TRUNC_U_F64);
344 const char *WebAssemblyTargetLowering::getTargetNodeName(
345 unsigned Opcode)
const {
346 switch (static_cast<WebAssemblyISD::NodeType>(Opcode)) {
349 #define HANDLE_NODETYPE(NODE) \ 350 case WebAssemblyISD::NODE: \ 351 return "WebAssemblyISD::" #NODE; 352 #include "WebAssemblyISD.def" 353 #undef HANDLE_NODETYPE 358 std::pair<unsigned, const TargetRegisterClass *>
359 WebAssemblyTargetLowering::getRegForInlineAsmConstraint(
363 if (Constraint.
size() == 1) {
364 switch (Constraint[0]) {
369 return std::make_pair(0U, &WebAssembly::V128RegClass);
373 return std::make_pair(0U, &WebAssembly::I32RegClass);
375 return std::make_pair(0U, &WebAssembly::I64RegClass);
386 bool WebAssemblyTargetLowering::isCheapToSpeculateCttz()
const {
391 bool WebAssemblyTargetLowering::isCheapToSpeculateCtlz()
const {
396 bool WebAssemblyTargetLowering::isLegalAddressingMode(
const DataLayout &DL,
404 if (AM.BaseOffs < 0)
return false;
407 if (AM.Scale != 0)
return false;
413 bool WebAssemblyTargetLowering::allowsMisalignedMemoryAccesses(
414 EVT ,
unsigned ,
unsigned ,
bool *
Fast)
const {
421 if (Fast) *Fast =
true;
425 bool WebAssemblyTargetLowering::isIntDivCheap(
EVT VT,
432 EVT WebAssemblyTargetLowering::getSetCCResultType(
const DataLayout &DL,
468 SDValue WebAssemblyTargetLowering::LowerCall(
480 "WebAssembly doesn't support language-specific or target-specific " 481 "calling conventions yet");
482 if (CLI.IsPatchPoint)
483 fail(DL, DAG,
"WebAssembly doesn't support patch point yet");
489 (CLI.CS && CLI.CS.isMustTailCall()))
490 fail(DL, DAG,
"WebAssembly doesn't support tail call yet");
491 CLI.IsTailCall =
false;
495 fail(DL, DAG,
"WebAssembly doesn't support more than 1 returned value yet");
500 for (
unsigned i = 0; i < Outs.
size(); ++i) {
504 fail(DL, DAG,
"WebAssembly hasn't implemented nest arguments");
506 fail(DL, DAG,
"WebAssembly hasn't implemented inalloca arguments");
508 fail(DL, DAG,
"WebAssembly hasn't implemented cons regs arguments");
510 fail(DL, DAG,
"WebAssembly hasn't implemented cons regs last arguments");
529 bool IsVarArg = CLI.IsVarArg;
541 EVT VT =
Arg.getValueType();
544 unsigned Offset = CCInfo.AllocateStack(Layout.getTypeAllocSize(Ty),
545 Layout.getABITypeAlignment(Ty));
552 unsigned NumBytes = CCInfo.getAlignedCallFrameSize();
555 if (IsVarArg && NumBytes) {
559 Layout.getStackAlignment(),
565 assert(ArgLocs[ValNo].getValNo() == ValNo &&
566 "ArgLocs should remain in order and only hold varargs args");
567 unsigned Offset = ArgLocs[ValNo++].getLocMemOffset();
577 }
else if (IsVarArg) {
594 for (
const auto &
In : Ins) {
595 assert(!
In.Flags.isByVal() &&
"byval is not valid for return values");
596 assert(!
In.Flags.isNest() &&
"nest is not valid for return values");
597 if (
In.Flags.isInAlloca())
598 fail(DL, DAG,
"WebAssembly hasn't implemented inalloca return values");
599 if (
In.Flags.isInConsecutiveRegs())
600 fail(DL, DAG,
"WebAssembly hasn't implemented cons regs return values");
601 if (
In.Flags.isInConsecutiveRegsLast())
603 "WebAssembly hasn't implemented cons regs last return values");
611 DAG.
getNode(Ins.empty() ? WebAssemblyISD::CALL0 : WebAssemblyISD::CALL1,
623 bool WebAssemblyTargetLowering::CanLowerReturn(
628 return Outs.
size() <= 1;
631 SDValue WebAssemblyTargetLowering::LowerReturn(
636 assert(Outs.
size() <= 1 &&
"WebAssembly can only return up to one value");
638 fail(DL, DAG,
"WebAssembly doesn't support non-C calling conventions");
646 assert(!Out.Flags.isByVal() &&
"byval is not valid for return values");
647 assert(!Out.Flags.isNest() &&
"nest is not valid for return values");
648 assert(Out.IsFixed &&
"non-fixed return value is not valid");
649 if (Out.Flags.isInAlloca())
650 fail(DL, DAG,
"WebAssembly hasn't implemented inalloca results");
651 if (Out.Flags.isInConsecutiveRegs())
652 fail(DL, DAG,
"WebAssembly hasn't implemented cons regs results");
653 if (Out.Flags.isInConsecutiveRegsLast())
654 fail(DL, DAG,
"WebAssembly hasn't implemented cons regs last results");
660 SDValue WebAssemblyTargetLowering::LowerFormalArguments(
665 fail(DL, DAG,
"WebAssembly doesn't support non-C calling conventions");
675 if (
In.Flags.isInAlloca())
676 fail(DL, DAG,
"WebAssembly hasn't implemented inalloca arguments");
677 if (
In.Flags.isNest())
678 fail(DL, DAG,
"WebAssembly hasn't implemented nest arguments");
679 if (
In.Flags.isInConsecutiveRegs())
680 fail(DL, DAG,
"WebAssembly hasn't implemented cons regs arguments");
681 if (
In.Flags.isInConsecutiveRegsLast())
682 fail(DL, DAG,
"WebAssembly hasn't implemented cons regs last arguments");
687 ? DAG.
getNode(WebAssemblyISD::ARGUMENT, DL,
In.VT,
692 MFI->addParam(
In.VT);
699 unsigned VarargVreg =
701 MFI->setVarargBufferVreg(VarargVreg);
703 Chain, DL, VarargVreg,
704 DAG.
getNode(WebAssemblyISD::ARGUMENT, DL, PtrVT,
706 MFI->addParam(PtrVT);
713 for (
MVT VT : Results)
731 return LowerFrameIndex(Op, DAG);
733 return LowerGlobalAddress(Op, DAG);
735 return LowerExternalSymbol(Op, DAG);
737 return LowerJumpTable(Op, DAG);
739 return LowerBR_JT(Op, DAG);
741 return LowerVASTART(Op, DAG);
744 fail(DL, DAG,
"WebAssembly hasn't implemented computed gotos");
747 fail(DL, DAG,
"WebAssembly hasn't implemented __builtin_return_address");
750 return LowerFRAMEADDR(Op, DAG);
752 return LowerCopyToReg(Op, DAG);
754 return LowerINTRINSIC_WO_CHAIN(Op, DAG);
761 if (isa<FrameIndexSDNode>(Src.
getNode())) {
773 : WebAssembly::COPY_I64,
787 int FI = cast<FrameIndexSDNode>(
Op)->getIndex();
809 const auto *GA = cast<GlobalAddressSDNode>(
Op);
811 assert(GA->getTargetFlags() == 0 &&
812 "Unexpected target flags on generic GlobalAddressSDNode");
813 if (GA->getAddressSpace() != 0)
814 fail(DL, DAG,
"WebAssembly only expects the 0 address space");
820 SDValue WebAssemblyTargetLowering::LowerExternalSymbol(
823 const auto *ES = cast<ExternalSymbolSDNode>(
Op);
825 assert(ES->getTargetFlags() == 0 &&
826 "Unexpected target flags on generic ExternalSymbolSDNode");
851 const auto *
JT = cast<JumpTableSDNode>(Op.
getOperand(1));
853 assert(
JT->getTargetFlags() == 0 &&
"WebAssembly doesn't set target flags");
857 Ops.push_back(Index);
882 MFI->getVarargBufferVreg(), PtrVT);
888 WebAssemblyTargetLowering::LowerINTRINSIC_WO_CHAIN(
SDValue Op,
890 unsigned IntNo = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
896 case Intrinsic::wasm_lsda:
SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
void setFrameAddressIsTaken(bool T)
static MVT getIntegerVT(unsigned BitWidth)
void push_back(const T &Elt)
unsigned Log2_32_Ceil(uint32_t Value)
Return the ceil log base 2 of the specified value, 32 if the value is zero.
This file defines the interfaces that WebAssembly uses to lower LLVM code into a selection DAG...
A parsed version of the target data layout string in and methods for querying it. ...
EVT getValueType() const
Return the ValueType of the referenced return value.
bool isInteger() const
Return true if this is an integer or a vector integer type.
void setLoadExtAction(unsigned ExtType, MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified load with extension does not work with the specified type and indicate wh...
static Type * getDoubleTy(LLVMContext &C)
const std::vector< MachineJumpTableEntry > & getJumpTables() const
Diagnostic information for unsupported feature in backend.
const TargetRegisterClass * getRegClass(unsigned Reg) const
Return the register class of the specified virtual register.
C - The default llvm calling convention, compatible with C.
BR_CC - Conditional branch.
Compute iterated dominance frontiers using a linear time algorithm.
bool isVector() const
Return true if this is a vector value type.
void addLiveIn(unsigned Reg, unsigned vreg=0)
addLiveIn - Add the specified register as a live-in.
Carry-setting nodes for multiple precision addition and subtraction.
static void fail(const SDLoc &DL, SelectionDAG &DAG, const char *msg)
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
unsigned getReg() const
getReg - Returns the register number.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB)
Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor bloc...
STACKRESTORE has two operands, an input chain and a pointer to restore to it returns an output chain...
void setHasFloatingPointExceptions(bool FPExceptions=true)
Tells the code generator that this target supports floating point exceptions and cares about preservi...
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
SDValue getBasicBlock(MachineBasicBlock *MBB)
Function Alias Analysis Results
virtual std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const
Given a physical register constraint (e.g.
virtual const TargetRegisterClass * getRegClassFor(MVT VT) const
Return the register class that should be used for the specified value type.
unsigned const TargetRegisterInfo * TRI
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned char TargetFlags=0)
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
int CreateStackObject(uint64_t Size, unsigned Alignment, bool isSpillSlot, const AllocaInst *Alloca=nullptr, uint8_t ID=0)
Create a new statically sized stack object, returning a nonnegative identifier to represent it...
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
void setTruncStoreAction(MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified truncating store does not work with the specified type and indicate what ...
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations...
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo)
void setMaxAtomicSizeInBitsSupported(unsigned SizeInBits)
Set the maximum atomic operation size supported by the backend.
const HexagonInstrInfo * TII
static Type * getFloatTy(LLVMContext &C)
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
MachineSDNode * getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT)
These are used for target selectors to create a new node with specified return type(s), MachineInstr opcode, and operands.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
CopyToReg - This node has three operands: a chain, a register number to set to this value...
uint64_t getConstantOperandVal(unsigned i) const
void setCondCodeAction(ISD::CondCode CC, MVT VT, LegalizeAction Action)
Indicate that the specified condition code is or isn't supported on the target and indicate what to d...
bool isInConsecutiveRegs() const
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
void setOperationAction(unsigned Op, MVT VT, LegalizeAction Action)
Indicate that the specified operation does not work with the specified type and indicate what to do a...
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and llvm.returnaddress on the DAG...
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
OutputArg - This struct carries flags and a value for a single outgoing (actual) argument or outgoing...
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
STACKSAVE - STACKSAVE has one operand, an input chain.
unsigned getSizeInBits() const
This is a fast-path instruction selection class that generates poor code and doesn't support illegal ...
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
This file declares the WebAssembly-specific subclass of TargetMachine.
MachineFunction & getMachineFunction() const
void computeRegisterProperties(const TargetRegisterInfo *TRI)
Once all of the register classes are added, this allows us to compute derived properties we expose...
SDValue getTargetFrameIndex(int FI, EVT VT)
const TargetMachine & getTarget() const
Simple integer binary arithmetic operators.
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
amdgpu Simplify well known AMD library false Value * Callee
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=nullptr)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
unsigned getByValSize() const
bool IsFixed
IsFixed - Is this a "fixed" value, ie not passed through a vararg "...".
TargetInstrInfo - Interface to description of machine instruction set.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
Control flow instructions. These all have token chains.
static bool CallingConvSupported(CallingConv::ID CallConv)
unsigned const MachineRegisterInfo * MRI
MVT getPointerTy(const DataLayout &DL, uint32_t AS=0) const
Return the pointer type for the given address space, defaults to the pointer type from the data layou...
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
void addRegisterClass(MVT VT, const TargetRegisterClass *RC)
Add the specified register class as an available regclass for the specified value type...
void ComputeSignatureVTs(const Function &F, const TargetMachine &TM, SmallVectorImpl< MVT > &Params, SmallVectorImpl< MVT > &Results)
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
VAEND, VASTART - VAEND and VASTART have three operands: an input chain, pointer, and a SRCVALUE...
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
Carry-using nodes for multiple precision addition and subtraction.
This file provides WebAssembly-specific target descriptions.
unsigned char getTargetFlags() const
void setBooleanContents(BooleanContent Ty)
Specify how the target extends the result of integer and floating point boolean values from i1 to a w...
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
TRAP - Trapping instruction.
unsigned GuaranteedTailCallOpt
GuaranteedTailCallOpt - This flag is enabled when -tailcallopt is specified on the commandline...
self_iterator getIterator()
VAARG - VAARG has four operands: an input chain, a pointer, a SRCVALUE, and the alignment.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
static unsigned NumFixedArgs
uint64_t NextPowerOf2(uint64_t A)
Returns the next power of two (in 64-bits) that is strictly greater than A.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This class contains a discriminated union of information about pointers in memory operands...
Fast - This calling convention attempts to make calls as fast as possible (e.g.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
WebAssemblyTargetLowering(const TargetMachine &TM, const WebAssemblySubtarget &STI)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
SDValue getTargetJumpTable(int JTI, EVT VT, unsigned char TargetFlags=0)
TokenFactor - This node takes multiple tokens as input and produces a single token result...
static MachineBasicBlock * LowerFPToInt(MachineInstr &MI, DebugLoc DL, MachineBasicBlock *BB, const TargetInstrInfo &TII, bool IsUnsigned, bool Int64, bool Float64, unsigned LoweredOpcode)
This file declares the WebAssembly-specific subclass of TargetSubtarget.
Iterator for intrusive lists based on ilist_node.
CCState - This class holds information needed while lowering arguments and return values...
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Provides information about what library functions are available for the current target.
const DebugLoc & getDebugLoc() const
SDValue getMemcpy(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool AlwaysInline, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
EVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
Byte Swap and Counting operators.
FP16_TO_FP, FP_TO_FP16 - These operators are used to perform promotions and truncation for half-preci...
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
static Constant * get(Type *Ty, double V)
This returns a ConstantFP, or a vector containing a splat of a ConstantFP, for the specified value in...
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N)
const Function & getFunction() const
Return the LLVM function that this machine code represents.
static mvt_range integer_valuetypes()
unsigned getFrameRegister(const MachineFunction &MF) const override
unsigned getByValAlign() const
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
AddrMode
ARM Addressing Modes.
FMINNAN/FMAXNAN - Behave identically to FMINNUM/FMAXNUM, except that when a single input is NaN...
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
const WebAssemblyRegisterInfo * getRegisterInfo() const override
amdgpu Simplify well known AMD library false Value Value * Arg
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
BR_JT - Jumptable branch.
Representation of each machine instruction.
VACOPY - VACOPY has 5 operands: an input chain, a destination pointer, a source pointer, a SRCVALUE for the destination, and a SRCVALUE for the source.
This class is derived from MachineFunctionInfo and contains private WebAssembly-specific information ...
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
bool isVector() const
Return true if this is a vector value type.
void splice(iterator Where, MachineBasicBlock *Other, iterator From)
Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before '...
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT)
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
LLVM_NODISCARD bool empty() const
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
bool isInConsecutiveRegsLast() const
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
virtual EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const
Return the ValueType of the result of SETCC operations.
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
This file declares WebAssembly-specific per-machine-function information.
void setStackPointerRegisterToSaveRestore(unsigned R)
If set to a physical register, this specifies the register that llvm.savestack/llvm.restorestack should save and restore.
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
static CCValAssign getMem(unsigned ValNo, MVT ValVT, unsigned Offset, MVT LocVT, LocInfo HTP)
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
unsigned getOpcode() const
FSINCOS - Compute both fsin and fcos as a single operation.
SDValue getValue(unsigned R) const
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void insert(iterator MBBI, MachineBasicBlock *MBB)
SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
void setSchedulingPreference(Sched::Preference Pref)
Specify the target scheduling preference.
LLVM Value Representation.
FMA - Perform a * b + c with no intermediate rounding step.
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
const WebAssemblyInstrInfo * getInstrInfo() const override
unsigned getNumOperands() const
const SDValue & getOperand(unsigned i) const
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0) const
const MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.
const MachineOperand & getOperand(unsigned i) const
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
LLVMContext * getContext() const
unsigned createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned char TargetFlags=0)
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned to a specified boundary...