42 #define DEBUG_TYPE "xcore-lower"
217 case ISD::LOAD:
return LowerLOAD(Op, DAG);
285 unsigned ObjSize =
DL.getTypeAllocSize(ObjType);
298 int64_t FoldedOffset = std::max(Offset & ~3, (int64_t)0);
300 GA = getGlobalAddressWrapper(GA, GV, DAG);
302 if (Offset != FoldedOffset) {
327 const BlockAddress *BA = cast<BlockAddressSDNode>(Op)->getBlockAddress();
368 unsigned NumEntries = MJTI->
getJumpTables()[JTI].MBBs.size();
369 if (NumEntries <= 32) {
372 assert((NumEntries >> 31) == 0);
384 if ((Offset & 0x3) == 0) {
390 int32_t LowOffset = HighOffset - 4;
393 dyn_cast<GlobalAddressSDNode>(Base.
getNode())) {
408 false,
false,
false, 0);
410 false,
false,
false, 0);
416 SDValue Ops[] = { Result, Chain };
422 APInt KnownZero, KnownOne;
432 "Unexpected extension type");
456 Offset = cast<ConstantSDNode>(BasePtr->
getOperand(1))->getSExtValue();
457 return lowerLoadWordFromAlignedBasePlusOffset(DL, Chain, NewBasePtr,
464 return lowerLoadWordFromAlignedBasePlusOffset(DL, Chain, NewBasePtr,
486 SDValue Ops[] = { Result, Chain };
496 Entry.
Node = BasePtr;
497 Args.push_back(Entry);
500 CLI.setDebugLoc(DL).setChain(Chain).setCallee(
506 std::pair<SDValue, SDValue> CallResult =
LowerCallTo(CLI);
507 SDValue Ops[] = { CallResult.first, CallResult.second };
556 Entry.
Node = BasePtr;
557 Args.push_back(Entry);
560 Args.push_back(Entry);
563 CLI.setDebugLoc(dl).setChain(Chain).setCallee(
569 std::pair<SDValue, SDValue> CallResult =
LowerCallTo(CLI);
570 return CallResult.second;
577 "Unexpected operand to lower!");
594 "Unexpected operand to lower!");
614 SDValue &Addend1,
bool requireIntermediatesHaveOneUse)
631 if (requireIntermediatesHaveOneUse && !AddOp.
hasOneUse())
635 if (requireIntermediatesHaveOneUse && !OtherOp.
hasOneUse())
681 SDValue LL, RL, AddendL, AddendH;
702 if (LHSSB > 32 && RHSSB > 32) {
731 "Unknown operand to lower!");
734 SDValue Result = TryExpandADDWithMul(N, DAG);
765 SDValue Ignored(Hi.getNode(), 1);
780 const Value *SV = cast<SrcValueSDNode>(Node->
getOperand(2))->getValue();
784 false,
false,
false, 0);
794 false,
false,
false, 0);
817 if (cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue() > 0)
833 if (cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue() > 0)
878 unsigned HandlerReg = XCore::R3;
905 const Value *TrmpAddr = cast<SrcValueSDNode>(Op.
getOperand(4))->getValue();
923 OutChains[0] = DAG.
getStore(Chain, dl,
929 OutChains[1] = DAG.
getStore(Chain, dl,
935 OutChains[2] = DAG.
getStore(Chain, dl,
941 OutChains[3] = DAG.
getStore(Chain, dl, Nest, Addr,
947 OutChains[4] = DAG.
getStore(Chain, dl, FPtr, Addr,
957 unsigned IntNo = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
959 case Intrinsic::xcore_crc8:
965 SDValue Results[] = { Crc, Data };
982 "setInsertFencesForAtomic(true) and yet greater than Monotonic");
1012 "setInsertFencesForAtomic(true) and yet greater than Monotonic");
1041 #include "XCoreGenCallingConv.inc"
1072 return LowerCCCCallTo(Chain, Callee, CallConv, isVarArg, isTailCall,
1073 Outs, OutVals, Ins, dl, DAG, InVals);
1086 for (
unsigned i = 0, e = RVLocs.
size(); i != e; ++i) {
1090 InFlag).getValue(1);
1104 for (
unsigned i = 0, e = ResultMemLocs.
size(); i != e; ++i) {
1105 int offset = ResultMemLocs[i].first;
1106 unsigned index = ResultMemLocs[i].second;
1110 InVals[index] = load;
1116 if (!MemOpChains.
empty())
1127 XCoreTargetLowering::LowerCCCCallTo(
SDValue Chain,
SDValue Callee,
1145 CCInfo.AnalyzeCallOperands(Outs, CC_XCore);
1152 RetCCInfo.AnalyzeCallResult(Ins, RetCC_XCore);
1155 unsigned NumBytes = RetCCInfo.getNextStackOffset();
1165 for (
unsigned i = 0, e = ArgLocs.
size(); i != e; ++i) {
1202 if (!MemOpChains.
empty())
1210 for (
unsigned i = 0, e = RegsToPass.
size(); i != e; ++i) {
1211 Chain = DAG.
getCopyToReg(Chain, dl, RegsToPass[i].first,
1212 RegsToPass[i].second, InFlag);
1235 for (
unsigned i = 0, e = RegsToPass.
size(); i != e; ++i)
1237 RegsToPass[i].second.getValueType()));
1265 XCoreTargetLowering::LowerFormalArguments(
SDValue Chain,
1279 return LowerCCCArguments(Chain, CallConv, isVarArg,
1280 Ins, dl, DAG, InVals);
1289 XCoreTargetLowering::LowerCCCArguments(
SDValue Chain,
1311 unsigned LRSaveSize = StackSlotSize;
1328 for (
unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
1340 errs() <<
"LowerFormalArguments Unhandled argument type: "
1356 if (ObjSize > StackSlotSize) {
1357 errs() <<
"LowerFormalArguments Unhandled argument type: "
1371 false,
false,
false, 0);
1373 const ArgDataPair ADP = { ArgIn, Ins[i].Flags };
1381 XCore::R0, XCore::R1,
XCore::R2, XCore::R3
1384 unsigned FirstVAReg = CCInfo.getFirstUnallocated(ArgRegs);
1392 if (i == (
int)FirstVAReg) {
1395 offset -= StackSlotSize;
1416 if (!CFRegNode.
empty())
1424 ArgDE = ArgData.
end();
1425 ArgDI != ArgDE; ++ArgDI) {
1426 if (ArgDI->Flags.isByVal() && ArgDI->Flags.getByValSize()) {
1427 unsigned Size = ArgDI->Flags.getByValSize();
1428 unsigned Align = std::max(StackSlotSize, ArgDI->Flags.getByValAlign());
1435 Align,
false,
false,
false,
1444 if (!MemOps.
empty()) {
1456 bool XCoreTargetLowering::
1462 CCState CCInfo(CallConv, isVarArg, MF, RVLocs, Context);
1463 if (!CCInfo.CheckReturn(Outs, RetCC_XCore))
1465 if (CCInfo.getNextStackOffset() != 0 && isVarArg)
1471 XCoreTargetLowering::LowerReturn(
SDValue Chain,
1493 CCInfo.AnalyzeReturn(Outs, RetCC_XCore);
1503 for (
unsigned i = 0, e = RVLocs.
size(); i != e; ++i) {
1515 int FI = MFI->CreateFixedObject(ObjSize, Offset,
false);
1527 if (!MemOpChains.
empty())
1531 for (
unsigned i = 0, e = RVLocs.
size(); i != e; ++i) {
1548 RetOps.push_back(Flag);
1563 "Unexpected instr type to insert");
1624 DAGCombinerInfo &DCI)
const {
1630 switch (cast<ConstantSDNode>(N->
getOperand(1))->getZExtValue()) {
1631 case Intrinsic::xcore_outt:
1632 case Intrinsic::xcore_outct:
1633 case Intrinsic::xcore_chkct: {
1639 APInt KnownZero, KnownOne;
1641 !DCI.isBeforeLegalizeOps());
1643 if (TLO.ShrinkDemandedConstant(OutVal, DemandedMask) ||
1644 TLI.SimplifyDemandedBits(OutVal, DemandedMask, KnownZero, KnownOne,
1646 DCI.CommitTargetLoweringOpt(TLO);
1650 case Intrinsic::xcore_setpt: {
1656 APInt KnownZero, KnownOne;
1658 !DCI.isBeforeLegalizeOps());
1660 if (TLO.ShrinkDemandedConstant(Time, DemandedMask) ||
1661 TLI.SimplifyDemandedBits(Time, DemandedMask, KnownZero, KnownOne,
1663 DCI.CommitTargetLoweringOpt(TLO);
1682 if (N0C && N0C->
isNullValue() && N1C && N1C->isNullValue()) {
1686 SDValue Ops[] = { Result, Carry };
1693 APInt KnownZero, KnownOne;
1695 VT.getSizeInBits() - 1);
1697 if ((KnownZero & Mask) == Mask) {
1700 SDValue Ops[] = { Result, Carry };
1715 if (N0C && N0C->
isNullValue() && N1C && N1C->isNullValue()) {
1716 APInt KnownZero, KnownOne;
1718 VT.getSizeInBits() - 1);
1720 if ((KnownZero & Mask) == Mask) {
1724 SDValue Ops[] = { Result, Borrow };
1732 APInt KnownZero, KnownOne;
1734 VT.getSizeInBits() - 1);
1736 if ((KnownZero & Mask) == Mask) {
1739 SDValue Ops[] = { Result, Borrow };
1755 if ((N0C && !N1C) ||
1756 (N0C && N1C && N0C->
getZExtValue() < N1C->getZExtValue()))
1761 if (N1C && N1C->isNullValue()) {
1772 SDValue Ops[] = { Carry, Result };
1782 SDValue Mul0, Mul1, Addend0, Addend1;
1787 Mul1, Addend0, Addend1);
1812 Addend0L, Addend1L);
1821 if (!DCI.isBeforeLegalize() ||
1831 if (StoreBits % 8) {
1837 if (Alignment >= ABIAlignment) {
1860 void XCoreTargetLowering::computeKnownBitsForTargetNode(
const SDValue Op,
1864 unsigned Depth)
const {
1878 unsigned IntNo = cast<ConstantSDNode>(Op.
getOperand(1))->getZExtValue();
1880 case Intrinsic::xcore_getts:
1885 case Intrinsic::xcore_int:
1886 case Intrinsic::xcore_inct:
1891 case Intrinsic::xcore_testct:
1896 case Intrinsic::xcore_testwct:
1913 return (val >= 0 && val <= 11);
1918 return (val%2 == 0 &&
isImmUs(val/2));
1923 return (val%4 == 0 &&
isImmUs(val/4));
1930 unsigned AS)
const {
1943 if (AM.
Scale == 0) {
1951 if (AM.
Scale == 0) {
1958 if (AM.
Scale == 0) {
1970 std::pair<unsigned, const TargetRegisterClass *>
1974 if (Constraint.
size() == 1) {
1975 switch (Constraint[0]) {
1978 return std::make_pair(0U, &XCore::GRRegsRegClass);
SDValue getTruncStore(SDValue Chain, SDLoc dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, EVT TVT, bool isNonTemporal, bool isVolatile, unsigned Alignment, const AAMDNodes &AAInfo=AAMDNodes())
ADJUST_TRAMPOLINE - This corresponds to the adjust_trampoline intrinsic.
int createLRSpillSlot(MachineFunction &MF)
void push_back(const T &Elt)
const MachineFunction * getParent() const
getParent - Return the MachineFunction containing this basic block.
A parsed version of the target data layout string in and methods for querying it. ...
SDValue getValue(unsigned R) const
This represents an addressing mode of: BaseGV + BaseOffs + BaseReg + Scale*ScaleReg If BaseGV is null...
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 bool isImmUs2(int64_t val)
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
EXTRACT_ELEMENT - This is used to get the lower or upper (determined by a Constant, which is required to be operand #1) half of the integer or float value specified as operand #0.
LLVMContext * getContext() const
SDValue getCopyToReg(SDValue Chain, SDLoc dl, unsigned Reg, SDValue N)
SDValue getCALLSEQ_END(SDValue Chain, SDValue Op1, SDValue Op2, SDValue InGlue, SDLoc DL)
Return a new CALLSEQ_END node, which always must have a glue result (to ensure it's not CSE'd)...
void setVarArgsFrameIndex(int off)
size_t size() const
size - Get the string size.
BR_CC - Conditional branch.
LocInfo getLocInfo() const
bool hasNUsesOfValue(unsigned NUses, unsigned Value) const
Return true if there are exactly NUSES uses of the indicated value.
bool hasOneUse() const
Return true if there is exactly one node using value ResNo of Node.
XCoreTargetLowering(const TargetMachine &TM, const XCoreSubtarget &Subtarget)
const TargetMachine & getTargetMachine() const
const SDValue & getVal() const
unsigned createVirtualRegister(const TargetRegisterClass *RegClass)
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
void addLiveIn(unsigned Reg, unsigned vreg=0)
addLiveIn - Add the specified register as a live-in.
SDValue getMergeValues(ArrayRef< SDValue > Ops, SDLoc dl)
Create a MERGE_VALUES node from the given operands.
Carry-setting nodes for multiple precision addition and subtraction.
void AnalyzeFormalArguments(const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
AnalyzeFormalArguments - Analyze an array of argument values, incorporating info about the formals in...
STACKRESTORE has two operands, an input chain and a pointer to restore to it returns an output chain...
void computeKnownBits(SDValue Op, APInt &KnownZero, APInt &KnownOne, unsigned Depth=0) const
Determine which bits of Op are known to be either zero or one and return them in the KnownZero/KnownO...
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
LowerOperation - Provide custom lowering hooks for some operations.
EK_Inline - Jump table entries are emitted inline at their point of use.
static APInt getLowBitsSet(unsigned numBits, unsigned loBitsSet)
Get a value with low bits set.
const GlobalValue * getGlobal() const
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
static Constant * getGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant * > IdxList, bool InBounds=false, Type *OnlyIfReducedTy=nullptr)
Getelementptr form.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
Type * getTypeForEVT(LLVMContext &Context) const
getTypeForEVT - This method returns an LLVM type corresponding to the specified EVT.
unsigned getSizeInBits() const
SDValue getLoad(EVT VT, SDLoc dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, bool isVolatile, bool isNonTemporal, bool isInvariant, unsigned Alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands...
bool isZExtFree(SDValue Val, EVT VT2) const override
Return true if zero-extending the specific node Val to type VT2 is free (either because it's implicit...
void setBooleanVectorContents(BooleanContent Ty)
Specify how the target extends the result of a vector boolean value from a vector of i1 to a wider ty...
unsigned getValueSizeInBits() const
Returns the size of the value in bits.
unsigned getReturnStackOffset() const
void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *fromMBB)
transferSuccessorsAndUpdatePHIs - Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor blocks which refer to fromMBB to refer to this.
const SDValue & getOperand(unsigned Num) const
virtual bool allowsMisalignedMemoryAccesses(EVT, unsigned AddrSpace=0, unsigned Align=1, bool *=nullptr) const
Determine if the target supports unaligned memory accesses.
SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned char TargetFlags=0)
const char * getSection() const
const SDValue & getBasePtr() const
SDValue getConstantPool(const Constant *C, EVT VT, unsigned Align=0, int Offs=0, bool isT=false, unsigned char TargetFlags=0)
OUTCHAIN = ATOMIC_FENCE(INCHAIN, ordering, scope) This corresponds to the fence instruction.
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
unsigned getResNo() const
get the index which selects a specific result in the SDNode
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
Reports a serious error, calling any installed error handler.
SDValue getExternalSymbol(const char *Sym, EVT VT)
Type * getPointerElementType() const
SDValue getMemcpy(SDValue Chain, SDLoc dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool AlwaysInline, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
static MachinePointerInfo getFixedStack(int FI, int64_t offset=0)
getFixedStack - Return a MachinePointerInfo record that refers to the the specified FrameIndex...
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
static bool isImmUs(int64_t val)
A convenience struct that encapsulates a DAG, and two SDValues for returning information from TargetL...
static int stackSlotSize()
Stack slot size (4 bytes)
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations...
const std::vector< MachineJumpTableEntry > & getJumpTables() const
BlockAddress - The address of a basic block.
SDValue getStore(SDValue Chain, SDLoc dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, bool isVolatile, bool isNonTemporal, unsigned Alignment, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
static bool IsSmallObject(const GlobalValue *GV, const XCoreTargetLowering &XTL)
int getVarArgsFrameIndex() const
int64_t getOffset() const
const HexagonInstrInfo * TII
Shift and rotation operations.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
MachineFunction & getMachineFunction() const
BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
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.
SDValue getTargetGlobalAddress(const GlobalValue *GV, SDLoc DL, EVT VT, int64_t offset=0, unsigned char TargetFlags=0)
MachinePointerInfo getWithOffset(int64_t O) const
bool isSized(SmallPtrSetImpl< const Type * > *Visited=nullptr) const
isSized - Return true if it makes sense to take the size of this type.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
static const unsigned CodeModelLargeSize
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...
virtual unsigned getFrameRegister(const MachineFunction &MF) const =0
Debug information queries.
This is an SDNode representing atomic operations.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
bool isInteger() const
isInteger - Return true if this is an integer, or a vector integer type.
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
SmallVector< ISD::InputArg, 32 > Ins
STACKSAVE - STACKSAVE has one operand, an input chain.
FRAME_TO_ARGS_OFFSET - This node represents offset from frame pointer to first (possible) on-stack ar...
void ReplaceNodeResults(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const override
ReplaceNodeResults - Replace the results of node with an illegal result type with new values built ou...
SDValue getCALLSEQ_START(SDValue Chain, SDValue Op, SDLoc DL)
Return a new CALLSEQ_START node, which always must have a glue result (to ensure it's not CSE'd)...
const XCoreInstrInfo * getInstrInfo() const override
unsigned getLocReg() const
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
void setReturnStackOffset(unsigned value)
void computeRegisterProperties(const TargetRegisterInfo *TRI)
Once all of the register classes are added, this allows us to compute derived properties we expose...
std::pair< SDValue, SDValue > LowerCallTo(CallLoweringInfo &CLI) const
This function lowers an abstract call to a function into an actual call.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
Simple integer binary arithmetic operators.
SmallVector< ISD::OutputArg, 32 > Outs
AtomicOrdering getOrdering() const
const MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.
TypeID getTypeID() const
getTypeID - Return the type id for the type.
const SDValue & getBasePtr() const
MachineConstantPoolValue * getMachineCPVal() const
EVT getMemoryVT() const
Return the type of the in-memory value.
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
Type * getElementType() const
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=nullptr)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
const DataLayout & getDataLayout() const
const BasicBlock * getBasicBlock() const
getBasicBlock - Return the LLVM basic block that this instance corresponded to originally.
This class is used to represent ISD::STORE nodes.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const SDValue & getBasePtr() const
Flag
These should be considered private to the implementation of the MCInstrDesc class.
TargetInstrInfo - Interface to description of machine instruction set.
LLVM_CONSTEXPR size_t array_lengthof(T(&)[N])
Find the length of an array.
static APInt getHighBitsSet(unsigned numBits, unsigned hiBitsSet)
Get a value with high bits set.
static Constant * getBitCast(Constant *C, Type *Ty, bool OnlyIfReduced=false)
SDNode * getNode() const
get the SDNode which holds the desired result
bundle_iterator< MachineInstr, instr_iterator > iterator
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
unsigned getStoreSizeInBits() const
getStoreSizeInBits - Return the number of bits overwritten by a store of the specified value type...
bool isMachineConstantPoolEntry() const
CodeModel::Model getCodeModel() const
Returns the code model.
MVT - Machine Value Type.
LLVM Basic Block Representation.
const SDValue & getOperand(unsigned i) const
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 setTargetDAGCombine(ISD::NodeType NT)
Targets should invoke this method for each target independent node that they want to provide a custom...
bool isNonTemporal() const
This is an important base class in LLVM.
VAEND, VASTART - VAEND and VASTART have three operands: an input chain, pointer, and a SRCVALUE...
const Constant * getConstVal() const
This file contains the declarations for the subclasses of Constant, which represent the different fla...
const MachineOperand & getOperand(unsigned i) const
Carry-using nodes for multiple precision addition and subtraction.
void setBooleanContents(BooleanContent Ty)
Specify how the target extends the result of integer and floating point boolean values from i1 to a w...
virtual std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const
Given a physical register constraint (e.g.
static Type * getVoidTy(LLVMContext &C)
SDValue getCopyFromReg(SDValue Chain, SDLoc dl, unsigned Reg, EVT VT)
INIT_TRAMPOLINE - This corresponds to the init_trampoline intrinsic.
unsigned getBitWidth() const
Return the number of bits in the APInt.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
unsigned getOpcode() const
TRAP - Trapping instruction.
void setPrefFunctionAlignment(unsigned Align)
Set the target's preferred function alignment.
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool Immutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
VAARG - VAARG has four operands: an input chain, a pointer, a SRCVALUE, and the alignment.
const SDValue & getValue() const
unsigned MaxStoresPerMemmove
Specify maximum bytes of store instructions per memmove call.
SDValue getExtLoad(ISD::LoadExtType ExtType, SDLoc dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, bool isVolatile, bool isNonTemporal, bool isInvariant, unsigned Alignment, const AAMDNodes &AAInfo=AAMDNodes())
Bit counting operators with an undefined result for zero inputs.
MachineInstrBuilder BuildMI(MachineFunction &MF, DebugLoc DL, const MCInstrDesc &MCID)
BuildMI - Builder interface.
bool MaskedValueIsZero(SDValue Op, const APInt &Mask, unsigned Depth=0) const
Return true if 'Op & Mask' is known to be zero.
XCoreFunctionInfo - This class is derived from MachineFunction private XCore target-specific informat...
EVT - Extended Value Type.
std::vector< ArgListEntry > ArgListTy
SDValue getGlobalAddress(const GlobalValue *GV, SDLoc DL, EVT VT, int64_t offset=0, bool isTargetGA=false, unsigned char TargetFlags=0)
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS) const override
isLegalAddressingMode - Return true if the addressing mode represented by AM is legal for this target...
This structure contains all information that is necessary for lowering calls.
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
MachinePointerInfo - This class contains a discriminated union of information about pointers in memor...
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
const MachinePointerInfo & getPointerInfo() const
const MDNode * getRanges() const
Returns the Ranges that describes the dereference.
IntegerType * getIntPtrType(LLVMContext &C, unsigned AddressSpace=0) const
Returns an integer type with size at least as big as that of a pointer in the given address space...
SDValue getTargetConstantPool(const Constant *C, EVT VT, unsigned Align=0, int Offset=0, unsigned char TargetFlags=0)
SDValue getTargetJumpTable(int JTI, EVT VT, unsigned char TargetFlags=0)
TokenFactor - This node takes multiple tokens as input and produces a single token result...
unsigned getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
CCState - This class holds information needed while lowering arguments and return values...
bool isFunctionTy() const
isFunctionTy - True if this is an instance of FunctionType.
bool isBaseWithConstantOffset(SDValue Op) const
Return true if the specified operand is an ISD::ADD with a ConstantSDNode on the right-hand side...
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
void setExceptionPointerRegister(unsigned R)
If set to a physical register, this sets the register that receives the exception address on entry to...
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...
CCValAssign - Represent assignment of one arg/retval to a location.
const SDValue & getChain() const
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
virtual bool isGAPlusOffset(SDNode *N, const GlobalValue *&GA, int64_t &Offset) const
Returns true (and the GlobalValue and the offset) if the node is a GlobalAddress + offset...
MachineFrameInfo * getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Represents one node in the SelectionDAG.
static SDValue LowerCallResult(SDValue Chain, SDValue InFlag, const SmallVectorImpl< CCValAssign > &RVLocs, SDLoc dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals)
LowerCallResult - Lower the result values of a call into the appropriate copies out of appropriate ph...
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(NoStrictAlign), cl::values(clEnumValN(StrictAlign,"aarch64-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"aarch64-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
AAMDNodes getAAInfo() const
Returns the AA info that describes the dereference.
static mvt_range integer_valuetypes()
bool isInTailCallPosition(SelectionDAG &DAG, SDNode *Node, SDValue &Chain) const
Check whether a given call node is in tail position within its function.
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
Class for arbitrary precision integers.
void setExceptionSelectorRegister(unsigned R)
If set to a physical register, this sets the register that receives the exception typeid on entry to ...
static bool isImmUs4(int64_t val)
void setMinFunctionAlignment(unsigned Align)
Set the target's minimum function alignment (in log2(bytes))
ZERO_EXTEND - Used for integer types, zeroing the new bits.
LLVM_ATTRIBUTE_UNUSED_RESULT std::enable_if< !is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
SDValue getNode(unsigned Opcode, SDLoc DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
ANY_EXTEND - Used for integer types. The high bits are undefined.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
uint64_t RoundUpToAlignment(uint64_t Value, uint64_t Align)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
unsigned getAddressSpace() const
Return the address space for the associated pointer.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
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.
uint64_t MinAlign(uint64_t A, uint64_t B)
MinAlign - A and B are either alignments or offsets.
PointerType * getType() const
Global values are always pointers.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
SDValue getTargetBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, unsigned char TargetFlags=0)
SmallVector< SDValue, 32 > OutVals
Bitwise operators - logical and, logical or, logical xor.
const TargetRegisterInfo * getRegisterInfo() const override
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 '...
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
static IntegerType * getInt32Ty(LLVMContext &C)
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
unsigned getSizeInBits() const
getSizeInBits - Return the size of the specified value type in bits.
Fast - This calling convention attempts to make calls as fast as possible (e.g.
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
unsigned getJumpTableEncoding() const override
Return the entry encoding for a jump table in the current function.
unsigned MaxStoresPerMemmoveOptSize
Maximum number of store instructions that may be substituted for a call to memmove, used for functions with OpSize attribute.
unsigned MaxStoresPerMemcpyOptSize
Maximum number of store operations that may be substituted for a call to memcpy, used for functions w...
void setStackPointerRegisterToSaveRestore(unsigned R)
If set to a physical register, this specifies the register that llvm.savestack/llvm.restorestack should save and restore.
unsigned countTrailingOnes() const
Count the number of trailing one bits.
const char * getTargetNodeName(unsigned Opcode) const override
getTargetNodeName - This method returns the name of a target specific
bool reachesChainWithoutSideEffects(SDValue Dest, unsigned Depth=2) const
Return true if this operand (which must be a chain) reaches the specified operand without crossing an...
static bool isADDADDMUL(SDValue Op, SDValue &Mul0, SDValue &Mul1, SDValue &Addend0, SDValue &Addend1, bool requireIntermediatesHaveOneUse)
isADDADDMUL - Return whether Op is in a form that is equivalent to add(add(mul(x,y),a),b).
unsigned MaxStoresPerMemcpy
Specify maximum bytes of store instructions per memcpy call.
SDValue getMemmove(SDValue Chain, SDLoc dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
int CreateStackObject(uint64_t Size, unsigned Alignment, bool isSS, const AllocaInst *Alloca=nullptr)
Create a new statically sized stack object, returning a nonnegative identifier to represent it...
EVT getValueType() const
Return the ValueType of the referenced return value.
bool hasLocalLinkage() const
OUTCHAIN = EH_RETURN(INCHAIN, OFFSET, HANDLER) - This node represents 'eh_return' gcc dwarf builtin...
SDValue getConstant(uint64_t Val, SDLoc DL, EVT VT, bool isTarget=false, bool isOpaque=false)
unsigned getReg() const
getReg - Returns the register number.
unsigned getAlignment() const
void insert(iterator MBBI, MachineBasicBlock *MBB)
SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
void setIntDivIsCheap(bool isCheap=true)
Tells the code generator that integer divide is expensive, and if possible, should be replaced by an ...
bool isSimple() const
isSimple - Test if the given EVT is simple (as opposed to being extended).
unsigned getAlignment() const
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...
void setSchedulingPreference(Sched::Preference Pref)
Specify the target scheduling preference.
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
SDValue getRegister(unsigned Reg, EVT VT)
void setInsertFencesForAtomic(bool fence)
Set if the DAG builder should automatically insert fences and reduce the order of atomic memory opera...
bool isTruncatingStore() const
Return true if the op does a truncation before store.
unsigned ComputeNumSignBits(SDValue Op, unsigned Depth=0) const
Return the number of times the sign bit of the register is replicated into the other bits...
BasicBlockListType::iterator iterator
const TargetLowering & getTargetLoweringInfo() const
Primary interface to the complete machine description for the target machine.
C - The default llvm calling convention, compatible with C.
StringRef - Represent a constant reference to a string, i.e.
unsigned MaxStoresPerMemset
Specify maximum number of store instructions per memset call.
unsigned MaxStoresPerMemsetOptSize
Maximum number of stores operations that may be substituted for the call to memset, used for functions with OptSize attribute.
static bool isWordAligned(SDValue Value, SelectionDAG &DAG)
unsigned getLocMemOffset() const
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val) This corresponds to "store atomic" instruction.
unsigned getAlignment() const
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
addReg - Add a new virtual register operand...
unsigned AllocateStack(unsigned Size, unsigned Align)
AllocateStack - Allocate a chunk of stack space with the specified size and alignment.
void addSuccessor(MachineBasicBlock *succ, uint32_t weight=0)
addSuccessor - Add succ as a successor of this MachineBasicBlock.
static IntegerType * getInt8Ty(LLVMContext &C)
Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr) This corresponds to "load atomic" instruction.
MVT getSimpleVT() const
getSimpleVT - Return the SimpleValueType held in the specified simple EVT.
SDValue getIntPtrConstant(uint64_t Val, SDLoc DL, bool isTarget=false)
uint64_t getZExtValue() const
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
This class is used to represent ISD::LOAD nodes.
DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned to a specified boundary...