53#define DEBUG_TYPE "lanai-lower"
67 cl::desc(
"Maximum number of instruction to generate when lowering constant "
68 "multiplication instead of calling library function [default=14]"),
168 switch (
Op.getOpcode()) {
191 case ISD::DYNAMIC_STACKALLOC:
211 .
Case(
"pc", Lanai::PC)
212 .
Case(
"sp", Lanai::SP)
213 .
Case(
"fp", Lanai::FP)
214 .
Case(
"rr1", Lanai::RR1)
215 .
Case(
"r10", Lanai::R10)
216 .
Case(
"rr2", Lanai::RR2)
217 .
Case(
"r11", Lanai::R11)
218 .
Case(
"rca", Lanai::RCA)
223std::pair<unsigned, const TargetRegisterClass *>
227 if (Constraint.
size() == 1)
229 switch (Constraint[0]) {
231 return std::make_pair(0U, &Lanai::GPRRegClass);
246 Value *CallOperandVal = Info.CallOperandVal;
249 if (CallOperandVal ==
nullptr)
252 switch (*Constraint) {
278 if (Constraint.
size() > 1)
281 char ConstraintLetter = Constraint[0];
282 switch (ConstraintLetter) {
296 if (
C->getZExtValue() == 0) {
313 if (
C->getZExtValue() <= 31) {
322 int64_t Val =
C->getSExtValue();
323 if ((
isInt<32>(Val)) && ((Val & 0xffff) == 0)) {
331 int64_t Val =
C->getSExtValue();
332 if ((Val >= -33554432) && (Val <= 33554431)) {
342 if (Result.getNode()) {
343 Ops.push_back(Result);
354#include "LanaiGenCallingConv.inc"
364 return CC_Lanai32(ValNo, ValVT, LocVT, LocInfo, ArgFlags, OrigTy, State);
367 if (LocVT == MVT::i8 || LocVT == MVT::i16) {
371 else if (ArgFlags.
isZExt())
378 unsigned Offset = State.AllocateStack(4,
Align(4));
383SDValue LanaiTargetLowering::LowerFormalArguments(
390 return LowerCCCArguments(Chain, CallConv, IsVarArg, Ins,
DL, DAG, InVals);
398 SelectionDAG &DAG = CLI.
DAG;
400 SmallVectorImpl<ISD::OutputArg> &Outs = CLI.
Outs;
401 SmallVectorImpl<SDValue> &OutVals = CLI.
OutVals;
402 SmallVectorImpl<ISD::InputArg> &
Ins = CLI.
Ins;
415 return LowerCCCCallTo(Chain, Callee, CallConv, IsVarArg, IsTailCall, Outs,
416 OutVals, Ins,
DL, DAG, InVals);
424SDValue LanaiTargetLowering::LowerCCCArguments(
430 MachineRegisterInfo &RegInfo = MF.
getRegInfo();
431 LanaiMachineFunctionInfo *LanaiMFI = MF.
getInfo<LanaiMachineFunctionInfo>();
438 CCInfo.AnalyzeFormalArguments(Ins, CC_Lanai32_Fast);
440 CCInfo.AnalyzeFormalArguments(Ins, CC_Lanai32);
443 for (
const CCValAssign &VA : ArgLocs) {
446 EVT RegVT = VA.getLocVT();
470 LLVM_DEBUG(
dbgs() <<
"LowerFormalArguments Unhandled argument type: "
478 unsigned ObjSize = VA.getLocVT().getSizeInBits() / 8;
481 errs() <<
"LowerFormalArguments Unhandled argument type: "
482 << VA.getLocVT() <<
"\n";
491 VA.getLocVT(),
DL, Chain, FIN,
522 const Type *RetTy)
const {
524 CCState CCInfo(CallConv, IsVarArg, MF, RVLocs, Context);
543 CCInfo.AnalyzeReturn(Outs, RetCC_Lanai32);
549 for (
unsigned i = 0; i != RVLocs.
size(); ++i) {
569 "SRetReturnReg should have been set in LowerFormalArguments().");
581 unsigned Opc = LanaiISD::RET_GLUE;
583 RetOps.push_back(Glue);
592SDValue LanaiTargetLowering::LowerCCCCallTo(
609 CCInfo.AnalyzeCallOperands(Outs, CC_Lanai32_Fast);
611 CCInfo.AnalyzeCallOperands(Outs, CC_Lanai32);
619 for (
unsigned I = 0,
E = Outs.
size();
I !=
E; ++
I) {
620 ISD::ArgFlagsTy
Flags = Outs[
I].Flags;
621 if (!
Flags.isByVal())
626 Align Alignment =
Flags.getNonZeroByValAlign();
632 Chain = DAG.
getMemcpy(Chain,
DL, FIPtr, Arg, SizeNode, Alignment,
635 nullptr, std::nullopt, MachinePointerInfo(),
636 MachinePointerInfo());
647 for (
unsigned I = 0, J = 0,
E = ArgLocs.
size();
I !=
E; ++
I) {
648 CCValAssign &VA = ArgLocs[
I];
650 ISD::ArgFlagsTy
Flags = Outs[
I].Flags;
671 Arg = ByValArgs[J++];
689 DAG.
getStore(Chain,
DL, Arg, PtrOff, MachinePointerInfo()));
695 if (!MemOpChains.
empty())
704 for (
const auto &[
Reg,
N] : RegsToPass) {
722 SDVTList NodeTys = DAG.
getVTList(MVT::Other, MVT::Glue);
724 Ops.push_back(Chain);
725 Ops.push_back(Callee);
729 const uint32_t *
Mask =
731 assert(Mask &&
"Missing call preserved mask for calling convention");
736 for (
const auto &[
Reg,
N] : RegsToPass)
740 Ops.push_back(InGlue);
742 Chain = DAG.
getNode(LanaiISD::CALL,
DL, NodeTys,
752 return LowerCallResult(Chain, InGlue, CallConv, IsVarArg, Ins,
DL, DAG,
758SDValue LanaiTargetLowering::LowerCallResult(
767 CCInfo.AnalyzeCallResult(Ins, RetCC_Lanai32);
770 for (
unsigned I = 0;
I != RVLocs.
size(); ++
I) {
772 RVLocs[
I].getValVT(), InGlue)
793 switch (SetCCOpcode) {
798 if (RHSC->getZExtValue() == 0xFFFFFFFF) {
808 if (RHSC->getZExtValue() == 0)
816 if (RHSC->getZExtValue() == 0xFFFFFFFF) {
826 if (RHSC->getZExtValue() == 0)
862 return DAG.
getNode(LanaiISD::BR_CC,
DL,
Op.getValueType(), Chain, Dest,
867 EVT VT =
Op->getValueType(0);
875 int64_t MulAmt =
C->getSExtValue();
876 int32_t HighestOne = -1;
878 int SignedDigit[32] = {0};
889 int64_t E = std::abs(MulAmt);
890 int S = (MulAmt < 0 ? -1 : 1);
899 SignedDigit[
I] = S * ZI;
900 if (SignedDigit[
I] == 1)
911 int32_t InstrRequired = 2 * NonzeroEntries - 1;
913 if (std::abs(MulAmt) % 2 == 1)
926 if (HighestOne == -1)
931 SignedDigit[HighestOne] = 0;
936 for (
unsigned int I = 0;
I < std::size(SignedDigit); ++
I) {
937 if (SignedDigit[
I] == 0)
943 if (SignedDigit[
I] == 1)
945 else if (SignedDigit[
I] == -1)
961 return DAG.
getNode(LanaiISD::SETCC,
DL,
Op.getValueType(), TargetCC, Glue);
977 return DAG.
getNode(LanaiISD::SELECT_CC,
DL,
Op.getValueType(), TrueV, FalseV,
1037 EVT VT =
Op.getValueType();
1039 unsigned Depth =
Op.getConstantOperandVal(0);
1042 const unsigned Offset = -4;
1059 EVT VT =
Op.getValueType();
1062 unsigned Depth =
Op.getConstantOperandVal(0);
1064 const unsigned Offset = -8;
1090 DAG.
getNode(LanaiISD::SMALL,
DL, MVT::i32, Small));
1096 N->getOffset(), OpFlagHi);
1098 N->getOffset(), OpFlagLo);
1124 DAG.
getNode(LanaiISD::SMALL,
DL, MVT::i32, Small));
1167 DAG.
getNode(LanaiISD::SMALL,
DL, MVT::i32, Small));
1185 EVT VT =
Op.getValueType();
1188 assert(
Op.getNumOperands() == 3 &&
"Unexpected SHL!");
1208 LoBitsForHi = DAG.
getSelect(dl, MVT::i32, SetCC, Zero, LoBitsForHi);
1220 DAG.
getSelect(dl, MVT::i32, SetCC, HiForBigShift, HiForNormalShift);
1226 dl, MVT::i32, SetCC, DAG.
getConstant(0, dl, MVT::i32), LoForNormalShift);
1234 MVT VT =
Op.getSimpleValueType();
1296 bool &Invert,
SDValue &OtherOp,
1298 switch (
N->getOpcode()) {
1302 CC =
N->getOperand(0);
1321 CC =
N->getOperand(0);
1325 EVT VT =
N->getValueType(0);
1331 CC =
N->getOperand(0);
1335 EVT VT =
N->getValueType(0);
1369 EVT VT =
N->getValueType(0);
1374 NonConstantVal, DAG))
1380 DAG.
getNode(
N->getOpcode(),
SDLoc(
N), VT, OtherOp, NonConstantVal);
1419 switch (
N->getOpcode()) {
1439 switch (
Op.getOpcode()) {
1442 case LanaiISD::SETCC:
1446 case LanaiISD::SELECT_CC:
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file implements a class to represent arbitrary precision integral constant values and operations...
static bool isZeroOrAllOnes(SDValue N, bool AllOnes)
static SDValue PerformSUBCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, const ARMSubtarget *Subtarget)
PerformSUBCombine - Target-specific dag combine xforms for ISD::SUB.
static SDValue combineSelectAndUseCommutative(SDNode *N, bool AllOnes, TargetLowering::DAGCombinerInfo &DCI)
static bool isConditionalZeroOrAllOnes(SDNode *N, bool AllOnes, SDValue &CC, bool &Invert, SDValue &OtherOp, SelectionDAG &DAG)
static SDValue combineSelectAndUse(SDNode *N, SDValue Slct, SDValue OtherOp, TargetLowering::DAGCombinerInfo &DCI, bool AllOnes=false)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
static LPCC::CondCode IntCondCCodeToICC(SDValue CC, const SDLoc &DL, SDValue &RHS, SelectionDAG &DAG)
static cl::opt< int > LanaiLowerConstantMulThreshold("lanai-constant-mul-threshold", cl::Hidden, cl::desc("Maximum number of instruction to generate when lowering constant " "multiplication instead of calling library function [default=14]"), cl::init(14))
static bool CC_Lanai32_VarArg(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, Type *OrigTy, CCState &State)
Promote Memory to Register
static CodeModel::Model getCodeModel(const PPCSubtarget &S, const TargetMachine &TM, const MachineOperand &MO)
static constexpr MCPhysReg SPReg
const SmallVectorImpl< MachineOperand > & Cond
This file defines the SmallVector class.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
Class for arbitrary precision integers.
void setBits(unsigned loBit, unsigned hiBit)
Set the bits from loBit (inclusive) to hiBit (exclusive) to 1.
The address of a basic block.
CCState - This class holds information needed while lowering arguments and return values.
LLVM_ABI bool CheckReturn(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
CheckReturn - Analyze the return values of a function, returning true if the return can be performed ...
CCValAssign - Represent assignment of one arg/retval to a location.
Register getLocReg() const
LocInfo getLocInfo() const
static CCValAssign getMem(unsigned ValNo, MVT ValVT, int64_t Offset, MVT LocVT, LocInfo HTP, bool IsCustom=false)
int64_t getLocMemOffset() const
This is an important base class in LLVM.
bool hasStructRetAttr() const
Determine if the function returns a structure through first or second pointer argument.
LLVM_ABI const GlobalObject * getAliaseeObject() const
This is an important class for using LLVM in a threaded context.
Register getSRetReturnReg() const
void setVarArgsFrameIndex(int Index)
void setSRetReturnReg(Register Reg)
int getVarArgsFrameIndex() const
const LanaiRegisterInfo * getRegisterInfo() const override
SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG) const
SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG) const
SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const
SDValue LowerSRL_PARTS(SDValue Op, SelectionDAG &DAG) const
SDValue LowerMUL(SDValue Op, SelectionDAG &DAG) const
void computeKnownBitsForTargetNode(const SDValue Op, KnownBits &Known, const APInt &DemandedElts, const SelectionDAG &DAG, unsigned Depth=0) const override
Determine which of the bits specified in Mask are known to be either zero or one and return them in t...
SDValue LowerSHL_PARTS(SDValue Op, SelectionDAG &DAG) const
SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG) const
LanaiTargetLowering(const TargetMachine &TM, const LanaiSubtarget &STI)
SDValue LowerVASTART(SDValue Op, SelectionDAG &DAG) const
SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const
Register getRegisterByName(const char *RegName, LLT VT, const MachineFunction &MF) const override
Return the register ID of the name passed in.
SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const
SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const
SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const
SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const
bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF, bool IsVarArg, const SmallVectorImpl< ISD::OutputArg > &Outs, LLVMContext &Context, const Type *RetTy) const override
This hook should be implemented to check whether the return values described by the Outs array can fi...
ConstraintWeight getSingleConstraintMatchWeight(AsmOperandInfo &Info, const char *Constraint) const override
Examine constraint string and operand type and determine a weight value.
void LowerAsmOperandForConstraint(SDValue Op, StringRef Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const override
Lower the specified operand into the Ops vector.
SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
This method will be invoked for all target nodes and for any target-independent nodes that the target...
std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const override
Given a physical register constraint (e.g.
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
This callback is invoked for operations that are unsupported by the target, which are registered to u...
bool isConstantInSmallSection(const DataLayout &DL, const Constant *CN) const
Return true if this constant should be placed into small data section.
static auto integer_valuetypes()
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
LLVM_ABI int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool IsImmutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
LLVM_ABI int CreateStackObject(uint64_t Size, Align 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.
void setFrameAddressIsTaken(bool T)
void setReturnAddressIsTaken(bool s)
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Function & getFunction()
Return the LLVM function that this machine code represents.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Register addLiveIn(MCRegister PReg, const TargetRegisterClass *RC)
addLiveIn - Add the specified physical register as a live-in value and create a corresponding virtual...
LLVM_ABI Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
void addLiveIn(MCRegister Reg, Register vreg=Register())
addLiveIn - Add the specified register as a live-in.
Wrapper class representing virtual and physical registers.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
bool hasOneUse() const
Return true if there is exactly one use of this node.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getValue(unsigned R) const
EVT getValueType() const
Return the ValueType of the referenced return value.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned TargetFlags=0)
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, Register Reg, SDValue N)
LLVM_ABI SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
LLVM_ABI SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
LLVM_ABI SDValue getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget=false, bool IsOpaque=false)
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond, SDValue Chain=SDValue(), bool IsSignaling=false)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
LLVM_ABI SDValue getRegister(Register Reg, EVT VT)
LLVM_ABI SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, MaybeAlign Alignment=MaybeAlign(), 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,...
LLVM_ABI SDValue getMemcpy(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size, Align Alignment, bool isVol, bool AlwaysInline, const CallInst *CI, std::optional< bool > OverrideTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo, const AAMDNodes &AAInfo=AAMDNodes(), BatchAAResults *BatchAA=nullptr)
SDValue getTargetJumpTable(int JTI, EVT VT, unsigned TargetFlags=0)
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).
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, Register Reg, EVT VT)
SDValue getSelect(const SDLoc &DL, EVT VT, SDValue Cond, SDValue LHS, SDValue RHS, SDNodeFlags Flags=SDNodeFlags())
Helper function to make it easier to build Select's if you just have operands and don't want to check...
const DataLayout & getDataLayout() const
LLVM_ABI SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
LLVM_ABI SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, Align Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
SDValue getCALLSEQ_START(SDValue Chain, uint64_t InSize, uint64_t OutSize, const SDLoc &DL)
Return a new CALLSEQ_START node, that starts new call frame, in which InSize bytes are set up inside ...
LLVM_ABI SDValue getBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, bool isTarget=false, unsigned TargetFlags=0)
LLVM_ABI SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
LLVM_ABI SDValue getValueType(EVT)
LLVM_ABI SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
MachineFunction & getMachineFunction() const
LLVM_ABI SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
LLVM_ABI KnownBits computeKnownBits(SDValue Op, unsigned Depth=0) const
Determine which bits of Op are known to be either zero or one and return them in Known.
LLVM_ABI SDValue getRegisterMask(const uint32_t *RegMask)
LLVMContext * getContext() const
LLVM_ABI SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned TargetFlags=0)
SDValue getTargetConstantPool(const Constant *C, EVT VT, MaybeAlign Align=std::nullopt, int Offset=0, unsigned TargetFlags=0)
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
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...
unsigned MaxStoresPerMemcpyOptSize
Likewise for functions with the OptSize attribute.
virtual const TargetRegisterClass * getRegClassFor(MVT VT, bool isDivergent=false) const
Return the register class that should be used for the specified value type.
const TargetMachine & getTargetMachine() const
void setMaxAtomicSizeInBitsSupported(unsigned SizeInBits)
Set the maximum atomic operation size supported by the backend.
Register getStackPointerRegisterToSaveRestore() const
If a physical register, this specifies the register that llvm.savestack/llvm.restorestack should save...
void setMinFunctionAlignment(Align Alignment)
Set the target's minimum function alignment.
unsigned MaxStoresPerMemsetOptSize
Likewise for functions with the OptSize attribute.
void setBooleanContents(BooleanContent Ty)
Specify how the target extends the result of integer and floating point boolean values from i1 to a w...
unsigned MaxStoresPerMemmove
Specify maximum number of store instructions per memmove call.
void computeRegisterProperties(const TargetRegisterInfo *TRI)
Once all of the register classes are added, this allows us to compute derived properties we expose.
unsigned MaxStoresPerMemmoveOptSize
Likewise for functions with the OptSize attribute.
void addRegisterClass(MVT VT, const TargetRegisterClass *RC)
Add the specified register class as an available regclass for the specified value type.
virtual 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 setPrefFunctionAlignment(Align Alignment)
Set the target's preferred function alignment.
unsigned MaxStoresPerMemset
Specify maximum number of store instructions per memset call.
void setMinimumJumpTableEntries(unsigned Val)
Indicate the minimum number of blocks to generate jump tables.
@ ZeroOrOneBooleanContent
void setStackPointerRegisterToSaveRestore(Register R)
If set to a physical register, this specifies the register that llvm.savestack/llvm....
void setTargetDAGCombine(ArrayRef< ISD::NodeType > NTs)
Targets should invoke this method for each target independent node that they want to provide a custom...
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...
unsigned MaxStoresPerMemcpy
Specify maximum number of store instructions per memcpy call.
void setJumpIsExpensive(bool isExpensive=true)
Tells the code generator not to expand logic operations on comparison predicates into separate sequen...
virtual ConstraintWeight getSingleConstraintMatchWeight(AsmOperandInfo &info, const char *constraint) const
Examine constraint string and operand type and determine a weight value.
virtual std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const
Given a physical register constraint (e.g.
TargetLowering(const TargetLowering &)=delete
virtual void LowerAsmOperandForConstraint(SDValue Op, StringRef Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const
Lower the specified operand into the Ops vector.
Primary interface to the complete machine description for the target machine.
virtual TargetLoweringObjectFile * getObjFileLowering() const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ Fast
Attempts to make calls as fast as possible (e.g.
@ C
The default llvm calling convention, compatible with C.
@ SETCC
SetCC operator - This evaluates to a true value iff the condition is true.
@ SMUL_LOHI
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
@ BSWAP
Byte Swap and Counting operators.
@ ADD
Simple integer binary arithmetic operators.
@ ANY_EXTEND
ANY_EXTEND - Used for integer types. The high bits are undefined.
@ SDIVREM
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
@ SIGN_EXTEND
Conversion operators.
@ SELECT
Select(COND, TRUEVAL, FALSEVAL).
@ MULHU
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
@ SHL
Shift and rotation operations.
@ ZERO_EXTEND
ZERO_EXTEND - Used for integer types, zeroing the new bits.
@ SELECT_CC
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
@ SIGN_EXTEND_INREG
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
@ FRAMEADDR
FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and llvm.returnaddress on the DAG.
@ AND
Bitwise operators - logical and, logical or, logical xor.
@ TokenFactor
TokenFactor - This node takes multiple tokens as input and produces a single token result.
@ TRUNCATE
TRUNCATE - Completely drop the high bits.
@ SHL_PARTS
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations.
@ AssertSext
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out,...
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
LLVM_ABI bool isNullConstant(SDValue V)
Returns true if V is a constant integer zero.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
@ Sub
Subtraction of integers.
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
constexpr unsigned BitWidth
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI bool isAllOnesConstant(SDValue V)
Returns true if V is an integer constant with all bits set.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
This struct is a compact representation of a valid (non-zero power of two) alignment.
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
unsigned getBitWidth() const
Get the bit width of this value.
KnownBits intersectWith(const KnownBits &RHS) const
Returns KnownBits information that is known to be true for both this and RHS.
This class contains a discriminated union of information about pointers in memory operands,...
static LLVM_ABI MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
This contains information for each constraint that we are lowering.
This structure contains all information that is necessary for lowering calls.
SmallVector< ISD::InputArg, 32 > Ins
SmallVector< ISD::OutputArg, 32 > Outs
SmallVector< SDValue, 32 > OutVals