42 #define DEBUG_TYPE "xcore-lower"
209 case ISD::LOAD:
return LowerLOAD(Op, DAG);
277 unsigned ObjSize = DL.getTypeAllocSize(ObjType);
290 int64_t FoldedOffset = std::max(Offset & ~3, (int64_t)0);
292 GA = getGlobalAddressWrapper(GA, GV, DAG);
294 if (Offset != FoldedOffset) {
318 const BlockAddress *BA = cast<BlockAddressSDNode>(
Op)->getBlockAddress();
359 unsigned NumEntries = MJTI->
getJumpTables()[JTI].MBBs.size();
360 if (NumEntries <= 32) {
363 assert((NumEntries >> 31) == 0);
370 SDValue XCoreTargetLowering::lowerLoadWordFromAlignedBasePlusOffset(
374 if ((Offset & 0x3) == 0) {
378 int32_t HighOffset =
alignTo(Offset, 4);
379 int32_t LowOffset = HighOffset - 4;
382 dyn_cast<GlobalAddressSDNode>(Base.
getNode())) {
403 SDValue Ops[] = { Result, Chain };
409 APInt KnownZero, KnownOne;
419 "Unexpected extension type");
443 Offset = cast<ConstantSDNode>(BasePtr->
getOperand(1))->getSExtValue();
444 return lowerLoadWordFromAlignedBasePlusOffset(DL, Chain, NewBasePtr,
451 return lowerLoadWordFromAlignedBasePlusOffset(DL, Chain, NewBasePtr,
472 SDValue Ops[] = { Result, Chain };
482 Entry.
Node = BasePtr;
483 Args.push_back(Entry);
486 CLI.setDebugLoc(DL).setChain(Chain).setCallee(
492 std::pair<SDValue, SDValue> CallResult =
LowerCallTo(CLI);
493 SDValue Ops[] = { CallResult.first, CallResult.second };
540 Entry.
Node = BasePtr;
541 Args.push_back(Entry);
544 Args.push_back(Entry);
547 CLI.setDebugLoc(dl).setChain(Chain).setCallee(
553 std::pair<SDValue, SDValue> CallResult =
LowerCallTo(CLI);
554 return CallResult.second;
561 "Unexpected operand to lower!");
578 "Unexpected operand to lower!");
598 SDValue &Addend1,
bool requireIntermediatesHaveOneUse)
615 if (requireIntermediatesHaveOneUse && !AddOp.
hasOneUse())
619 if (requireIntermediatesHaveOneUse && !OtherOp.
hasOneUse())
665 SDValue LL, RL, AddendL, AddendH;
686 if (LHSSB > 32 && RHSSB > 32) {
715 "Unknown operand to lower!");
718 if (
SDValue Result = TryExpandADDWithMul(N, DAG))
747 SDValue Ignored(Hi.getNode(), 1);
762 const Value *SV = cast<SrcValueSDNode>(Node->
getOperand(2))->getValue();
797 if (cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue() > 0)
813 if (cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue() > 0)
858 unsigned HandlerReg = XCore::R3;
885 const Value *TrmpAddr = cast<SrcValueSDNode>(Op.
getOperand(4))->getValue();
935 unsigned IntNo = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
937 case Intrinsic::xcore_crc8:
961 "setInsertFencesForAtomic(true) expects unordered / monotonic");
992 "setInsertFencesForAtomic(true) expects unordered / monotonic");
1020 #include "XCoreGenCallingConv.inc"
1051 return LowerCCCCallTo(Chain, Callee, CallConv, isVarArg, isTailCall,
1052 Outs, OutVals, Ins, dl, DAG, InVals);
1064 for (
unsigned i = 0, e = RVLocs.
size();
i != e; ++
i) {
1068 InFlag).getValue(1);
1082 for (
unsigned i = 0, e = ResultMemLocs.
size();
i != e; ++
i) {
1083 int offset = ResultMemLocs[
i].first;
1084 unsigned index = ResultMemLocs[
i].second;
1088 InVals[index] = load;
1094 if (!MemOpChains.
empty())
1104 SDValue XCoreTargetLowering::LowerCCCCallTo(
1120 CCInfo.AnalyzeCallOperands(Outs, CC_XCore);
1127 RetCCInfo.AnalyzeCallResult(Ins, RetCC_XCore);
1130 unsigned NumBytes = RetCCInfo.getNextStackOffset();
1140 for (
unsigned i = 0, e = ArgLocs.
size();
i != e; ++
i) {
1177 if (!MemOpChains.
empty())
1185 for (
unsigned i = 0, e = RegsToPass.
size();
i != e; ++
i) {
1187 RegsToPass[
i].second, InFlag);
1210 for (
unsigned i = 0, e = RegsToPass.
size();
i != e; ++
i)
1212 RegsToPass[i].second.getValueType()));
1239 SDValue XCoreTargetLowering::LowerFormalArguments(
1249 return LowerCCCArguments(Chain, CallConv, isVarArg,
1250 Ins, dl, DAG, InVals);
1258 SDValue XCoreTargetLowering::LowerCCCArguments(
1276 unsigned LRSaveSize = StackSlotSize;
1293 for (
unsigned i = 0, e = ArgLocs.size(); i != e; ++
i) {
1305 errs() <<
"LowerFormalArguments Unhandled argument type: "
1321 if (ObjSize > StackSlotSize) {
1322 errs() <<
"LowerFormalArguments Unhandled argument type: "
1337 const ArgDataPair ADP = { ArgIn, Ins[
i].Flags };
1345 XCore::R0, XCore::R1,
XCore::R2, XCore::R3
1348 unsigned FirstVAReg = CCInfo.getFirstUnallocated(ArgRegs);
1353 for (
int i =
array_lengthof(ArgRegs) - 1; i >= (int)FirstVAReg; --
i) {
1356 if (i == (
int)FirstVAReg) {
1359 offset -= StackSlotSize;
1380 if (!CFRegNode.
empty())
1388 ArgDE = ArgData.
end();
1389 ArgDI != ArgDE; ++ArgDI) {
1390 if (ArgDI->Flags.isByVal() && ArgDI->Flags.getByValSize()) {
1391 unsigned Size = ArgDI->Flags.getByValSize();
1392 unsigned Align = std::max(StackSlotSize, ArgDI->Flags.getByValAlign());
1399 Align,
false,
false,
false,
1408 if (!MemOps.
empty()) {
1420 bool XCoreTargetLowering::
1426 CCState CCInfo(CallConv, isVarArg, MF, RVLocs, Context);
1427 if (!CCInfo.CheckReturn(Outs, RetCC_XCore))
1429 if (CCInfo.getNextStackOffset() != 0 && isVarArg)
1457 CCInfo.AnalyzeReturn(Outs, RetCC_XCore);
1467 for (
unsigned i = 0, e = RVLocs.
size(); i != e; ++
i) {
1479 int FI = MFI.CreateFixedObject(ObjSize, Offset,
false);
1485 Chain, dl, OutVals[i], FIN,
1491 if (!MemOpChains.
empty())
1495 for (
unsigned i = 0, e = RVLocs.
size(); i != e; ++
i) {
1512 RetOps.push_back(Flag);
1527 "Unexpected instr type to insert");
1589 DAGCombinerInfo &DCI)
const {
1595 switch (cast<ConstantSDNode>(N->
getOperand(1))->getZExtValue()) {
1596 case Intrinsic::xcore_outt:
1597 case Intrinsic::xcore_outct:
1598 case Intrinsic::xcore_chkct: {
1604 APInt KnownZero, KnownOne;
1606 !DCI.isBeforeLegalizeOps());
1608 if (TLO.ShrinkDemandedConstant(OutVal, DemandedMask) ||
1609 TLI.SimplifyDemandedBits(OutVal, DemandedMask, KnownZero, KnownOne,
1611 DCI.CommitTargetLoweringOpt(TLO);
1615 case Intrinsic::xcore_setpt: {
1621 APInt KnownZero, KnownOne;
1623 !DCI.isBeforeLegalizeOps());
1625 if (TLO.ShrinkDemandedConstant(Time, DemandedMask) ||
1626 TLI.SimplifyDemandedBits(Time, DemandedMask, KnownZero, KnownOne,
1628 DCI.CommitTargetLoweringOpt(TLO);
1647 if (N0C && N0C->
isNullValue() && N1C && N1C->isNullValue()) {
1651 SDValue Ops[] = { Result, Carry };
1658 APInt KnownZero, KnownOne;
1660 VT.getSizeInBits() - 1);
1662 if ((KnownZero & Mask) == Mask) {
1665 SDValue Ops[] = { Result, Carry };
1680 if (N0C && N0C->
isNullValue() && N1C && N1C->isNullValue()) {
1681 APInt KnownZero, KnownOne;
1683 VT.getSizeInBits() - 1);
1685 if ((KnownZero & Mask) == Mask) {
1689 SDValue Ops[] = { Result, Borrow };
1697 APInt KnownZero, KnownOne;
1699 VT.getSizeInBits() - 1);
1701 if ((KnownZero & Mask) == Mask) {
1704 SDValue Ops[] = { Result, Borrow };
1720 if ((N0C && !N1C) ||
1721 (N0C && N1C && N0C->
getZExtValue() < N1C->getZExtValue()))
1726 if (N1C && N1C->isNullValue()) {
1737 SDValue Ops[] = { Carry, Result };
1747 SDValue Mul0, Mul1, Addend0, Addend1;
1752 Mul1, Addend0, Addend1);
1777 Addend0L, Addend1L);
1786 if (!DCI.isBeforeLegalize() ||
1796 assert((StoreBits % 8) == 0 &&
1797 "Store size in bits must be a multiple of 8");
1801 if (Alignment >= ABIAlignment) {
1824 void XCoreTargetLowering::computeKnownBitsForTargetNode(
const SDValue Op,
1828 unsigned Depth)
const {
1842 unsigned IntNo = cast<ConstantSDNode>(Op.
getOperand(1))->getZExtValue();
1844 case Intrinsic::xcore_getts:
1849 case Intrinsic::xcore_int:
1850 case Intrinsic::xcore_inct:
1855 case Intrinsic::xcore_testct:
1860 case Intrinsic::xcore_testwct:
1877 return (val >= 0 && val <= 11);
1882 return (val%2 == 0 &&
isImmUs(val/2));
1887 return (val%4 == 0 &&
isImmUs(val/4));
1894 unsigned AS)
const {
1907 if (AM.
Scale == 0) {
1915 if (AM.
Scale == 0) {
1922 if (AM.
Scale == 0) {
1934 std::pair<unsigned, const TargetRegisterClass *>
1938 if (Constraint.
size() == 1) {
1939 switch (Constraint[0]) {
1942 return std::make_pair(0U, &XCore::GRRegsRegClass);
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.
ADJUST_TRAMPOLINE - This corresponds to the adjust_trampoline intrinsic.
SDValue getGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, bool isTargetGA=false, unsigned char TargetFlags=0)
int createLRSpillSlot(MachineFunction &MF)
static SDValue LowerCallResult(SDValue Chain, SDValue InFlag, const SmallVectorImpl< CCValAssign > &RVLocs, const SDLoc &dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals)
LowerCallResult - Lower the result values of a call into the appropriate copies out of appropriate ph...
void push_back(const T &Elt)
const MachineFunction * getParent() const
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.
Flags getFlags() const
Return the raw flags of the source value,.
LLVMContext * getContext() const
SDValue getCALLSEQ_END(SDValue Chain, SDValue Op1, SDValue Op2, SDValue InGlue, const 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)
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
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.
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...
void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB)
Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor bloc...
Type * getValueType() const
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
static Constant * getGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant * > IdxList, bool InBounds=false, Optional< unsigned > InRangeIndex=None, Type *OnlyIfReducedTy=nullptr)
Getelementptr form.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
Function Alias Analysis Results
Type * getTypeForEVT(LLVMContext &Context) const
getTypeForEVT - This method returns an LLVM type corresponding to the specified EVT.
unsigned getSizeInBits() const
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
const SDValue & getOperand(unsigned Num) const
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
virtual bool allowsMisalignedMemoryAccesses(EVT, unsigned AddrSpace=0, unsigned Align=1, bool *=nullptr) const
Determine if the target supports unaligned memory accesses.
SDValue getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, EVT TVT, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
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.
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
SDValue getExternalSymbol(const char *Sym, EVT VT)
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...
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
const std::vector< MachineJumpTableEntry > & getJumpTables() const
The address of a basic block.
std::string getEVTString() const
getEVTString - This function returns value type as a string, e.g.
static bool IsSmallObject(const GlobalValue *GV, const XCoreTargetLowering &XTL)
int getVarArgsFrameIndex() const
struct fuzzer::@269 Flags
int64_t getOffset() const
const HexagonInstrInfo * TII
Shift and rotation operations.
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.
MachinePointerInfo getWithOffset(int64_t O) const
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.
SDValue getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
LLVM_NODISCARD bool empty() const
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...
SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
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...
const XCoreInstrInfo * getInstrInfo() const override
unsigned getLocReg() const
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...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
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.
Simple integer binary arithmetic operators.
SmallVector< ISD::OutputArg, 32 > Outs
AtomicOrdering getOrdering() const
Return the atomic ordering requirements for this memory operation.
const MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.
TypeID getTypeID() const
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.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
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
const BasicBlock * getBasicBlock() const
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
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
Flag
These should be considered private to the implementation of the MCInstrDesc class.
TargetInstrInfo - Interface to description of machine instruction set.
static APInt getHighBitsSet(unsigned numBits, unsigned hiBitsSet)
Get a value with high bits set.
static Constant * getBitCast(Constant *C, Type *Ty, bool OnlyIfReduced=false)
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
SDNode * getNode() const
get the SDNode which holds the desired result
constexpr uint64_t MinAlign(uint64_t A, uint64_t B)
MinAlign - A and B are either alignments or offsets.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
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...
C - The default llvm calling convention, compatible with C.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
This is an important base class in LLVM.
VAEND, VASTART - VAEND and VASTART have three operands: an input chain, pointer, and a SRCVALUE...
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
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)
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.
self_iterator getIterator()
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.
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
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)
This class contains a discriminated union of information about pointers in memory operands...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands...
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.
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.
bool isFunctionTy() const
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...
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.
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)
constexpr size_t array_lengthof(T(&)[N])
Find the length of an array.
const SDValue & getChain() const
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
SDValue getMemmove(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
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...
Represents one node in the SelectionDAG.
AAMDNodes getAAInfo() const
Returns the AA info that describes the dereference.
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N)
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.
SDValue getCALLSEQ_START(SDValue Chain, SDValue Op, const SDLoc &DL)
Return a new CALLSEQ_START node, which always must have a glue result (to ensure it's not CSE'd)...
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.
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.
ANY_EXTEND - Used for integer types. The high bits are undefined.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
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.
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.
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)
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
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 '...
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT)
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.
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
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 OptSize 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.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
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.
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.
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
bool hasLocalLinkage() const
OUTCHAIN = EH_RETURN(INCHAIN, OFFSET, HANDLER) - This node represents 'eh_return' gcc dwarf builtin...
unsigned getReg() const
getReg - Returns the register number.
unsigned getAlignment() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void insert(iterator MBBI, MachineBasicBlock *MBB)
SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
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)
bool isTruncatingStore() const
Return true if the op does a truncation before store.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
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...
const TargetLowering & getTargetLoweringInfo() const
Primary interface to the complete machine description for the target machine.
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
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.
Fast - This calling convention attempts to make calls as fast as possible (e.g.
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.
StringRef getSection() const
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned char TargetFlags=0)
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...