LLVM 20.0.0git |
This class defines information used to lower LLVM code to legalSelectionDAG operators that the target instruction selector can accept natively.More...
#include "llvm/CodeGen/TargetLowering.h"
Classes | |
struct | AsmOperandInfo |
This contains information for each constraint that we are lowering.More... | |
struct | CallLoweringInfo |
This structure contains all information that is necessary for lowering calls.More... | |
struct | DAGCombinerInfo |
struct | MakeLibCallOptions |
This structure is used to pass arguments to makeLibCall function.More... | |
struct | PtrAuthInfo |
This structure contains the information necessary for lowering pointer-authenticating indirect calls.More... | |
struct | TargetLoweringOpt |
A convenience struct that encapsulates a DAG, and two SDValues for returning information fromTargetLowering to its clients that want to combine.More... | |
Public Types | |
enum | ConstraintType { C_Register,C_RegisterClass,C_Memory,C_Address, C_Immediate,C_Other,C_Unknown } |
enum | ConstraintWeight { CW_Invalid = -1,CW_Okay = 0,CW_Good = 1,CW_Better = 2, CW_Best = 3,CW_SpecificReg = CW_Okay,CW_Register = CW_Good,CW_Memory = CW_Better, CW_Constant = CW_Best,CW_Default = CW_Okay } |
using | AsmOperandInfoVector = std::vector<AsmOperandInfo > |
using | ConstraintPair = std::pair<StringRef,TargetLowering::ConstraintType > |
using | ConstraintGroup =SmallVector<ConstraintPair > |
![]() | |
enum | LegalizeAction : uint8_t { Legal,Promote,Expand,LibCall, Custom } |
This enum indicates whether operations are valid for a target, and if not, what action should be used to make them valid.More... | |
enum | LegalizeTypeAction : uint8_t { TypeLegal,TypePromoteInteger,TypeExpandInteger,TypeSoftenFloat, TypeExpandFloat,TypeScalarizeVector,TypeSplitVector,TypeWidenVector, TypePromoteFloat,TypeSoftPromoteHalf,TypeScalarizeScalableVector } |
This enum indicates whether a types are legal for a target, and if not, what action should be used to make them valid.More... | |
enum | BooleanContent {UndefinedBooleanContent,ZeroOrOneBooleanContent,ZeroOrNegativeOneBooleanContent } |
Enum that describes how the target represents true/false values.More... | |
enum | SelectSupportKind {ScalarValSelect,ScalarCondVectorVal,VectorMaskSelect } |
Enum that describes what type of support for selects the target has.More... | |
enum class | AtomicExpansionKind { None,CastToInteger,LLSC,LLOnly, CmpXChg,MaskedIntrinsic,BitTestIntrinsic,CmpArithIntrinsic, Expand,NotAtomic } |
Enum that specifies what an atomic load/AtomicRMWInst is expanded to, if at all.More... | |
enum class | MulExpansionKind {Always,OnlyLegalOrCustom } |
Enum that specifies when a multiplication should be expanded.More... | |
enum class | NegatibleCost {Cheaper = 0,Neutral = 1,Expensive = 2 } |
Enum that specifies when a float negation is beneficial.More... | |
enum | AndOrSETCCFoldKind : uint8_t {None = 0,AddAnd = 1,NotAnd = 2,ABS = 4 } |
Enum of different potentially desirable ways to fold (and/or (setcc ...), (setcc ...)).More... | |
enum | ReciprocalEstimate : int {Unspecified = -1,Disabled = 0,Enabled = 1 } |
Reciprocal estimate status values used by the functions below.More... | |
enum class | ShiftLegalizationStrategy {ExpandToParts,ExpandThroughStack,LowerToLibcall } |
Return the preferred strategy to legalize tihs SHIFT instruction, withExpansionFactor being the recursion depth - how many expansion needed.More... | |
using | LegalizeKind = std::pair<LegalizeTypeAction,EVT > |
LegalizeKind holds the legalization kind that needs to happen toEVT in order to type-legalize it. | |
using | ArgListTy = std::vector<ArgListEntry > |
Public Member Functions | |
TargetLowering (constTargetLowering &)=delete | |
TargetLowering & | operator= (constTargetLowering &)=delete |
TargetLowering (constTargetMachine &TM) | |
NOTE: TheTargetMachine owns TLOF. | |
bool | isPositionIndependent ()const |
virtualbool | isSDNodeSourceOfDivergence (constSDNode *N,FunctionLoweringInfo *FLI,UniformityInfo *UA)const |
virtualbool | isReassocProfitable (SelectionDAG &DAG,SDValue N0,SDValue N1)const |
virtualbool | isReassocProfitable (MachineRegisterInfo &MRI,Register N0,Register N1)const |
virtualbool | isSDNodeAlwaysUniform (constSDNode *N)const |
virtualbool | getPreIndexedAddressParts (SDNode *,SDValue &,SDValue &,ISD::MemIndexedMode &,SelectionDAG &)const |
Returns true by value, base pointer and offset pointer and addressing mode by reference if the node's address can be legally represented as pre-indexed load / store address. | |
virtualbool | getPostIndexedAddressParts (SDNode *,SDNode *,SDValue &,SDValue &,ISD::MemIndexedMode &,SelectionDAG &)const |
Returns true by value, base pointer and offset pointer and addressing mode by reference if this node can be combined with a load / store to form a post-indexed load / store. | |
virtualbool | isIndexingLegal (MachineInstr &MI,RegisterBase,RegisterOffset,bool IsPre,MachineRegisterInfo &MRI)const |
Returns true if the specified base+offset is a legal indexed addressing mode for this target. | |
virtualunsigned | getJumpTableEncoding ()const |
Return the entry encoding for a jump table in the current function. | |
virtualMVT | getJumpTableRegTy (constDataLayout &DL)const |
virtualconstMCExpr * | LowerCustomJumpTableEntry (constMachineJumpTableInfo *,constMachineBasicBlock *,unsigned,MCContext &)const |
virtualSDValue | getPICJumpTableRelocBase (SDValue Table,SelectionDAG &DAG)const |
Returns relocation base for the given PIC jumptable. | |
virtualconstMCExpr * | getPICJumpTableRelocBaseExpr (constMachineFunction *MF,unsigned JTI,MCContext &Ctx)const |
This returns the relocation base for the given PIC jumptable, the same as getPICJumpTableRelocBase, but as anMCExpr. | |
virtualbool | isOffsetFoldingLegal (constGlobalAddressSDNode *GA)const |
Return true if folding a constant offset with the given GlobalAddress is legal. | |
virtualbool | isInlineAsmTargetBranch (constSmallVectorImpl<StringRef > &AsmStrs,unsigned OpNo)const |
On x86, return true if the operand with index OpNo is a CALL or JUMP instruction, which can use either a memory constraint or an address constraint. | |
bool | isInTailCallPosition (SelectionDAG &DAG,SDNode *Node,SDValue &Chain)const |
Check whether a given call node is in tail position within its function. | |
void | softenSetCCOperands (SelectionDAG &DAG,EVT VT,SDValue &NewLHS,SDValue &NewRHS,ISD::CondCode &CCCode,constSDLoc &DL,constSDValue OldLHS,constSDValue OldRHS)const |
Soften the operands of a comparison. | |
void | softenSetCCOperands (SelectionDAG &DAG,EVT VT,SDValue &NewLHS,SDValue &NewRHS,ISD::CondCode &CCCode,constSDLoc &DL,constSDValue OldLHS,constSDValue OldRHS,SDValue &Chain,bool IsSignaling=false)const |
virtualSDValue | visitMaskedLoad (SelectionDAG &DAG,constSDLoc &DL,SDValue Chain,MachineMemOperand *MMO,SDValue &NewLoad,SDValuePtr,SDValue PassThru,SDValue Mask)const |
virtualSDValue | visitMaskedStore (SelectionDAG &DAG,constSDLoc &DL,SDValue Chain,MachineMemOperand *MMO,SDValuePtr,SDValue Val,SDValue Mask)const |
std::pair<SDValue,SDValue > | makeLibCall (SelectionDAG &DAG,RTLIB::Libcall LC,EVT RetVT,ArrayRef<SDValue > Ops,MakeLibCallOptions CallOptions,constSDLoc &dl,SDValue Chain=SDValue())const |
Returns a pair of (return value, chain). | |
bool | parametersInCSRMatch (constMachineRegisterInfo &MRI,constuint32_t *CallerPreservedMask,constSmallVectorImpl<CCValAssign > &ArgLocs,constSmallVectorImpl<SDValue > &OutVals)const |
Check whether parameters to a call that are passed in callee saved registers are the same as from the calling function. | |
virtualbool | findOptimalMemOpLowering (std::vector<EVT > &MemOps,unsigned Limit,constMemOp &Op,unsigned DstAS,unsigned SrcAS,constAttributeList &FuncAttributes)const |
Determines the optimal series of memory ops to replace the memset / memcpy. | |
bool | ShrinkDemandedConstant (SDValueOp,constAPInt &DemandedBits,constAPInt &DemandedElts,TargetLoweringOpt &TLO)const |
Check to see if the specified operand of the specified instruction is a constant integer. | |
bool | ShrinkDemandedConstant (SDValueOp,constAPInt &DemandedBits,TargetLoweringOpt &TLO)const |
Helper wrapper around ShrinkDemandedConstant, demanding all elements. | |
virtualbool | targetShrinkDemandedConstant (SDValueOp,constAPInt &DemandedBits,constAPInt &DemandedElts,TargetLoweringOpt &TLO)const |
bool | ShrinkDemandedOp (SDValueOp,unsignedBitWidth,constAPInt &DemandedBits,TargetLoweringOpt &TLO)const |
Convert x+y to (VT)((SmallVT)x+(SmallVT)y) if the casts are free. | |
bool | SimplifyDemandedBits (SDValueOp,constAPInt &DemandedBits,constAPInt &DemandedElts,KnownBits &Known,TargetLoweringOpt &TLO,unsignedDepth=0,bool AssumeSingleUse=false)const |
Look at Op. | |
bool | SimplifyDemandedBits (SDValueOp,constAPInt &DemandedBits,KnownBits &Known,TargetLoweringOpt &TLO,unsignedDepth=0,bool AssumeSingleUse=false)const |
Helper wrapper around SimplifyDemandedBits, demanding all elements. | |
bool | SimplifyDemandedBits (SDValueOp,constAPInt &DemandedBits,DAGCombinerInfo &DCI)const |
Helper wrapper around SimplifyDemandedBits. | |
bool | SimplifyDemandedBits (SDValueOp,constAPInt &DemandedBits,constAPInt &DemandedElts,DAGCombinerInfo &DCI)const |
Helper wrapper around SimplifyDemandedBits. | |
SDValue | SimplifyMultipleUseDemandedBits (SDValueOp,constAPInt &DemandedBits,constAPInt &DemandedElts,SelectionDAG &DAG,unsignedDepth=0)const |
More limited version of SimplifyDemandedBits that can be used to "lookthrough" ops that don't contribute to the DemandedBits/DemandedElts - bitwise ops etc. | |
SDValue | SimplifyMultipleUseDemandedBits (SDValueOp,constAPInt &DemandedBits,SelectionDAG &DAG,unsignedDepth=0)const |
Helper wrapper around SimplifyMultipleUseDemandedBits, demanding all elements. | |
SDValue | SimplifyMultipleUseDemandedVectorElts (SDValueOp,constAPInt &DemandedElts,SelectionDAG &DAG,unsignedDepth=0)const |
Helper wrapper around SimplifyMultipleUseDemandedBits, demanding all bits from only some vector elements. | |
bool | SimplifyDemandedVectorElts (SDValueOp,constAPInt &DemandedEltMask,APInt &KnownUndef,APInt &KnownZero,TargetLoweringOpt &TLO,unsignedDepth=0,bool AssumeSingleUse=false)const |
Look at Vector Op. | |
bool | SimplifyDemandedVectorElts (SDValueOp,constAPInt &DemandedElts,DAGCombinerInfo &DCI)const |
Helper wrapper around SimplifyDemandedVectorElts. | |
virtualbool | shouldSimplifyDemandedVectorElts (SDValueOp,constTargetLoweringOpt &TLO)const |
Return true if the target supports simplifying demanded vector elements by converting them to undefs. | |
virtual void | computeKnownBitsForTargetNode (constSDValueOp,KnownBits &Known,constAPInt &DemandedElts,constSelectionDAG &DAG,unsignedDepth=0)const |
Determine which of the bits specified in Mask are known to be either zero or one and return them in the KnownZero/KnownOne bitsets. | |
virtual void | computeKnownBitsForTargetInstr (GISelKnownBits &Analysis,Register R,KnownBits &Known,constAPInt &DemandedElts,constMachineRegisterInfo &MRI,unsignedDepth=0)const |
Determine which of the bits specified in Mask are known to be either zero or one and return them in the KnownZero/KnownOne bitsets. | |
virtualAlign | computeKnownAlignForTargetInstr (GISelKnownBits &Analysis,Register R,constMachineRegisterInfo &MRI,unsignedDepth=0)const |
Determine the known alignment for the pointer valueR . | |
virtual void | computeKnownBitsForFrameIndex (int FIOp,KnownBits &Known,constMachineFunction &MF)const |
Determine which of the bits of FrameIndexFIOp are known to be 0. | |
virtualunsigned | ComputeNumSignBitsForTargetNode (SDValueOp,constAPInt &DemandedElts,constSelectionDAG &DAG,unsignedDepth=0)const |
This method can be implemented by targets that want to expose additional information about sign bits to the DAGCombiner. | |
virtualunsigned | computeNumSignBitsForTargetInstr (GISelKnownBits &Analysis,Register R,constAPInt &DemandedElts,constMachineRegisterInfo &MRI,unsignedDepth=0)const |
This method can be implemented by targets that want to expose additional information about sign bits to GlobalISel combiners. | |
virtualbool | SimplifyDemandedVectorEltsForTargetNode (SDValueOp,constAPInt &DemandedElts,APInt &KnownUndef,APInt &KnownZero,TargetLoweringOpt &TLO,unsignedDepth=0)const |
Attempt to simplify any target nodes based on the demanded vector elements, returning true on success. | |
virtualbool | SimplifyDemandedBitsForTargetNode (SDValueOp,constAPInt &DemandedBits,constAPInt &DemandedElts,KnownBits &Known,TargetLoweringOpt &TLO,unsignedDepth=0)const |
Attempt to simplify any target nodes based on the demanded bits/elts, returning true on success. | |
virtualSDValue | SimplifyMultipleUseDemandedBitsForTargetNode (SDValueOp,constAPInt &DemandedBits,constAPInt &DemandedElts,SelectionDAG &DAG,unsignedDepth)const |
More limited version of SimplifyDemandedBits that can be used to "lookthrough" ops that don't contribute to the DemandedBits/DemandedElts - bitwise ops etc. | |
virtualbool | isGuaranteedNotToBeUndefOrPoisonForTargetNode (SDValueOp,constAPInt &DemandedElts,constSelectionDAG &DAG,boolPoisonOnly,unsignedDepth)const |
Return true if this function can prove thatOp is never poison and, ifPoisonOnly is false, does not have undef bits. | |
virtualbool | canCreateUndefOrPoisonForTargetNode (SDValueOp,constAPInt &DemandedElts,constSelectionDAG &DAG,boolPoisonOnly,bool ConsiderFlags,unsignedDepth)const |
Return true if Op can create undef or poison from non-undef & non-poison operands. | |
SDValue | buildLegalVectorShuffle (EVT VT,constSDLoc &DL,SDValue N0,SDValue N1,MutableArrayRef< int > Mask,SelectionDAG &DAG)const |
Tries to build a legal vector shuffle using the provided parameters or equivalent variations. | |
virtualconstConstant * | getTargetConstantFromLoad (LoadSDNode *LD)const |
This method returns the constant pool value that will be loaded by LD. | |
virtualbool | isKnownNeverNaNForTargetNode (SDValueOp,constSelectionDAG &DAG,bool SNaN=false,unsignedDepth=0)const |
IfSNaN is false,. | |
virtualbool | isSplatValueForTargetNode (SDValueOp,constAPInt &DemandedElts,APInt &UndefElts,constSelectionDAG &DAG,unsignedDepth=0)const |
Return true if vectorOp has the same value across allDemandedElts , indicating any elements which may be undef in the outputUndefElts . | |
virtualbool | isTargetCanonicalConstantNode (SDValueOp)const |
Returns true if the given Opc is considered a canonical constant for the target, which should not be transformed back into a BUILD_VECTOR. | |
bool | isConstTrueVal (SDValueN)const |
Return if the N is a constant or constant vector equal to the true value fromgetBooleanContents(). | |
bool | isConstFalseVal (SDValueN)const |
Return if the N is a constant or constant vector equal to the false value fromgetBooleanContents(). | |
bool | isExtendedTrueVal (constConstantSDNode *N,EVT VT,bool SExt)const |
Return ifN is a True value when extended toVT . | |
SDValue | SimplifySetCC (EVT VT,SDValue N0,SDValue N1,ISD::CondCodeCond,bool foldBooleans,DAGCombinerInfo &DCI,constSDLoc &dl)const |
Try to simplify a setcc built with the specified operands and cc. | |
virtualSDValue | unwrapAddress (SDValueN)const |
virtualbool | isGAPlusOffset (SDNode *N,constGlobalValue *&GA, int64_t &Offset)const |
Returns true (and theGlobalValue and the offset) if the node is a GlobalAddress + offset. | |
virtualSDValue | PerformDAGCombine (SDNode *N,DAGCombinerInfo &DCI)const |
This method will be invoked for all target nodes and for any target-independent nodes that the target has registered with invoke it for. | |
virtualbool | isDesirableToCommuteWithShift (constSDNode *N,CombineLevel Level)const |
Return true if it is profitable to move this shift by a constant amount through its operand, adjusting any immediate operands as necessary to preserve semantics. | |
virtualbool | isDesirableToCommuteWithShift (constMachineInstr &MI,bool IsAfterLegal)const |
GlobalISel - return true if it is profitable to move this shift by a constant amount through its operand, adjusting any immediate operands as necessary to preserve semantics. | |
virtualbool | isDesirableToPullExtFromShl (constMachineInstr &MI)const |
GlobalISel - return true if it's profitable to perform the combine: shl ([sza]ext x), y => zext (shl x, y) | |
virtualAndOrSETCCFoldKind | isDesirableToCombineLogicOpOfSETCC (constSDNode *LogicOp,constSDNode *SETCC0,constSDNode *SETCC1)const |
virtualbool | isDesirableToCommuteXorWithShift (constSDNode *N)const |
Return true if it is profitable to combine an XOR of a logical shift to create a logical shift of NOT. | |
virtualbool | isTypeDesirableForOp (unsigned,EVT VT)const |
Return true if the target has native support for the specified value type and it is 'desirable' to use the type for the given node type. | |
virtualbool | isDesirableToTransformToIntegerOp (unsigned,EVT)const |
Return true if it is profitable for dag combiner to transform a floating point op of specified opcode to a equivalent op of an integer type. | |
virtualbool | IsDesirableToPromoteOp (SDValue,EVT &)const |
This method query the target whether it is beneficial for dag combiner to promote the specified node. | |
virtualbool | supportSwiftError ()const |
Return true if the target supports swifterror attribute. | |
virtualbool | supportSplitCSR (MachineFunction *MF)const |
Return true if the target supports that a subset of CSRs for the given machine function is handled explicitly via copies. | |
virtualbool | supportKCFIBundles ()const |
Return true if the target supports kcfi operand bundles. | |
virtualbool | supportPtrAuthBundles ()const |
Return true if the target supports ptrauth operand bundles. | |
virtual void | initializeSplitCSR (MachineBasicBlock *Entry)const |
Perform necessary initialization to handle a subset of CSRs explicitly via copies. | |
virtual void | insertCopiesSplitCSR (MachineBasicBlock *Entry,constSmallVectorImpl<MachineBasicBlock * > &Exits)const |
Insert explicit copies in entry and exit blocks. | |
virtualSDValue | getNegatedExpression (SDValueOp,SelectionDAG &DAG,bool LegalOps,bool OptForSize,NegatibleCost &Cost,unsignedDepth=0)const |
Return the newly negated expression if the cost is not expensive and set the cost inCost to indicate that if it is cheaper or neutral to do the negation. | |
SDValue | getCheaperOrNeutralNegatedExpression (SDValueOp,SelectionDAG &DAG,bool LegalOps,bool OptForSize,constNegatibleCostCostThreshold=NegatibleCost::Neutral,unsignedDepth=0)const |
SDValue | getCheaperNegatedExpression (SDValueOp,SelectionDAG &DAG,bool LegalOps,bool OptForSize,unsignedDepth=0)const |
This is the helper function to return the newly negated expression only when the cost is cheaper. | |
SDValue | getNegatedExpression (SDValueOp,SelectionDAG &DAG,bool LegalOps,bool OptForSize,unsignedDepth=0)const |
This is the helper function to return the newly negated expression if the cost is not expensive. | |
virtualbool | splitValueIntoRegisterParts (SelectionDAG &DAG,constSDLoc &DL,SDValue Val,SDValue *Parts,unsigned NumParts,MVT PartVT, std::optional<CallingConv::ID >CC)const |
Target-specific splitting of values into parts that fit a register storing a legal type. | |
virtualbool | checkForPhysRegDependency (SDNode *Def,SDNode *User,unsignedOp,constTargetRegisterInfo *TRI,constTargetInstrInfo *TII,unsigned &PhysReg, int &Cost)const |
Allows the target to handle physreg-carried dependency in target-specific way. | |
virtualSDValue | joinRegisterPartsIntoValue (SelectionDAG &DAG,constSDLoc &DL,constSDValue *Parts,unsigned NumParts,MVT PartVT,EVT ValueVT, std::optional<CallingConv::ID >CC)const |
Target-specific combining of register parts into its original value. | |
virtualSDValue | LowerFormalArguments (SDValue,CallingConv::ID,bool,constSmallVectorImpl<ISD::InputArg > &,constSDLoc &,SelectionDAG &,SmallVectorImpl<SDValue > &)const |
This hook must be implemented to lower the incoming (formal) arguments, described by the Ins array, into the specified DAG. | |
std::pair<SDValue,SDValue > | LowerCallTo (CallLoweringInfo &CLI)const |
This function lowers an abstract call to a function into an actual call. | |
virtualSDValue | LowerCall (CallLoweringInfo &,SmallVectorImpl<SDValue > &)const |
This hook must be implemented to lower calls into the specified DAG. | |
virtual void | HandleByVal (CCState *,unsigned &,Align)const |
Target-specific cleanup for formal ByVal parameters. | |
virtualbool | CanLowerReturn (CallingConv::ID,MachineFunction &,bool,constSmallVectorImpl<ISD::OutputArg > &,LLVMContext &,constType *RetTy)const |
This hook should be implemented to check whether the return values described by the Outs array can fit into the return registers. | |
virtualSDValue | LowerReturn (SDValue,CallingConv::ID,bool,constSmallVectorImpl<ISD::OutputArg > &,constSmallVectorImpl<SDValue > &,constSDLoc &,SelectionDAG &)const |
This hook must be implemented to lower outgoing return values, described by the Outs array, into the specified DAG. | |
virtualbool | isUsedByReturnOnly (SDNode *,SDValue &)const |
Return true if result of the specified node is used by a return node only. | |
virtualbool | mayBeEmittedAsTailCall (constCallInst *)const |
Return true if the target may be able emit the call instruction as a tail call. | |
virtualRegister | getRegisterByName (constchar *RegName,LLT Ty,constMachineFunction &MF)const |
Return the register ID of the name passed in. | |
virtualEVT | getTypeForExtReturn (LLVMContext &Context,EVT VT,ISD::NodeType)const |
Return the type that should be used to zero or sign extend a zeroext/signext integer return value. | |
virtualbool | functionArgumentNeedsConsecutiveRegisters (Type *Ty,CallingConv::ID CallConv,bool isVarArg,constDataLayout &DL)const |
For some targets, an LLVM struct type must be broken down into multiple simple types, but the calling convention specifies that the entire struct must be passed in a block of consecutive registers. | |
virtualbool | shouldSplitFunctionArgumentsAsLittleEndian (constDataLayout &DL)const |
For most targets, an LLVM type must be broken down into multiple smaller types. | |
virtualconstMCPhysReg * | getScratchRegisters (CallingConv::IDCC)const |
Returns a 0 terminated array of registers that can be safely used as scratch registers. | |
virtualArrayRef<MCPhysReg > | getRoundingControlRegisters ()const |
Returns a 0 terminated array of rounding control registers that can be attached into strict FP call. | |
virtualSDValue | prepareVolatileOrAtomicLoad (SDValue Chain,constSDLoc &DL,SelectionDAG &DAG)const |
This callback is used to prepare for a volatile or atomic load. | |
virtual void | LowerOperationWrapper (SDNode *N,SmallVectorImpl<SDValue > &Results,SelectionDAG &DAG)const |
This callback is invoked by the type legalizer to legalize nodes with an illegal operand type but legal result types. | |
virtualSDValue | LowerOperation (SDValueOp,SelectionDAG &DAG)const |
This callback is invoked for operations that are unsupported by the target, which are registered to use 'custom' lowering, and whose defined values are all legal. | |
virtual void | ReplaceNodeResults (SDNode *,SmallVectorImpl<SDValue > &,SelectionDAG &)const |
This callback is invoked when a node result type is illegal for the target, and the operation was registered to use 'custom' lowering for that result type. | |
virtualconstchar * | getTargetNodeName (unsigned Opcode)const |
This method returns the name of a target specific DAG node. | |
virtualFastISel * | createFastISel (FunctionLoweringInfo &,constTargetLibraryInfo *)const |
This method returns a target specificFastISel object, or null if the target does not support "fast" ISel. | |
bool | verifyReturnAddressArgumentIsConstant (SDValueOp,SelectionDAG &DAG)const |
virtual void | verifyTargetSDNode (constSDNode *N)const |
Check the givenSDNode. Aborts if it is invalid. | |
virtualbool | ExpandInlineAsm (CallInst *)const |
This hook allows the target to expand an inline asm call to be explicit llvm code if it wants to. | |
virtualAsmOperandInfoVector | ParseConstraints (constDataLayout &DL,constTargetRegisterInfo *TRI,constCallBase &Call)const |
Split up the constraint string from the inline assembly value into the specific constraints and their prefixes, and also tie in the associated operand values. | |
virtualConstraintWeight | getMultipleConstraintMatchWeight (AsmOperandInfo &info, int maIndex)const |
Examine constraint type and operand type and determine a weight value. | |
virtualConstraintWeight | getSingleConstraintMatchWeight (AsmOperandInfo &info,constchar *constraint)const |
Examine constraint string and operand type and determine a weight value. | |
virtual void | ComputeConstraintToUse (AsmOperandInfo &OpInfo,SDValueOp,SelectionDAG *DAG=nullptr)const |
Determines the constraint code and constraint type to use for the specificAsmOperandInfo, setting OpInfo.ConstraintCode and OpInfo.ConstraintType. | |
virtualConstraintType | getConstraintType (StringRef Constraint)const |
Given a constraint, return the type of constraint it is for this target. | |
ConstraintGroup | getConstraintPreferences (AsmOperandInfo &OpInfo)const |
Given an OpInfo with list of constraints codes as strings, return a sorted Vector of pairs of constraint codes and their types in priority of what we'd prefer to lower them as. | |
virtual std::pair<unsigned,constTargetRegisterClass * > | getRegForInlineAsmConstraint (constTargetRegisterInfo *TRI,StringRef Constraint,MVT VT)const |
Given a physical register constraint (e.g. | |
virtualInlineAsm::ConstraintCode | getInlineAsmMemConstraint (StringRef ConstraintCode)const |
virtualconstchar * | LowerXConstraint (EVT ConstraintVT)const |
Try to replace an X constraint, which matches anything, with another that has more specific requirements based on the type of the corresponding operand. | |
virtual void | LowerAsmOperandForConstraint (SDValueOp,StringRef Constraint, std::vector<SDValue > &Ops,SelectionDAG &DAG)const |
Lower the specified operand into the Ops vector. | |
virtualSDValue | LowerAsmOutputForConstraint (SDValue &Chain,SDValue &Glue,constSDLoc &DL,constAsmOperandInfo &OpInfo,SelectionDAG &DAG)const |
virtual void | CollectTargetIntrinsicOperands (constCallInst &I,SmallVectorImpl<SDValue > &Ops,SelectionDAG &DAG)const |
SDValue | BuildSDIV (SDNode *N,SelectionDAG &DAG,bool IsAfterLegalization,bool IsAfterLegalTypes,SmallVectorImpl<SDNode * > &Created)const |
Given anISD::SDIV node expressing a divide by constant, return a DAG expression to select that will generate the same value by multiplying by a magic number. | |
SDValue | BuildUDIV (SDNode *N,SelectionDAG &DAG,bool IsAfterLegalization,bool IsAfterLegalTypes,SmallVectorImpl<SDNode * > &Created)const |
Given anISD::UDIV node expressing a divide by constant, return a DAG expression to select that will generate the same value by multiplying by a magic number. | |
SDValue | buildSDIVPow2WithCMov (SDNode *N,constAPInt &Divisor,SelectionDAG &DAG,SmallVectorImpl<SDNode * > &Created)const |
Build sdiv by power-of-2 with conditional move instructions Ref: "Hacker's Delight" by Henry Warren 10-1 If conditional move/branch is preferred, we lower sdiv x, +/-2**k into: bgez x, label add x, x, 2**k-1 label: sra res, x, k neg res, res (when the divisor is negative) | |
virtualSDValue | BuildSDIVPow2 (SDNode *N,constAPInt &Divisor,SelectionDAG &DAG,SmallVectorImpl<SDNode * > &Created)const |
Targets may override this function to provide custom SDIV lowering for power-of-2 denominators. | |
virtualSDValue | BuildSREMPow2 (SDNode *N,constAPInt &Divisor,SelectionDAG &DAG,SmallVectorImpl<SDNode * > &Created)const |
Targets may override this function to provide custom SREM lowering for power-of-2 denominators. | |
virtualunsigned | combineRepeatedFPDivisors ()const |
Indicate whether this target prefers to combine FDIVs with the same divisor. | |
virtualSDValue | getSqrtEstimate (SDValue Operand,SelectionDAG &DAG, intEnabled, int &RefinementSteps,bool &UseOneConstNR,bool Reciprocal)const |
Hooks for building estimates in place of slower divisions and square roots. | |
SDValue | createSelectForFMINNUM_FMAXNUM (SDNode *Node,SelectionDAG &DAG)const |
Try to convert the fminnum/fmaxnum to a compare/select sequence. | |
virtualSDValue | getRecipEstimate (SDValue Operand,SelectionDAG &DAG, intEnabled, int &RefinementSteps)const |
Return a reciprocal estimate value for the input operand. | |
virtualSDValue | getSqrtInputTest (SDValue Operand,SelectionDAG &DAG,constDenormalMode &Mode)const |
Return a target-dependent comparison result if the input operand is suitable for use with a square root estimate calculation. | |
virtualSDValue | getSqrtResultForDenormInput (SDValue Operand,SelectionDAG &DAG)const |
Return a target-dependent result if the input operand is not suitable for use with a square root estimate calculation. | |
bool | expandMUL_LOHI (unsigned Opcode,EVT VT,constSDLoc &dl,SDValueLHS,SDValueRHS,SmallVectorImpl<SDValue > &Result,EVT HiLoVT,SelectionDAG &DAG,MulExpansionKind Kind,SDValue LL=SDValue(),SDValue LH=SDValue(),SDValue RL=SDValue(),SDValue RH=SDValue())const |
Expand a MUL or [US]MUL_LOHI of n-bit values into two or four nodes, respectively, each computing an n/2-bit part of the result. | |
bool | expandMUL (SDNode *N,SDValue &Lo,SDValue &Hi,EVT HiLoVT,SelectionDAG &DAG,MulExpansionKind Kind,SDValue LL=SDValue(),SDValue LH=SDValue(),SDValue RL=SDValue(),SDValue RH=SDValue())const |
Expand a MUL into two nodes. | |
bool | expandDIVREMByConstant (SDNode *N,SmallVectorImpl<SDValue > &Result,EVT HiLoVT,SelectionDAG &DAG,SDValue LL=SDValue(),SDValue LH=SDValue())const |
Attempt to expand an n-bit div/rem/divrem by constant using a n/2-bit urem by constant and other arithmetic ops. | |
SDValue | expandFunnelShift (SDNode *N,SelectionDAG &DAG)const |
Expand funnel shift. | |
SDValue | expandROT (SDNode *N,bool AllowVectorOps,SelectionDAG &DAG)const |
Expand rotations. | |
void | expandShiftParts (SDNode *N,SDValue &Lo,SDValue &Hi,SelectionDAG &DAG)const |
Expand shift-by-parts. | |
bool | expandFP_TO_SINT (SDNode *N,SDValue &Result,SelectionDAG &DAG)const |
Expand float(f32) to SINT(i64) conversion. | |
bool | expandFP_TO_UINT (SDNode *N,SDValue &Result,SDValue &Chain,SelectionDAG &DAG)const |
Expand float to UINT conversion. | |
bool | expandUINT_TO_FP (SDNode *N,SDValue &Result,SDValue &Chain,SelectionDAG &DAG)const |
Expand UINT(i64) to double(f64) conversion. | |
SDValue | expandFMINNUM_FMAXNUM (SDNode *N,SelectionDAG &DAG)const |
Expand fminnum/fmaxnum into fminnum_ieee/fmaxnum_ieee with quieted inputs. | |
SDValue | expandFMINIMUM_FMAXIMUM (SDNode *N,SelectionDAG &DAG)const |
Expand fminimum/fmaximum into multiple comparison with selects. | |
SDValue | expandFMINIMUMNUM_FMAXIMUMNUM (SDNode *N,SelectionDAG &DAG)const |
Expand fminimumnum/fmaximumnum into multiple comparison with selects. | |
SDValue | expandFP_TO_INT_SAT (SDNode *N,SelectionDAG &DAG)const |
Expand FP_TO_[US]INT_SAT into FP_TO_[US]INT and selects or min/max. | |
SDValue | expandRoundInexactToOdd (EVT ResultVT,SDValueOp,constSDLoc &DL,SelectionDAG &DAG)const |
Truncate Op to ResultVT. | |
SDValue | expandFP_ROUND (SDNode *Node,SelectionDAG &DAG)const |
Expand round(fp) to fp conversion. | |
SDValue | expandIS_FPCLASS (EVT ResultVT,SDValueOp,FPClassTestTest,SDNodeFlags Flags,constSDLoc &DL,SelectionDAG &DAG)const |
Expand check for floating point class. | |
SDValue | expandCTPOP (SDNode *N,SelectionDAG &DAG)const |
Expand CTPOP nodes. | |
SDValue | expandVPCTPOP (SDNode *N,SelectionDAG &DAG)const |
Expand VP_CTPOP nodes. | |
SDValue | expandCTLZ (SDNode *N,SelectionDAG &DAG)const |
Expand CTLZ/CTLZ_ZERO_UNDEF nodes. | |
SDValue | expandVPCTLZ (SDNode *N,SelectionDAG &DAG)const |
Expand VP_CTLZ/VP_CTLZ_ZERO_UNDEF nodes. | |
SDValue | CTTZTableLookup (SDNode *N,SelectionDAG &DAG,constSDLoc &DL,EVT VT,SDValueOp,unsigned NumBitsPerElt)const |
Expand CTTZ via Table Lookup. | |
SDValue | expandCTTZ (SDNode *N,SelectionDAG &DAG)const |
Expand CTTZ/CTTZ_ZERO_UNDEF nodes. | |
SDValue | expandVPCTTZ (SDNode *N,SelectionDAG &DAG)const |
Expand VP_CTTZ/VP_CTTZ_ZERO_UNDEF nodes. | |
SDValue | expandVPCTTZElements (SDNode *N,SelectionDAG &DAG)const |
Expand VP_CTTZ_ELTS/VP_CTTZ_ELTS_ZERO_UNDEF nodes. | |
SDValue | expandVectorFindLastActive (SDNode *N,SelectionDAG &DAG)const |
Expand VECTOR_FIND_LAST_ACTIVE nodes. | |
SDValue | expandABS (SDNode *N,SelectionDAG &DAG,bool IsNegative=false)const |
Expand ABS nodes. | |
SDValue | expandABD (SDNode *N,SelectionDAG &DAG)const |
Expand ABDS/ABDU nodes. | |
SDValue | expandAVG (SDNode *N,SelectionDAG &DAG)const |
Expand vector/scalar AVGCEILS/AVGCEILU/AVGFLOORS/AVGFLOORU nodes. | |
SDValue | expandBSWAP (SDNode *N,SelectionDAG &DAG)const |
Expand BSWAP nodes. | |
SDValue | expandVPBSWAP (SDNode *N,SelectionDAG &DAG)const |
Expand VP_BSWAP nodes. | |
SDValue | expandBITREVERSE (SDNode *N,SelectionDAG &DAG)const |
Expand BITREVERSE nodes. | |
SDValue | expandVPBITREVERSE (SDNode *N,SelectionDAG &DAG)const |
Expand VP_BITREVERSE nodes. | |
std::pair<SDValue,SDValue > | scalarizeVectorLoad (LoadSDNode *LD,SelectionDAG &DAG)const |
Turn load of vector type into a load of the individual elements. | |
SDValue | scalarizeVectorStore (StoreSDNode *ST,SelectionDAG &DAG)const |
std::pair<SDValue,SDValue > | expandUnalignedLoad (LoadSDNode *LD,SelectionDAG &DAG)const |
Expands an unaligned load to 2 half-size loads for an integer, and possibly more for vectors. | |
SDValue | expandUnalignedStore (StoreSDNode *ST,SelectionDAG &DAG)const |
Expands an unaligned store to 2 half-size stores for integer values, and possibly more for vectors. | |
SDValue | IncrementMemoryAddress (SDValueAddr,SDValue Mask,constSDLoc &DL,EVT DataVT,SelectionDAG &DAG,bool IsCompressedMemory)const |
Increments memory addressAddr according to the type of the valueDataVT that should be stored. | |
SDValue | getVectorElementPointer (SelectionDAG &DAG,SDValue VecPtr,EVT VecVT,SDValueIndex)const |
Get a pointer to vector elementIdx located in memory for a vector of typeVecVT starting at a base address ofVecPtr . | |
SDValue | getVectorSubVecPointer (SelectionDAG &DAG,SDValue VecPtr,EVT VecVT,EVT SubVecVT,SDValueIndex)const |
Get a pointer to a sub-vector of typeSubVecVT at indexIdx located in memory for a vector of typeVecVT starting at a base address ofVecPtr . | |
SDValue | expandIntMINMAX (SDNode *Node,SelectionDAG &DAG)const |
Method for building the DAG expansion ofISD::[US][MIN|MAX]. | |
SDValue | expandAddSubSat (SDNode *Node,SelectionDAG &DAG)const |
Method for building the DAG expansion ofISD::[US][ADD|SUB]SAT. | |
SDValue | expandCMP (SDNode *Node,SelectionDAG &DAG)const |
Method for building the DAG expansion ofISD::[US]CMP. | |
SDValue | expandShlSat (SDNode *Node,SelectionDAG &DAG)const |
Method for building the DAG expansion ofISD::[US]SHLSAT. | |
SDValue | expandFixedPointMul (SDNode *Node,SelectionDAG &DAG)const |
Method for building the DAG expansion ofISD::[U|S]MULFIX[SAT]. | |
SDValue | expandFixedPointDiv (unsigned Opcode,constSDLoc &dl,SDValueLHS,SDValueRHS,unsigned Scale,SelectionDAG &DAG)const |
Method for building the DAG expansion ofISD::[US]DIVFIX[SAT]. | |
void | expandUADDSUBO (SDNode *Node,SDValue &Result,SDValue &Overflow,SelectionDAG &DAG)const |
Method for building the DAG expansion of ISD::U(ADD|SUB)O. | |
void | expandSADDSUBO (SDNode *Node,SDValue &Result,SDValue &Overflow,SelectionDAG &DAG)const |
Method for building the DAG expansion of ISD::S(ADD|SUB)O. | |
bool | expandMULO (SDNode *Node,SDValue &Result,SDValue &Overflow,SelectionDAG &DAG)const |
Method for building the DAG expansion ofISD::[US]MULO. | |
void | forceExpandMultiply (SelectionDAG &DAG,constSDLoc &dl,boolSigned,SDValue &Lo,SDValue &Hi,SDValueLHS,SDValueRHS,SDValue HiLHS=SDValue(),SDValue HiRHS=SDValue())const |
Calculate the product twice the width of LHS and RHS. | |
void | forceExpandWideMUL (SelectionDAG &DAG,constSDLoc &dl,boolSigned,constSDValueLHS,constSDValueRHS,SDValue &Lo,SDValue &Hi)const |
Calculate full product of LHS and RHS either via a libcall or through brute force expansion of the multiplication. | |
SDValue | expandVecReduce (SDNode *Node,SelectionDAG &DAG)const |
Expand a VECREDUCE_* into an explicit calculation. | |
SDValue | expandVecReduceSeq (SDNode *Node,SelectionDAG &DAG)const |
Expand a VECREDUCE_SEQ_* into an explicit ordered calculation. | |
bool | expandREM (SDNode *Node,SDValue &Result,SelectionDAG &DAG)const |
Expand an SREM or UREM using SDIV/UDIV or SDIVREM/UDIVREM, if legal. | |
SDValue | expandVectorSplice (SDNode *Node,SelectionDAG &DAG)const |
Method for building the DAG expansion ofISD::VECTOR_SPLICE. | |
SDValue | expandVECTOR_COMPRESS (SDNode *Node,SelectionDAG &DAG)const |
Expand a vector VECTOR_COMPRESS into a sequence of extract element, store temporarily, advance store position, before re-loading the final vector. | |
bool | LegalizeSetCCCondCode (SelectionDAG &DAG,EVT VT,SDValue &LHS,SDValue &RHS,SDValue &CC,SDValue Mask,SDValue EVL,bool &NeedInvert,constSDLoc &dl,SDValue &Chain,bool IsSignaling=false)const |
Legalize a SETCC or VP_SETCC with given LHS and RHS and condition code CC on the current target. | |
virtualMachineBasicBlock * | EmitInstrWithCustomInserter (MachineInstr &MI,MachineBasicBlock *MBB)const |
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' flag. | |
virtual void | AdjustInstrPostInstrSelection (MachineInstr &MI,SDNode *Node)const |
This method should be implemented by targets that mark instructions with the 'hasPostISelHook' flag. | |
virtualbool | useLoadStackGuardNode (constModule &M)const |
If this function returns true,SelectionDAGBuilder emits a LOAD_STACK_GUARD node when it is lowering Intrinsic::stackprotector. | |
virtualSDValue | emitStackGuardXorFP (SelectionDAG &DAG,SDValue Val,constSDLoc &DL)const |
virtualSDValue | LowerToTLSEmulatedModel (constGlobalAddressSDNode *GA,SelectionDAG &DAG)const |
Lower TLS global addressSDNode for target independent emulated TLS model. | |
virtualSDValue | expandIndirectJTBranch (constSDLoc &dl,SDValueValue,SDValueAddr, int JTI,SelectionDAG &DAG)const |
Expands target specific indirect branch for the case ofJumpTable expansion. | |
SDValue | lowerCmpEqZeroToCtlzSrl (SDValueOp,SelectionDAG &DAG)const |
virtualbool | isXAndYEqZeroPreferableToXAndYEqY (ISD::CondCode,EVT)const |
SDValue | expandVectorNaryOpBySplitting (SDNode *Node,SelectionDAG &DAG)const |
![]() | |
virtual void | markLibCallAttributes (MachineFunction *MF,unsignedCC,ArgListTy &Args)const |
TargetLoweringBase (constTargetMachine &TM) | |
NOTE: TheTargetMachine owns TLOF. | |
TargetLoweringBase (constTargetLoweringBase &)=delete | |
TargetLoweringBase & | operator= (constTargetLoweringBase &)=delete |
virtual | ~TargetLoweringBase ()=default |
bool | isStrictFPEnabled ()const |
Return true if the target support strict float operation. | |
constTargetMachine & | getTargetMachine ()const |
virtualbool | useSoftFloat ()const |
virtualMVT | getPointerTy (constDataLayout &DL,uint32_t AS=0)const |
Return the pointer type for the given address space, defaults to the pointer type from the data layout. | |
virtualMVT | getPointerMemTy (constDataLayout &DL,uint32_t AS=0)const |
Return the in-memory pointer type for the given address space, defaults to the pointer type from the data layout. | |
MVT | getFrameIndexTy (constDataLayout &DL)const |
Return the type for frame index, which is determined by the alloca address space specified through the data layout. | |
MVT | getProgramPointerTy (constDataLayout &DL)const |
Return the type for code pointers, which is determined by the program address space specified through the data layout. | |
virtualMVT | getFenceOperandTy (constDataLayout &DL)const |
Return the type for operands of fence. | |
virtualMVT | getScalarShiftAmountTy (constDataLayout &,EVT)const |
Return the type to use for a scalar shift opcode, given the shifted amount type. | |
EVT | getShiftAmountTy (EVT LHSTy,constDataLayout &DL)const |
Returns the type for the shift amount of a shift opcode. | |
virtualLLVM_READONLYLLT | getPreferredShiftAmountTy (LLT ShiftValueTy)const |
Return the preferred type to use for a shift opcode, given the shifted amount type isShiftValueTy . | |
virtualMVT | getVectorIdxTy (constDataLayout &DL)const |
Returns the type to be used for the index operand of:ISD::INSERT_VECTOR_ELT,ISD::EXTRACT_VECTOR_ELT,ISD::INSERT_SUBVECTOR, andISD::EXTRACT_SUBVECTOR. | |
virtualMVT | getVPExplicitVectorLengthTy ()const |
Returns the type to be used for the EVL/AVL operand of VP nodes: ISD::VP_ADD, ISD::VP_SUB, etc. | |
virtualMachineMemOperand::Flags | getTargetMMOFlags (constInstruction &I)const |
This callback is used to inspect load/store instructions and add target-specificMachineMemOperand flags to them. | |
virtualMachineMemOperand::Flags | getTargetMMOFlags (constMemSDNode &Node)const |
This callback is used to inspect load/storeSDNode. | |
MachineMemOperand::Flags | getLoadMemOperandFlags (constLoadInst &LI,constDataLayout &DL,AssumptionCache *AC=nullptr,constTargetLibraryInfo *LibInfo=nullptr)const |
MachineMemOperand::Flags | getStoreMemOperandFlags (constStoreInst &SI,constDataLayout &DL)const |
MachineMemOperand::Flags | getAtomicMemOperandFlags (constInstruction &AI,constDataLayout &DL)const |
virtualbool | isSelectSupported (SelectSupportKind)const |
virtualbool | shouldExpandPartialReductionIntrinsic (constIntrinsicInst *I)const |
Return true if the @llvm.experimental.vector.partial.reduce. | |
virtualbool | shouldExpandGetActiveLaneMask (EVT VT,EVT OpVT)const |
Return true if the @llvm.get.active.lane.mask intrinsic should be expanded using generic code inSelectionDAGBuilder. | |
virtualbool | shouldExpandGetVectorLength (EVT CountVT,unsigned VF,bool IsScalable)const |
virtualbool | shouldExpandCttzElements (EVT VT)const |
Return true if the @llvm.experimental.cttz.elts intrinsic should be expanded using generic code inSelectionDAGBuilder. | |
unsigned | getBitWidthForCttzElements (Type *RetTy,ElementCount EC,bool ZeroIsPoison,constConstantRange *VScaleRange)const |
Return the minimum number of bits required to hold the maximum possible number of trailing zero vector elements. | |
virtualbool | shouldExpandVectorMatch (EVT VT,unsigned SearchSize)const |
Return true if the @llvm.experimental.vector.match intrinsic should be expanded for vector type ‘VT’ and search size ‘SearchSize’ using generic code inSelectionDAGBuilder. | |
virtualbool | shouldReassociateReduction (unsigned RedOpc,EVT VT)const |
virtualbool | reduceSelectOfFPConstantLoads (EVT CmpOpVT)const |
Return true if it is profitable to convert a select of FP constants into a constant pool load whose address depends on the select condition. | |
bool | hasMultipleConditionRegisters ()const |
Return true if multiple condition registers are available. | |
bool | hasExtractBitsInsn ()const |
Return true if the target has BitExtract instructions. | |
virtualTargetLoweringBase::LegalizeTypeAction | getPreferredVectorAction (MVT VT)const |
Return the preferred vector type legalization action. | |
virtualbool | softPromoteHalfType ()const |
virtualbool | useFPRegsForHalfType ()const |
virtualbool | shouldExpandBuildVectorWithShuffles (EVT,unsigned DefinedValues)const |
virtualbool | isIntDivCheap (EVT VT,AttributeList Attr)const |
Return true if integer divide is usually cheaper than a sequence of several shifts, adds, and multiplies for this target. | |
virtualbool | hasStandaloneRem (EVT VT)const |
Return true if the target can handle a standalone remainder operation. | |
virtualbool | isFsqrtCheap (SDValueX,SelectionDAG &DAG)const |
Return true if SQRT(X) shouldn't be replaced with X*RSQRT(X). | |
int | getRecipEstimateSqrtEnabled (EVT VT,MachineFunction &MF)const |
Return a ReciprocalEstimate enum value for a square root of the given type based on the function's attributes. | |
int | getRecipEstimateDivEnabled (EVT VT,MachineFunction &MF)const |
Return a ReciprocalEstimate enum value for a division of the given type based on the function's attributes. | |
int | getSqrtRefinementSteps (EVT VT,MachineFunction &MF)const |
Return the refinement step count for a square root of the given type based on the function's attributes. | |
int | getDivRefinementSteps (EVT VT,MachineFunction &MF)const |
Return the refinement step count for a division of the given type based on the function's attributes. | |
bool | isSlowDivBypassed ()const |
Returns true if target has indicated at least one type should be bypassed. | |
constDenseMap<unsigned int,unsigned int > & | getBypassSlowDivWidths ()const |
Returns map of slow types for division or remainder with corresponding fast types. | |
virtualbool | isVScaleKnownToBeAPowerOfTwo ()const |
Return true only if vscale must be a power of two. | |
bool | isJumpExpensive ()const |
Return true if Flow Control is an expensive operation that should be avoided. | |
virtualCondMergingParams | getJumpConditionMergingParams (Instruction::BinaryOps,constValue *,constValue *)const |
bool | isPredictableSelectExpensive ()const |
Return true if selects are only cheaper than branches if the branch is unlikely to be predicted right. | |
virtualbool | fallBackToDAGISel (constInstruction &Inst)const |
virtualbool | isLoadBitCastBeneficial (EVT LoadVT,EVT BitcastVT,constSelectionDAG &DAG,constMachineMemOperand &MMO)const |
Return true if the following transform is beneficial: fold (conv (load x)) -> (load (conv*)x) On architectures that don't natively support some vector loads efficiently, casting the load to a smaller vector of larger types and loading is more efficient, however, this can be undone by optimizations in dag combiner. | |
virtualbool | isStoreBitCastBeneficial (EVT StoreVT,EVT BitcastVT,constSelectionDAG &DAG,constMachineMemOperand &MMO)const |
Return true if the following transform is beneficial: (store (y (conv x)), y*)) -> (store x, (x*)) | |
virtualbool | storeOfVectorConstantIsCheap (bool IsZero,EVT MemVT,unsigned NumElem,unsigned AddrSpace)const |
Return true if it is expected to be cheaper to do a store of vector constant with the given size and type for the address space than to store the individual scalar element constants. | |
virtualbool | mergeStoresAfterLegalization (EVT MemVT)const |
Allow store merging for the specified type after legalization in addition to before legalization. | |
virtualbool | canMergeStoresTo (unsigned AS,EVT MemVT,constMachineFunction &MF)const |
Returns if it's reasonable to merge stores to MemVT size. | |
virtualbool | isCheapToSpeculateCttz (Type *Ty)const |
Return true if it is cheap to speculate a call to intrinsic cttz. | |
virtualbool | isCheapToSpeculateCtlz (Type *Ty)const |
Return true if it is cheap to speculate a call to intrinsic ctlz. | |
virtualbool | isCtlzFast ()const |
Return true if ctlz instruction is fast. | |
virtualbool | isCtpopFast (EVT VT)const |
Return true if ctpop instruction is fast. | |
virtualunsigned | getCustomCtpopCost (EVT VT,ISD::CondCodeCond)const |
Return the maximum number of "x & (x - 1)" operations that can be done instead of deferring to a custom CTPOP. | |
virtualbool | isEqualityCmpFoldedWithSignedCmp ()const |
Return true if instruction generated for equality comparison is folded with instruction generated for signed comparison. | |
virtualbool | preferZeroCompareBranch ()const |
Return true if the heuristic to prefer icmp eq zero should be used in code gen prepare. | |
virtualbool | isMultiStoresCheaperThanBitsMerge (EVT LTy,EVT HTy)const |
Return true if it is cheaper to split the store of a merged int val from a pair of smaller values into multiple stores. | |
virtualbool | isMaskAndCmp0FoldingBeneficial (constInstruction &AndI)const |
Return if the target supports combining a chain like: | |
virtualbool | areTwoSDNodeTargetMMOFlagsMergeable (constMemSDNode &NodeX,constMemSDNode &NodeY)const |
Return true if it is valid to merge the TargetMMOFlags in two SDNodes. | |
virtualbool | convertSetCCLogicToBitwiseLogic (EVT VT)const |
Use bitwise logic to make pairs of compares more efficient. | |
virtualMVT | hasFastEqualityCompare (unsigned NumBits)const |
Return the preferred operand type if the target has a quick way to compare integer values of the given size. | |
virtualbool | hasAndNotCompare (SDValueY)const |
Return true if the target should transform: (X & Y) == Y —> (~X & Y) == 0 (X & Y) != Y —> (~X & Y) != 0. | |
virtualbool | hasAndNot (SDValueX)const |
Return true if the target has a bitwise and-not operation: X = ~A & B This can be used to simplify select or other instructions. | |
virtualbool | hasBitTest (SDValueX,SDValueY)const |
Return true if the target has a bit-test instruction: (X & (1 << Y)) ==/!= 0 This knowledge can be used to prevent breaking the pattern, or creating it if it could be recognized. | |
virtualbool | shouldFoldMaskToVariableShiftPair (SDValueX)const |
There are two ways to clear extreme bits (either low or high): Mask: x & (-1 << y) (the instcombine canonical form) Shifts: x >> y << y Return true if the variant with 2 variable shifts is preferred. | |
virtualbool | shouldFoldConstantShiftPairToMask (constSDNode *N,CombineLevel Level)const |
Return true if it is profitable to fold a pair of shifts into a mask. | |
virtualbool | shouldTransformSignedTruncationCheck (EVT XVT,unsigned KeptBits)const |
Should we tranform the IR-optimal check for whether given truncation down into KeptBits would be truncating or not: (add x, (1 << (KeptBits-1))) srccond (1 << KeptBits) Into it's more traditional form: ((x << C) a>> C) dstcond x Return true if we should transform. | |
virtualbool | shouldProduceAndByConstByHoistingConstFromShiftsLHSOfAnd (SDValueX,ConstantSDNode *XC,ConstantSDNode *CC,SDValueY,unsigned OldShiftOpcode,unsigned NewShiftOpcode,SelectionDAG &DAG)const |
Given the pattern (X & (C l>>/<< Y)) ==/!= 0 return true if it should be transformed into: ((X <</l>> Y) & C) ==/!= 0 WARNING: if 'X' is a constant, the fold may deadlock! FIXME: we could avoid passing XC, but we can't useisConstOrConstSplat() here because it can end up being not linked in. | |
virtualbool | optimizeFMulOrFDivAsShiftAddBitcast (SDNode *N,SDValue FPConst,SDValue IntPow2)const |
virtualunsigned | preferedOpcodeForCmpEqPiecesOfOperand (EVT VT,unsigned ShiftOpc,bool MayTransformRotate,constAPInt &ShiftOrRotateAmt,const std::optional<APInt > &AndMask)const |
virtualbool | preferIncOfAddToSubOfNot (EVT VT)const |
These two forms are equivalent: sub y, (xor x, -1) add (add x, 1), y The variant with two add's is IR-canonical. | |
virtualbool | preferABDSToABSWithNSW (EVT VT)const |
virtualbool | preferScalarizeSplat (SDNode *N)const |
virtualbool | preferSextInRegOfTruncate (EVT TruncVT,EVT VT,EVT ExtVT)const |
bool | enableExtLdPromotion ()const |
Return true if the target wants to use the optimization that turns ext(promotableInst1(...(promotableInstN(load)))) into promotedInst1(...(promotedInstN(ext(load)))). | |
virtualbool | canCombineStoreAndExtract (Type *VectorTy,Value *Idx,unsigned &Cost)const |
Return true if the target can combine store(extractelement VectorTy,Idx). | |
virtualbool | shallExtractConstSplatVectorElementToStore (Type *VectorTy,unsigned ElemSizeInBits,unsigned &Index)const |
Return true if the target shall perform extract vector element and store given that the vector is known to be splat of constant. | |
virtualbool | shouldSplatInsEltVarIndex (EVT)const |
Return true if inserting a scalar into a variable element of an undef vector is more efficiently handled by splatting the scalar instead. | |
virtualbool | enableAggressiveFMAFusion (EVT VT)const |
Return true if target always benefits from combining into FMA for a given value type. | |
virtualbool | enableAggressiveFMAFusion (LLT Ty)const |
Return true if target always benefits from combining into FMA for a given value type. | |
virtualEVT | getSetCCResultType (constDataLayout &DL,LLVMContext &Context,EVT VT)const |
Return the ValueType of the result of SETCC operations. | |
virtualMVT::SimpleValueType | getCmpLibcallReturnType ()const |
Return the ValueType for comparison libcalls. | |
BooleanContent | getBooleanContents (bool isVec,bool isFloat)const |
For targets without i1 registers, this gives the nature of the high-bits of boolean values held in types wider than i1. | |
BooleanContent | getBooleanContents (EVTType)const |
SDValue | promoteTargetBoolean (SelectionDAG &DAG,SDValueBool,EVT ValVT)const |
Promote the given target boolean to a target boolean of the given type. | |
Sched::Preference | getSchedulingPreference ()const |
Return target scheduling preference. | |
virtualSched::Preference | getSchedulingPreference (SDNode *)const |
Some scheduler, e.g. | |
virtualconstTargetRegisterClass * | getRegClassFor (MVT VT,bool isDivergent=false)const |
Return the register class that should be used for the specified value type. | |
virtualbool | requiresUniformRegister (MachineFunction &MF,constValue *)const |
Allows target to decide about the register class of the specific value that is live outside the defining block. | |
virtualconstTargetRegisterClass * | getRepRegClassFor (MVT VT)const |
Return the 'representative' register class for the specified value type. | |
virtualuint8_t | getRepRegClassCostFor (MVT VT)const |
Return the cost of the 'representative' register class for the specified value type. | |
virtualShiftLegalizationStrategy | preferredShiftLegalizationStrategy (SelectionDAG &DAG,SDNode *N,unsigned ExpansionFactor)const |
bool | isTypeLegal (EVT VT)const |
Return true if the target has native support for the specified value type. | |
constValueTypeActionImpl & | getValueTypeActions ()const |
LegalizeKind | getTypeConversion (LLVMContext &Context,EVT VT)const |
Return pair that represents the legalization kind (first) that needs to happen toEVT (second) in order to type-legalize it. | |
LegalizeTypeAction | getTypeAction (LLVMContext &Context,EVT VT)const |
Return how we should legalize values of this type, either it is already legal (return 'Legal') or we need to promote it to a larger type (return 'Promote'), or we need to expand it into multiple registers of smaller integer type (return 'Expand'). | |
LegalizeTypeAction | getTypeAction (MVT VT)const |
virtualEVT | getTypeToTransformTo (LLVMContext &Context,EVT VT)const |
For types supported by the target, this is an identity function. | |
EVT | getTypeToExpandTo (LLVMContext &Context,EVT VT)const |
For types supported by the target, this is an identity function. | |
unsigned | getVectorTypeBreakdown (LLVMContext &Context,EVT VT,EVT &IntermediateVT,unsigned &NumIntermediates,MVT &RegisterVT)const |
Vector types are broken down into some number of legal first class types. | |
virtualunsigned | getVectorTypeBreakdownForCallingConv (LLVMContext &Context,CallingConv::IDCC,EVT VT,EVT &IntermediateVT,unsigned &NumIntermediates,MVT &RegisterVT)const |
Certain targets such as MIPS require that some types such as vectors are always broken down into scalars in some contexts. | |
virtualbool | getTgtMemIntrinsic (IntrinsicInfo &,constCallInst &,MachineFunction &,unsigned)const |
Given an intrinsic, checks if on the target the intrinsic will need to map to a MemIntrinsicNode (touches memory). | |
virtualbool | isFPImmLegal (constAPFloat &,EVT,bool ForCodeSize=false)const |
Returns true if the target can instruction select the specified FP immediate natively. | |
virtualbool | isShuffleMaskLegal (ArrayRef< int >,EVT)const |
Targets can use this to indicate that they only supportsome VECTOR_SHUFFLE operations, those with specific masks. | |
virtualbool | canOpTrap (unsignedOp,EVT VT)const |
Returns true if the operation can trap for the value type. | |
virtualbool | isVectorClearMaskLegal (ArrayRef< int >,EVT)const |
Similar to isShuffleMaskLegal. | |
virtualLegalizeAction | getCustomOperationAction (SDNode &Op)const |
How to legalize this custom operation? | |
LegalizeAction | getOperationAction (unsignedOp,EVT VT)const |
Return how this operation should be treated: either it is legal, needs to be promoted to a larger size, needs to be expanded to some other code sequence, or the target has a custom expander for it. | |
virtualbool | isSupportedFixedPointOperation (unsignedOp,EVT VT,unsigned Scale)const |
Custom method defined by each target to indicate if an operation which may require a scale is supported natively by the target. | |
LegalizeAction | getFixedPointOperationAction (unsignedOp,EVT VT,unsigned Scale)const |
Some fixed point operations may be natively supported by the target but only for specific scales. | |
LegalizeAction | getStrictFPOperationAction (unsignedOp,EVT VT)const |
bool | isOperationLegalOrCustom (unsignedOp,EVT VT,bool LegalOnly=false)const |
Return true if the specified operation is legal on this target or can be made legal with custom lowering. | |
bool | isOperationLegalOrPromote (unsignedOp,EVT VT,bool LegalOnly=false)const |
Return true if the specified operation is legal on this target or can be made legal using promotion. | |
bool | isOperationLegalOrCustomOrPromote (unsignedOp,EVT VT,bool LegalOnly=false)const |
Return true if the specified operation is legal on this target or can be made legal with custom lowering or using promotion. | |
bool | isOperationCustom (unsignedOp,EVT VT)const |
Return true if the operation uses custom lowering, regardless of whether the type is legal or not. | |
virtualbool | areJTsAllowed (constFunction *Fn)const |
Return true if lowering to a jump table is allowed. | |
bool | rangeFitsInWord (constAPInt &Low,constAPInt &High,constDataLayout &DL)const |
Check whether the range [Low,High] fits in a machine word. | |
virtualbool | isSuitableForJumpTable (constSwitchInst *SI,uint64_t NumCases,uint64_tRange,ProfileSummaryInfo *PSI,BlockFrequencyInfo *BFI)const |
Return true if lowering to a jump table is suitable for a set of case clusters which may containNumCases cases,Range range of values. | |
virtualMVT | getPreferredSwitchConditionType (LLVMContext &Context,EVT ConditionVT)const |
Returns preferred type for switch condition. | |
bool | isSuitableForBitTests (unsigned NumDests,unsigned NumCmps,constAPInt &Low,constAPInt &High,constDataLayout &DL)const |
Return true if lowering to a bit test is suitable for a set of case clusters which containsNumDests unique destinations,Low andHigh as its lowest and highest case values, and expectsNumCmps case value comparisons. | |
bool | isOperationExpand (unsignedOp,EVT VT)const |
Return true if the specified operation is illegal on this target or unlikely to be made legal with custom lowering. | |
bool | isOperationLegal (unsignedOp,EVT VT)const |
Return true if the specified operation is legal on this target. | |
LegalizeAction | getLoadExtAction (unsigned ExtType,EVT ValVT,EVT MemVT)const |
Return how this load with extension should be treated: either it is legal, needs to be promoted to a larger size, needs to be expanded to some other code sequence, or the target has a custom expander for it. | |
bool | isLoadExtLegal (unsigned ExtType,EVT ValVT,EVT MemVT)const |
Return true if the specified load with extension is legal on this target. | |
bool | isLoadExtLegalOrCustom (unsigned ExtType,EVT ValVT,EVT MemVT)const |
Return true if the specified load with extension is legal or custom on this target. | |
LegalizeAction | getAtomicLoadExtAction (unsigned ExtType,EVT ValVT,EVT MemVT)const |
Same as getLoadExtAction, but for atomic loads. | |
bool | isAtomicLoadExtLegal (unsigned ExtType,EVT ValVT,EVT MemVT)const |
Return true if the specified atomic load with extension is legal on this target. | |
LegalizeAction | getTruncStoreAction (EVT ValVT,EVT MemVT)const |
Return how this store with truncation should be treated: either it is legal, needs to be promoted to a larger size, needs to be expanded to some other code sequence, or the target has a custom expander for it. | |
bool | isTruncStoreLegal (EVT ValVT,EVT MemVT)const |
Return true if the specified store with truncation is legal on this target. | |
bool | isTruncStoreLegalOrCustom (EVT ValVT,EVT MemVT)const |
Return true if the specified store with truncation has solution on this target. | |
virtualbool | canCombineTruncStore (EVT ValVT,EVT MemVT,bool LegalOnly)const |
LegalizeAction | getIndexedLoadAction (unsigned IdxMode,MVT VT)const |
Return how the indexed load should be treated: either it is legal, needs to be promoted to a larger size, needs to be expanded to some other code sequence, or the target has a custom expander for it. | |
bool | isIndexedLoadLegal (unsigned IdxMode,EVT VT)const |
Return true if the specified indexed load is legal on this target. | |
LegalizeAction | getIndexedStoreAction (unsigned IdxMode,MVT VT)const |
Return how the indexed store should be treated: either it is legal, needs to be promoted to a larger size, needs to be expanded to some other code sequence, or the target has a custom expander for it. | |
bool | isIndexedStoreLegal (unsigned IdxMode,EVT VT)const |
Return true if the specified indexed load is legal on this target. | |
LegalizeAction | getIndexedMaskedLoadAction (unsigned IdxMode,MVT VT)const |
Return how the indexed load should be treated: either it is legal, needs to be promoted to a larger size, needs to be expanded to some other code sequence, or the target has a custom expander for it. | |
bool | isIndexedMaskedLoadLegal (unsigned IdxMode,EVT VT)const |
Return true if the specified indexed load is legal on this target. | |
LegalizeAction | getIndexedMaskedStoreAction (unsigned IdxMode,MVT VT)const |
Return how the indexed store should be treated: either it is legal, needs to be promoted to a larger size, needs to be expanded to some other code sequence, or the target has a custom expander for it. | |
bool | isIndexedMaskedStoreLegal (unsigned IdxMode,EVT VT)const |
Return true if the specified indexed load is legal on this target. | |
virtualbool | shouldExtendGSIndex (EVT VT,EVT &EltTy)const |
Returns true if the index type for a masked gather/scatter requires extending. | |
virtualbool | shouldRemoveExtendFromGSIndex (SDValue Extend,EVT DataVT)const |
virtualbool | isLegalScaleForGatherScatter (uint64_t Scale,uint64_t ElemSize)const |
LegalizeAction | getCondCodeAction (ISD::CondCodeCC,MVT VT)const |
Return how the condition code should be treated: either it is legal, needs to be expanded to some other code sequence, or the target has a custom expander for it. | |
bool | isCondCodeLegal (ISD::CondCodeCC,MVT VT)const |
Return true if the specified condition code is legal for a comparison of the specified types on this target. | |
bool | isCondCodeLegalOrCustom (ISD::CondCodeCC,MVT VT)const |
Return true if the specified condition code is legal or custom for a comparison of the specified types on this target. | |
MVT | getTypeToPromoteTo (unsignedOp,MVT VT)const |
If the action for this operation is to promote, this method returns the ValueType to promote to. | |
virtualEVT | getAsmOperandValueType (constDataLayout &DL,Type *Ty,bool AllowUnknown=false)const |
EVT | getValueType (constDataLayout &DL,Type *Ty,bool AllowUnknown=false)const |
Return theEVT corresponding to this LLVM type. | |
EVT | getMemValueType (constDataLayout &DL,Type *Ty,bool AllowUnknown=false)const |
MVT | getSimpleValueType (constDataLayout &DL,Type *Ty,bool AllowUnknown=false)const |
Return theMVT corresponding to this LLVM type. See getValueType. | |
virtualAlign | getByValTypeAlignment (Type *Ty,constDataLayout &DL)const |
Returns the desired alignment for ByVal or InAlloca aggregate function arguments in the caller parameter area. | |
MVT | getRegisterType (MVT VT)const |
Return the type of registers that this ValueType will eventually require. | |
MVT | getRegisterType (LLVMContext &Context,EVT VT)const |
Return the type of registers that this ValueType will eventually require. | |
virtualunsigned | getNumRegisters (LLVMContext &Context,EVT VT, std::optional<MVT > RegisterVT=std::nullopt)const |
Return the number of registers that this ValueType will eventually require. | |
virtualMVT | getRegisterTypeForCallingConv (LLVMContext &Context,CallingConv::IDCC,EVT VT)const |
Certain combinations of ABIs, Targets and features require that types are legal for some operations and not for other operations. | |
virtualunsigned | getNumRegistersForCallingConv (LLVMContext &Context,CallingConv::IDCC,EVT VT)const |
Certain targets require unusual breakdowns of certain types. | |
virtualAlign | getABIAlignmentForCallingConv (Type *ArgTy,constDataLayout &DL)const |
Certain targets have context sensitive alignment requirements, where one type has the alignment requirement of another type. | |
virtualbool | ShouldShrinkFPConstant (EVT)const |
If true, then instruction selection should seek to shrink the FP constant of the specified type to a smaller type in order to save space and / or reduce runtime. | |
virtualbool | shouldReduceLoadWidth (SDNode *Load,ISD::LoadExtType ExtTy,EVT NewVT)const |
Return true if it is profitable to reduce a load to a smaller type. | |
virtualbool | shouldRemoveRedundantExtend (SDValueOp)const |
Return true (the default) if it is profitable to remove a sext_inreg(x) where the sext is redundant, and use x directly. | |
bool | isPaddedAtMostSignificantBitsWhenStored (EVT VT)const |
Indicates if any padding is guaranteed to go at the most significant bits when storing the type to memory and the type size isn't equal to the store size. | |
bool | hasBigEndianPartOrdering (EVT VT,constDataLayout &DL)const |
When splitting a value of the specified type into parts, does the Lo or Hi part come first? This usually follows the endianness, except for ppcf128, where the Hi part always comes first. | |
bool | hasTargetDAGCombine (ISD::NodeType NT)const |
If true, the target has custom DAG combine transformations that it can perform for the specified node. | |
unsigned | getGatherAllAliasesMaxDepth ()const |
virtualunsigned | getVaListSizeInBits (constDataLayout &DL)const |
Returns the size of the platform's va_list object. | |
unsigned | getMaxStoresPerMemset (bool OptSize)const |
Get maximum # of store operations permitted for llvm.memset. | |
unsigned | getMaxStoresPerMemcpy (bool OptSize)const |
Get maximum # of store operations permitted for llvm.memcpy. | |
virtualunsigned | getMaxGluedStoresPerMemcpy ()const |
Get maximum # of store operations to be glued together. | |
unsigned | getMaxExpandSizeMemcmp (bool OptSize)const |
Get maximum # of load operations permitted for memcmp. | |
unsigned | getMaxStoresPerMemmove (bool OptSize)const |
Get maximum # of store operations permitted for llvm.memmove. | |
virtualbool | allowsMisalignedMemoryAccesses (EVT,unsigned AddrSpace=0,Align Alignment=Align(1),MachineMemOperand::Flags Flags=MachineMemOperand::MONone,unsigned *=nullptr)const |
Determine if the target supports unaligned memory accesses. | |
virtualbool | allowsMisalignedMemoryAccesses (LLT,unsigned AddrSpace=0,Align Alignment=Align(1),MachineMemOperand::Flags Flags=MachineMemOperand::MONone,unsigned *=nullptr)const |
LLT handling variant. | |
bool | allowsMemoryAccessForAlignment (LLVMContext &Context,constDataLayout &DL,EVT VT,unsigned AddrSpace=0,Align Alignment=Align(1),MachineMemOperand::Flags Flags=MachineMemOperand::MONone,unsigned *Fast=nullptr)const |
This function returns true if the memory access is aligned or if the target allows this specific unaligned memory access. | |
bool | allowsMemoryAccessForAlignment (LLVMContext &Context,constDataLayout &DL,EVT VT,constMachineMemOperand &MMO,unsigned *Fast=nullptr)const |
Return true if the memory access of this type is aligned or if the target allows this specific unaligned access for the givenMachineMemOperand. | |
virtualbool | allowsMemoryAccess (LLVMContext &Context,constDataLayout &DL,EVT VT,unsigned AddrSpace=0,Align Alignment=Align(1),MachineMemOperand::Flags Flags=MachineMemOperand::MONone,unsigned *Fast=nullptr)const |
Return true if the target supports a memory access of this type for the given address space and alignment. | |
bool | allowsMemoryAccess (LLVMContext &Context,constDataLayout &DL,EVT VT,constMachineMemOperand &MMO,unsigned *Fast=nullptr)const |
Return true if the target supports a memory access of this type for the givenMachineMemOperand. | |
bool | allowsMemoryAccess (LLVMContext &Context,constDataLayout &DL,LLT Ty,constMachineMemOperand &MMO,unsigned *Fast=nullptr)const |
LLT handling variant. | |
virtualEVT | getOptimalMemOpType (constMemOp &Op,constAttributeList &)const |
Returns the target specific optimal type for load and store operations as a result of memset, memcpy, and memmove lowering. | |
virtualLLT | getOptimalMemOpLLT (constMemOp &Op,constAttributeList &)const |
LLT returning variant. | |
virtualbool | isSafeMemOpType (MVT)const |
Returns true if it's safe to use load / store of the specified type to expand memcpy / memset inline. | |
virtualunsigned | getMinimumJumpTableEntries ()const |
Return lower limit for number of blocks in a jump table. | |
unsigned | getMinimumJumpTableDensity (bool OptForSize)const |
Return lower limit of the density in a jump table. | |
unsigned | getMaximumJumpTableSize ()const |
Return upper limit for number of entries in a jump table. | |
virtualbool | isJumpTableRelative ()const |
Register | getStackPointerRegisterToSaveRestore ()const |
If a physical register, this specifies the register that llvm.savestack/llvm.restorestack should save and restore. | |
virtualRegister | getExceptionPointerRegister (constConstant *PersonalityFn)const |
If a physical register, this returns the register that receives the exception address on entry to an EH pad. | |
virtualRegister | getExceptionSelectorRegister (constConstant *PersonalityFn)const |
If a physical register, this returns the register that receives the exception typeid on entry to a landing pad. | |
virtualbool | needsFixedCatchObjects ()const |
Align | getMinStackArgumentAlignment ()const |
Return the minimum stack alignment of an argument. | |
Align | getMinFunctionAlignment ()const |
Return the minimum function alignment. | |
Align | getPrefFunctionAlignment ()const |
Return the preferred function alignment. | |
virtualAlign | getPrefLoopAlignment (MachineLoop *ML=nullptr)const |
Return the preferred loop alignment. | |
virtualunsigned | getMaxPermittedBytesForAlignment (MachineBasicBlock *MBB)const |
Return the maximum amount of bytes allowed to be emitted when padding for alignment. | |
virtualbool | alignLoopsWithOptSize ()const |
Should loops be aligned even when the function is marked OptSize (but not MinSize). | |
virtualValue * | getIRStackGuard (IRBuilderBase &IRB)const |
If the target has a standard location for the stack protector guard, returns the address of that location. | |
virtual void | insertSSPDeclarations (Module &M)const |
Inserts necessary declarations for SSP (stack protection) purpose. | |
virtualValue * | getSDagStackGuard (constModule &M)const |
Return the variable that's previously inserted by insertSSPDeclarations, if any, otherwise return nullptr. | |
virtualbool | useStackGuardXorFP ()const |
If this function returns true, stack protection checks should XOR the frame pointer (or whichever pointer is used to address locals) into the stack guard value before checking it. | |
virtualFunction * | getSSPStackGuardCheck (constModule &M)const |
If the target has a standard stack protection check function that performs validation and error handling, returns the function. | |
virtualValue * | getSafeStackPointerLocation (IRBuilderBase &IRB)const |
Returns the target-specific address of the unsafe stack pointer. | |
virtualbool | hasStackProbeSymbol (constMachineFunction &MF)const |
Returns the name of the symbol used to emit stack probes or the empty string if not applicable. | |
virtualbool | hasInlineStackProbe (constMachineFunction &MF)const |
virtualStringRef | getStackProbeSymbolName (constMachineFunction &MF)const |
virtualbool | isFreeAddrSpaceCast (unsigned SrcAS,unsigned DestAS)const |
Returns true if a cast from SrcAS to DestAS is "cheap", such that e.g. | |
virtualbool | shouldAlignPointerArgs (CallInst *,unsigned &,Align &)const |
Return true if the pointer arguments to CI should be aligned by aligning the object whose address is being passed. | |
virtual void | emitAtomicCmpXchgNoStoreLLBalance (IRBuilderBase &Builder)const |
virtualbool | shouldSignExtendTypeInLibCall (Type *Ty,bool IsSigned)const |
Returns true if arguments should be sign-extended in lib calls. | |
virtualbool | shouldExtendTypeInLibCall (EVTType)const |
Returns true if arguments should be extended in lib calls. | |
virtualAtomicExpansionKind | shouldExpandAtomicLoadInIR (LoadInst *LI)const |
Returns how the given (atomic) load should be expanded by the IR-level AtomicExpand pass. | |
virtualAtomicExpansionKind | shouldCastAtomicLoadInIR (LoadInst *LI)const |
Returns how the given (atomic) load should be cast by the IR-level AtomicExpand pass. | |
virtualAtomicExpansionKind | shouldExpandAtomicStoreInIR (StoreInst *SI)const |
Returns how the given (atomic) store should be expanded by the IR-level AtomicExpand pass into. | |
virtualAtomicExpansionKind | shouldCastAtomicStoreInIR (StoreInst *SI)const |
Returns how the given (atomic) store should be cast by the IR-level AtomicExpand pass into. | |
virtualAtomicExpansionKind | shouldExpandAtomicCmpXchgInIR (AtomicCmpXchgInst *AI)const |
Returns how the given atomic cmpxchg should be expanded by the IR-level AtomicExpand pass. | |
virtualAtomicExpansionKind | shouldExpandAtomicRMWInIR (AtomicRMWInst *RMW)const |
Returns how the IR-level AtomicExpand pass should expand the given AtomicRMW, if at all. | |
virtualAtomicExpansionKind | shouldCastAtomicRMWIInIR (AtomicRMWInst *RMWI)const |
Returns how the given atomic atomicrmw should be cast by the IR-level AtomicExpand pass. | |
virtualLoadInst * | lowerIdempotentRMWIntoFencedLoad (AtomicRMWInst *RMWI)const |
On some platforms, an AtomicRMW that never actually modifies the value (such as fetch_add of 0) can be turned into a fence followed by an atomic load. | |
virtualISD::NodeType | getExtendForAtomicOps ()const |
Returns how the platform's atomic operations are extended (ZERO_EXTEND, SIGN_EXTEND, or ANY_EXTEND). | |
virtualISD::NodeType | getExtendForAtomicCmpSwapArg ()const |
Returns how the platform's atomic compare and swap expects its comparison value to be extended (ZERO_EXTEND, SIGN_EXTEND, or ANY_EXTEND). | |
virtualbool | shouldNormalizeToSelectSequence (LLVMContext &Context,EVT VT)const |
Returns true if we should normalize select(N0&N1, X, Y) => select(N0, select(N1, X, Y), Y) and select(N0|N1, X, Y) => select(N0, select(N1, X, Y, Y)) if it is likely that it saves us from materializing N0 and N1 in an integer register. | |
virtualbool | isProfitableToCombineMinNumMaxNum (EVT VT)const |
virtualbool | convertSelectOfConstantsToMath (EVT VT)const |
Return true if a select of constants (select Cond, C1, C2) should be transformed into simple math ops with the condition value. | |
virtualbool | decomposeMulByConstant (LLVMContext &Context,EVT VT,SDValueC)const |
Return true if it is profitable to transform an integer multiplication-by-constant into simpler operations like shifts and adds. | |
virtualbool | isMulAddWithConstProfitable (SDValue AddNode,SDValue ConstNode)const |
Return true if it may be profitable to transform (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2). | |
virtualbool | shouldUseStrictFP_TO_INT (EVT FpVT,EVT IntVT,bool IsSigned)const |
Return true if it is more correct/profitable to use strict FP_TO_INT conversion operations - canonicalizing the FP source value instead of converting all cases and then selecting based on value. | |
bool | isBeneficialToExpandPowI (int64_tExponent,bool OptForSize)const |
Return true if it is beneficial to expand an @llvm.powi. | |
virtualbool | getAddrModeArguments (constIntrinsicInst *,SmallVectorImpl<Value * > &,Type *&)const |
CodeGenPrepare sinks address calculations into the same BB as Load/Store instructions reading the address. | |
virtualbool | isLegalAddressingMode (constDataLayout &DL,constAddrMode &AM,Type *Ty,unsigned AddrSpace,Instruction *I=nullptr)const |
Return true if the addressing mode represented by AM is legal for this target, for a load/store of the specified type. | |
virtualbool | addressingModeSupportsTLS (constGlobalValue &)const |
Returns true if the targets addressing mode can target thread local storage (TLS). | |
virtual int64_t | getPreferredLargeGEPBaseOffset (int64_t MinOffset, int64_t MaxOffset)const |
Return the prefered common base offset. | |
virtualbool | isLegalICmpImmediate (int64_t)const |
Return true if the specified immediate is legal icmp immediate, that is the target has icmp instructions which can compare a register against the immediate without having to materialize the immediate into a register. | |
virtualbool | isLegalAddImmediate (int64_t)const |
Return true if the specified immediate is legal add immediate, that is the target has add instructions which can add a register with the immediate without having to materialize the immediate into a register. | |
virtualbool | isLegalAddScalableImmediate (int64_t)const |
Return true if adding the specified scalable immediate is legal, that is the target has add instructions which can add a register with the immediate (multiplied by vscale) without having to materialize the immediate into a register. | |
virtualbool | isLegalStoreImmediate (int64_tValue)const |
Return true if the specified immediate is legal for the value input of a store instruction. | |
virtualType * | shouldConvertSplatType (ShuffleVectorInst *SVI)const |
Given a shuffle vector SVI representing a vector splat, return a new scalar type of size equal to SVI's scalar type if the new type is more profitable. | |
virtualbool | shouldConvertPhiType (Type *From,Type *To)const |
Given a set in interconnected phis of type 'From' that are loaded/stored or bitcast to type 'To', return true if the set should be converted to 'To'. | |
virtualbool | isCommutativeBinOp (unsigned Opcode)const |
Returns true if the opcode is a commutative binary operation. | |
virtualbool | isBinOp (unsigned Opcode)const |
Return true if the node is a math/logic binary operator. | |
virtualbool | isTruncateFree (Type *FromTy,Type *ToTy)const |
Return true if it's free to truncate a value of type FromTy to type ToTy. | |
virtualbool | allowTruncateForTailCall (Type *FromTy,Type *ToTy)const |
Return true if a truncation from FromTy to ToTy is permitted when deciding whether a call is in tail position. | |
virtualbool | isTruncateFree (EVT FromVT,EVT ToVT)const |
virtualbool | isTruncateFree (LLT FromTy,LLT ToTy,LLVMContext &Ctx)const |
virtualbool | isTruncateFree (SDValue Val,EVT VT2)const |
Return true if truncating the specific node Val to type VT2 is free. | |
virtualbool | isProfitableToHoist (Instruction *I)const |
bool | isExtFree (constInstruction *I)const |
Return true if the extension represented byI is free. | |
bool | isExtLoad (constLoadInst *Load,constInstruction *Ext,constDataLayout &DL)const |
Return true ifLoad andExt can form an ExtLoad. | |
virtualbool | isZExtFree (Type *FromTy,Type *ToTy)const |
Return true if any actual instruction that defines a value of type FromTy implicitly zero-extends the value to ToTy in the result register. | |
virtualbool | isZExtFree (EVT FromTy,EVT ToTy)const |
virtualbool | isZExtFree (LLT FromTy,LLT ToTy,LLVMContext &Ctx)const |
virtualbool | isZExtFree (SDValue Val,EVT VT2)const |
Return true if zero-extending the specific node Val to type VT2 is free (either because it's implicitly zero-extended such asARM ldrb / ldrh or because it's folded such asX86 zero-extending loads). | |
virtualbool | isSExtCheaperThanZExt (EVT FromTy,EVT ToTy)const |
Return true if sign-extension from FromTy to ToTy is cheaper than zero-extension. | |
virtualbool | signExtendConstant (constConstantInt *C)const |
Return true if this constant should be sign extended when promoting to a larger type. | |
virtualbool | optimizeExtendOrTruncateConversion (Instruction *I,Loop *L,constTargetTransformInfo &TTI)const |
Try to optimize extending or truncating conversion instructions (like zext, trunc, fptoui, uitofp) for the target. | |
virtualbool | hasPairedLoad (EVT,Align &)const |
Return true if the target supplies and combines to a paired load two loaded values of type LoadedType next to each other in memory. | |
virtualbool | hasVectorBlend ()const |
Return true if the target has a vector blend instruction. | |
virtualunsigned | getMaxSupportedInterleaveFactor ()const |
Get the maximum supported factor for interleaved memory accesses. | |
virtualbool | lowerInterleavedLoad (LoadInst *LI,ArrayRef<ShuffleVectorInst * > Shuffles,ArrayRef<unsigned > Indices,unsigned Factor)const |
Lower an interleaved load to target specific intrinsics. | |
virtualbool | lowerInterleavedStore (StoreInst *SI,ShuffleVectorInst *SVI,unsigned Factor)const |
Lower an interleaved store to target specific intrinsics. | |
virtualbool | lowerDeinterleaveIntrinsicToLoad (LoadInst *LI,ArrayRef<Value * > DeinterleaveValues)const |
Lower a deinterleave intrinsic to a target specific load intrinsic. | |
virtualbool | lowerInterleaveIntrinsicToStore (StoreInst *SI,ArrayRef<Value * > InterleaveValues)const |
Lower an interleave intrinsic to a target specific store intrinsic. | |
virtualbool | isFPExtFree (EVT DestVT,EVT SrcVT)const |
Return true if an fpext operation is free (for instance, because single-precision floating-point numbers are implicitly extended to double-precision). | |
virtualbool | isFPExtFoldable (constMachineInstr &MI,unsigned Opcode,LLT DestTy,LLT SrcTy)const |
Return true if an fpext operation input to anOpcode operation is free (for instance, because half-precision floating-point numbers are implicitly extended to float-precision) for an FMA instruction. | |
virtualbool | isFPExtFoldable (constSelectionDAG &DAG,unsigned Opcode,EVT DestVT,EVT SrcVT)const |
Return true if an fpext operation input to anOpcode operation is free (for instance, because half-precision floating-point numbers are implicitly extended to float-precision) for an FMA instruction. | |
virtualbool | isVectorLoadExtDesirable (SDValue ExtVal)const |
Return true if folding a vector load into ExtVal (a sign, zero, or any extend node) is profitable. | |
virtualbool | isFNegFree (EVT VT)const |
Return true if an fneg operation is free to the point where it is never worthwhile to replace it with a bitwise operation. | |
virtualbool | isFAbsFree (EVT VT)const |
Return true if an fabs operation is free to the point where it is never worthwhile to replace it with a bitwise operation. | |
virtualbool | isFMAFasterThanFMulAndFAdd (constMachineFunction &MF,EVT)const |
Return true if an FMA operation is faster than a pair of fmul and fadd instructions. | |
virtualbool | isFMAFasterThanFMulAndFAdd (constMachineFunction &MF,LLT)const |
Return true if an FMA operation is faster than a pair of fmul and fadd instructions. | |
virtualbool | isFMAFasterThanFMulAndFAdd (constFunction &F,Type *)const |
IR version. | |
virtualbool | isFMADLegal (constMachineInstr &MI,LLT Ty)const |
Returns true ifMI can be combined with another instruction to form TargetOpcode::G_FMAD. | |
virtualbool | isFMADLegal (constSelectionDAG &DAG,constSDNode *N)const |
Returns true if be combined with to form anISD::FMAD. | |
virtualbool | generateFMAsInMachineCombiner (EVT VT,CodeGenOptLevel OptLevel)const |
virtualbool | isNarrowingProfitable (SDNode *N,EVT SrcVT,EVT DestVT)const |
Return true if it's profitable to narrow operations of type SrcVT to DestVT. | |
virtualbool | shouldFoldSelectWithIdentityConstant (unsigned BinOpcode,EVT VT)const |
Return true if pulling a binary operation into a select with an identity constant is profitable. | |
virtualbool | shouldConvertConstantLoadToIntImm (constAPInt &Imm,Type *Ty)const |
Return true if it is beneficial to convert a load of a constant to just the constant itself. | |
virtualbool | isExtractSubvectorCheap (EVT ResVT,EVT SrcVT,unsignedIndex)const |
Return true if EXTRACT_SUBVECTOR is cheap for extracting this result type from this source type with this index. | |
virtualbool | shouldScalarizeBinop (SDValue VecOp)const |
Try to convert an extract element of a vector binary operation into an extract element followed by a scalar operation. | |
virtualbool | isExtractVecEltCheap (EVT VT,unsignedIndex)const |
Return true if extraction of a scalar element from the given vector type at the given index is cheap. | |
virtualbool | shouldFormOverflowOp (unsigned Opcode,EVT VT,bool MathUsed)const |
Try to convert math with an overflow comparison into the corresponding DAG node operation. | |
virtualbool | aggressivelyPreferBuildVectorSources (EVT VecVT)const |
virtualbool | shouldConsiderGEPOffsetSplit ()const |
virtualbool | shouldAvoidTransformToShift (EVT VT,unsigned Amount)const |
Return true if creating a shift of the type by the given amount is not profitable. | |
virtualbool | shouldFoldSelectWithSingleBitTest (EVT VT,constAPInt &AndMask)const |
virtualbool | shouldKeepZExtForFP16Conv ()const |
Does this target require the clearing of high-order bits in a register passed to the fp16 to fp conversion library function. | |
virtualbool | shouldConvertFpToSat (unsignedOp,EVT FPVT,EVT VT)const |
Should we generate fp_to_si_sat and fp_to_ui_sat from type FPVT to type VT from min(max(fptoi)) saturation patterns. | |
virtualbool | shouldExpandCmpUsingSelects (EVT VT)const |
Should we expand [US]CMP nodes using two selects and two compares, or by doing arithmetic on boolean types. | |
virtualbool | isComplexDeinterleavingSupported ()const |
Does this target support complex deinterleaving. | |
virtualbool | isComplexDeinterleavingOperationSupported (ComplexDeinterleavingOperationOperation,Type *Ty)const |
Does this target support complex deinterleaving with the given operation and type. | |
virtualValue * | createComplexDeinterleavingIR (IRBuilderBase &B,ComplexDeinterleavingOperation OperationType,ComplexDeinterleavingRotation Rotation,Value *InputA,Value *InputB,Value *Accumulator=nullptr)const |
Create the IR node for the given complex deinterleaving operation. | |
void | setLibcallName (RTLIB::Libcall Call,constchar *Name) |
Rename the default libcall routine name for the specified libcall. | |
void | setLibcallName (ArrayRef<RTLIB::Libcall > Calls,constchar *Name) |
constchar * | getLibcallName (RTLIB::Libcall Call)const |
Get the libcall routine name for the specified libcall. | |
void | setCmpLibcallCC (RTLIB::Libcall Call,ISD::CondCodeCC) |
Override the default CondCode to be used to test the result of the comparison libcall against zero. | |
ISD::CondCode | getCmpLibcallCC (RTLIB::Libcall Call)const |
Get the CondCode that's to be used to test the result of the comparison libcall against zero. | |
void | setLibcallCallingConv (RTLIB::Libcall Call,CallingConv::IDCC) |
Set theCallingConv that should be used for the specified libcall. | |
CallingConv::ID | getLibcallCallingConv (RTLIB::Libcall Call)const |
Get theCallingConv that should be used for the specified libcall. | |
virtual void | finalizeLowering (MachineFunction &MF)const |
Execute target specific actions to finalize target lowering. | |
virtualbool | shouldLocalize (constMachineInstr &MI,constTargetTransformInfo *TTI)const |
Check whether or notMI needs to be moved close to its uses. | |
int | InstructionOpcodeToISD (unsigned Opcode)const |
Get theISD node that corresponds to theInstruction class opcode. | |
int | IntrinsicIDToISD (Intrinsic::IDID)const |
Get theISD node that corresponds to theIntrinsic ID. | |
unsigned | getMaxAtomicSizeInBitsSupported ()const |
Returns the maximum atomic operation size (in bits) supported by the backend. | |
unsigned | getMaxDivRemBitWidthSupported ()const |
Returns the size in bits of the maximum div/rem the backend supports. | |
unsigned | getMaxLargeFPConvertBitWidthSupported ()const |
Returns the size in bits of the maximum larget fp convert the backend supports. | |
unsigned | getMinCmpXchgSizeInBits ()const |
Returns the size of the smallest cmpxchg or ll/sc instruction the backend supports. | |
bool | supportsUnalignedAtomics ()const |
Whether the target supports unaligned atomic operations. | |
virtualbool | shouldInsertFencesForAtomic (constInstruction *I)const |
WhetherAtomicExpandPass should automatically insert fences and reduce ordering for this atomic. | |
virtualbool | shouldInsertTrailingFenceForAtomicStore (constInstruction *I)const |
WhetherAtomicExpandPass should automatically insert a trailing fence without reducing the ordering for this atomic. | |
virtualValue * | emitLoadLinked (IRBuilderBase &Builder,Type *ValueTy,Value *Addr,AtomicOrdering Ord)const |
Perform a load-linked operation on Addr, returning a "Value *" with the corresponding pointee type. | |
virtualValue * | emitStoreConditional (IRBuilderBase &Builder,Value *Val,Value *Addr,AtomicOrdering Ord)const |
Perform a store-conditional operation to Addr. | |
virtualValue * | emitMaskedAtomicRMWIntrinsic (IRBuilderBase &Builder,AtomicRMWInst *AI,Value *AlignedAddr,Value *Incr,Value *Mask,Value *ShiftAmt,AtomicOrdering Ord)const |
Perform a masked atomicrmw using a target-specific intrinsic. | |
virtual void | emitExpandAtomicRMW (AtomicRMWInst *AI)const |
Perform a atomicrmw expansion using a target-specific way. | |
virtual void | emitExpandAtomicCmpXchg (AtomicCmpXchgInst *CI)const |
Perform a cmpxchg expansion using a target-specific method. | |
virtual void | emitBitTestAtomicRMWIntrinsic (AtomicRMWInst *AI)const |
Perform a bit test atomicrmw using a target-specific intrinsic. | |
virtual void | emitCmpArithAtomicRMWIntrinsic (AtomicRMWInst *AI)const |
Perform a atomicrmw which the result is only used by comparison, using a target-specific intrinsic. | |
virtualValue * | emitMaskedAtomicCmpXchgIntrinsic (IRBuilderBase &Builder,AtomicCmpXchgInst *CI,Value *AlignedAddr,Value *CmpVal,Value *NewVal,Value *Mask,AtomicOrdering Ord)const |
Perform a masked cmpxchg using a target-specific intrinsic. | |
virtualMachineInstr * | EmitKCFICheck (MachineBasicBlock &MBB,MachineBasicBlock::instr_iterator &MBBI,constTargetInstrInfo *TII)const |
virtualInstruction * | emitLeadingFence (IRBuilderBase &Builder,Instruction *Inst,AtomicOrdering Ord)const |
Inserts in the IR a target-specific intrinsic specifying a fence. | |
virtualInstruction * | emitTrailingFence (IRBuilderBase &Builder,Instruction *Inst,AtomicOrdering Ord)const |
Additional Inherited Members | |
![]() | |
staticISD::NodeType | getExtendForContent (BooleanContentContent) |
![]() | |
void | initActions () |
Initialize all of the actions to default values. | |
Value * | getDefaultSafeStackPointerLocation (IRBuilderBase &IRB,bool UseTLS)const |
void | setBooleanContents (BooleanContent Ty) |
Specify how the target extends the result of integer and floating point boolean values from i1 to a wider type. | |
void | setBooleanContents (BooleanContent IntTy,BooleanContent FloatTy) |
Specify how the target extends the result of integer and floating point boolean values from i1 to a wider type. | |
void | setBooleanVectorContents (BooleanContent Ty) |
Specify how the target extends the result of a vector boolean value from a vector of i1 to a wider type. | |
void | setSchedulingPreference (Sched::Preference Pref) |
Specify the target scheduling preference. | |
void | setMinimumJumpTableEntries (unsigned Val) |
Indicate the minimum number of blocks to generate jump tables. | |
void | setMaximumJumpTableSize (unsigned) |
Indicate the maximum number of entries in jump tables. | |
void | setStackPointerRegisterToSaveRestore (Register R) |
If set to a physical register, this specifies the register that llvm.savestack/llvm.restorestack should save and restore. | |
void | setHasMultipleConditionRegisters (bool hasManyRegs=true) |
Tells the code generator that the target has multiple (allocatable) condition registers that can be used to store the results of comparisons for use by selects and conditional branches. | |
void | setHasExtractBitsInsn (bool hasExtractInsn=true) |
Tells the code generator that the target has BitExtract instructions. | |
void | setJumpIsExpensive (bool isExpensive=true) |
Tells the code generator not to expand logic operations on comparison predicates into separate sequences that increase the amount of flow control. | |
void | addBypassSlowDiv (unsigned int SlowBitWidth,unsigned int FastBitWidth) |
Tells the code generator which bitwidths to bypass. | |
void | addRegisterClass (MVT VT,constTargetRegisterClass *RC) |
Add the specified register class as an available regclass for the specified value type. | |
virtual std::pair<constTargetRegisterClass *,uint8_t > | findRepresentativeClass (constTargetRegisterInfo *TRI,MVT VT)const |
Return the largest legal super-reg register class of the register class for the specified type and its associated "cost". | |
void | computeRegisterProperties (constTargetRegisterInfo *TRI) |
Once all of the register classes are added, this allows us to compute derived properties we expose. | |
void | setOperationAction (unsignedOp,MVT VT,LegalizeAction Action) |
Indicate that the specified operation does not work with the specified type and indicate what to do about it. | |
void | setOperationAction (ArrayRef<unsigned > Ops,MVT VT,LegalizeAction Action) |
void | setOperationAction (ArrayRef<unsigned > Ops,ArrayRef<MVT > VTs,LegalizeAction Action) |
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 what to do about it. | |
void | setLoadExtAction (ArrayRef<unsigned > ExtTypes,MVT ValVT,MVT MemVT,LegalizeAction Action) |
void | setLoadExtAction (ArrayRef<unsigned > ExtTypes,MVT ValVT,ArrayRef<MVT > MemVTs,LegalizeAction Action) |
void | setAtomicLoadExtAction (unsigned ExtType,MVT ValVT,MVT MemVT,LegalizeAction Action) |
Let target indicate that an extending atomic load of the specified type is legal. | |
void | setAtomicLoadExtAction (ArrayRef<unsigned > ExtTypes,MVT ValVT,MVT MemVT,LegalizeAction Action) |
void | setAtomicLoadExtAction (ArrayRef<unsigned > ExtTypes,MVT ValVT,ArrayRef<MVT > MemVTs,LegalizeAction Action) |
void | setTruncStoreAction (MVT ValVT,MVT MemVT,LegalizeAction Action) |
Indicate that the specified truncating store does not work with the specified type and indicate what to do about it. | |
void | setIndexedLoadAction (ArrayRef<unsigned > IdxModes,MVT VT,LegalizeAction Action) |
Indicate that the specified indexed load does or does not work with the specified type and indicate what to do abort it. | |
void | setIndexedLoadAction (ArrayRef<unsigned > IdxModes,ArrayRef<MVT > VTs,LegalizeAction Action) |
void | setIndexedStoreAction (ArrayRef<unsigned > IdxModes,MVT VT,LegalizeAction Action) |
Indicate that the specified indexed store does or does not work with the specified type and indicate what to do about it. | |
void | setIndexedStoreAction (ArrayRef<unsigned > IdxModes,ArrayRef<MVT > VTs,LegalizeAction Action) |
void | setIndexedMaskedLoadAction (unsigned IdxMode,MVT VT,LegalizeAction Action) |
Indicate that the specified indexed masked load does or does not work with the specified type and indicate what to do about it. | |
void | setIndexedMaskedStoreAction (unsigned IdxMode,MVT VT,LegalizeAction Action) |
Indicate that the specified indexed masked store does or does not work with the specified type and indicate what to do about it. | |
void | setCondCodeAction (ArrayRef<ISD::CondCode > CCs,MVT VT,LegalizeAction Action) |
Indicate that the specified condition code is or isn't supported on the target and indicate what to do about it. | |
void | setCondCodeAction (ArrayRef<ISD::CondCode > CCs,ArrayRef<MVT > VTs,LegalizeAction Action) |
void | AddPromotedToType (unsigned Opc,MVT OrigVT,MVT DestVT) |
If Opc/OrigVT is specified as being promoted, the promotion code defaults to trying a larger integer/fp until it can find one that works. | |
void | setOperationPromotedToType (unsigned Opc,MVT OrigVT,MVT DestVT) |
Convenience method to set an operation to Promote and specify the type in a single call. | |
void | setOperationPromotedToType (ArrayRef<unsigned > Ops,MVT OrigVT,MVT DestVT) |
void | setTargetDAGCombine (ArrayRef<ISD::NodeType > NTs) |
Targets should invoke this method for each target independent node that they want to provide a custom DAG combiner for by implementing the PerformDAGCombine virtual method. | |
void | setMinFunctionAlignment (Align Alignment) |
Set the target's minimum function alignment. | |
void | setPrefFunctionAlignment (Align Alignment) |
Set the target's preferred function alignment. | |
void | setPrefLoopAlignment (Align Alignment) |
Set the target's preferred loop alignment. | |
void | setMaxBytesForAlignment (unsigned MaxBytes) |
void | setMinStackArgumentAlignment (Align Alignment) |
Set the minimum stack alignment of an argument. | |
void | setMaxAtomicSizeInBitsSupported (unsigned SizeInBits) |
Set the maximum atomic operation size supported by the backend. | |
void | setMaxDivRemBitWidthSupported (unsigned SizeInBits) |
Set the size in bits of the maximum div/rem the backend supports. | |
void | setMaxLargeFPConvertBitWidthSupported (unsigned SizeInBits) |
Set the size in bits of the maximum fp convert the backend supports. | |
void | setMinCmpXchgSizeInBits (unsigned SizeInBits) |
Sets the minimum cmpxchg or ll/sc size supported by the backend. | |
void | setSupportsUnalignedAtomics (bool UnalignedSupported) |
Sets whether unaligned atomic operations are supported. | |
virtualbool | isExtFreeImpl (constInstruction *I)const |
Return true if the extension represented byI is free. | |
bool | isLegalRC (constTargetRegisterInfo &TRI,constTargetRegisterClass &RC)const |
Return true if the value types that can be represented by the specified register class are all legal. | |
MachineBasicBlock * | emitPatchPoint (MachineInstr &MI,MachineBasicBlock *MBB)const |
Replace/modify any TargetFrameIndex operands with a targte-dependent sequence of memory operands that is recognized by PrologEpilogInserter. | |
![]() | |
unsigned | GatherAllAliasesMaxDepth |
Depth that GatherAllAliases should continue looking for chain dependencies when trying to find a more preferable chain. | |
unsigned | MaxStoresPerMemset |
Specify maximum number of store instructions per memset call. | |
unsigned | MaxStoresPerMemsetOptSize |
Likewise for functions with the OptSize attribute. | |
unsigned | MaxStoresPerMemcpy |
Specify maximum number of store instructions per memcpy call. | |
unsigned | MaxStoresPerMemcpyOptSize |
Likewise for functions with the OptSize attribute. | |
unsigned | MaxGluedStoresPerMemcpy = 0 |
Specify max number of store instructions to glue in inlined memcpy. | |
unsigned | MaxLoadsPerMemcmp |
Specify maximum number of load instructions per memcmp call. | |
unsigned | MaxLoadsPerMemcmpOptSize |
Likewise for functions with the OptSize attribute. | |
unsigned | MaxStoresPerMemmove |
Specify maximum number of store instructions per memmove call. | |
unsigned | MaxStoresPerMemmoveOptSize |
Likewise for functions with the OptSize attribute. | |
bool | PredictableSelectIsExpensive |
Tells the code generator that select is more expensive than a branch if the branch is usually predicted right. | |
bool | EnableExtLdPromotion |
bool | IsStrictFPEnabled |
This class defines information used to lower LLVM code to legalSelectionDAG operators that the target instruction selector can accept natively.
This class also defines callbacks that targets must implement to lower target-specific constructs toSelectionDAG operators.
Definition at line3780 of fileTargetLowering.h.
usingllvm::TargetLowering::AsmOperandInfoVector = std::vector<AsmOperandInfo> |
Definition at line5008 of fileTargetLowering.h.
Definition at line5040 of fileTargetLowering.h.
usingllvm::TargetLowering::ConstraintPair = std::pair<StringRef,TargetLowering::ConstraintType> |
Definition at line5039 of fileTargetLowering.h.
Enumerator | |
---|---|
C_Register | |
C_RegisterClass | |
C_Memory | |
C_Address | |
C_Immediate | |
C_Other | |
C_Unknown |
Definition at line4950 of fileTargetLowering.h.
Enumerator | |
---|---|
CW_Invalid | |
CW_Okay | |
CW_Good | |
CW_Better | |
CW_Best | |
CW_SpecificReg | |
CW_Register | |
CW_Memory | |
CW_Constant | |
CW_Default |
Definition at line4960 of fileTargetLowering.h.
| delete |
| explicit |
NOTE: TheTargetMachine owns TLOF.
Definition at line40 of fileTargetLowering.cpp.
| virtual |
This method should be implemented by targets that mark instructions with the 'hasPostISelHook' flag.
These instructions must be adjusted after instruction selection by target hooks. e.g. To fill in optional defs forARM 's' setting instructions.
Reimplemented inllvm::SITargetLowering,llvm::ARMTargetLowering,llvm::HexagonTargetLowering,llvm::MipsTargetLowering,llvm::RISCVTargetLowering, andllvm::SparcTargetLowering.
Definition at line326 of fileSelectionDAGISel.cpp.
SDValue TargetLowering::buildLegalVectorShuffle | ( | EVT | VT, |
constSDLoc & | DL, | ||
SDValue | N0, | ||
SDValue | N1, | ||
MutableArrayRef< int > | Mask, | ||
SelectionDAG & | DAG | ||
) | const |
Tries to build a legal vector shuffle using the provided parameters or equivalent variations.
The Mask argument maybe be modified as the function tries different variations. Returns an emptySDValue if the operation fails.
Definition at line3867 of fileTargetLowering.cpp.
Referencesllvm::ShuffleVectorSDNode::commuteMask(),DL,llvm::SelectionDAG::getVectorShuffle(),llvm::TargetLoweringBase::isShuffleMaskLegal(), andstd::swap().
Referenced bycombineConcatVectorOfExtracts(), andreduceBuildVecToShuffleWithZero().
SDValue TargetLowering::BuildSDIV | ( | SDNode * | N, |
SelectionDAG & | DAG, | ||
bool | IsAfterLegalization, | ||
bool | IsAfterLegalTypes, | ||
SmallVectorImpl<SDNode * > & | Created | ||
) | const |
Given anISD::SDIV node expressing a divide by constant, return a DAG expression to select that will generate the same value by multiplying by a magic number.
Ref: "Hacker's Delight" or "The PowerPC Compiler Writer's Guide".
Definition at line6331 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::ISD::AND,assert(),llvm::ISD::BUILD_VECTOR,BuildExactSDIV(),llvm::CallingConv::C,llvm::SignedDivisionByConstantInfo::get(),llvm::SelectionDAG::getBuildVector(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::EVT::getIntegerVT(),llvm::SDValue::getNode(),llvm::SelectionDAG::getNode(),llvm::SDValue::getOpcode(),llvm::EVT::getScalarSizeInBits(),llvm::EVT::getScalarType(),llvm::APInt::getSExtValue(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::TargetLoweringBase::getShiftAmountTy(),llvm::SelectionDAG::getSignedConstant(),llvm::EVT::getSimpleVT(),llvm::EVT::getSizeInBits(),llvm::SelectionDAG::getSplatVector(),llvm::TargetLoweringBase::getTypeAction(),llvm::TargetLoweringBase::getTypeToTransformTo(),llvm::EVT::getVectorElementCount(),llvm::EVT::getVectorVT(),llvm::SelectionDAG::getVTList(),llvm::APInt::isAllOnes(),llvm::APInt::isNegative(),llvm::APInt::isOne(),llvm::TargetLoweringBase::isOperationCustom(),llvm::TargetLoweringBase::isOperationExpand(),llvm::TargetLoweringBase::isOperationLegal(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isSimple(),llvm::APInt::isStrictlyPositive(),llvm::TargetLoweringBase::isTypeLegal(),llvm::EVT::isVector(),llvm::SignedDivisionByConstantInfo::Magic,llvm::ISD::matchUnaryPredicate(),llvm::ISD::MUL,llvm::ISD::MULHS,N,llvm::SmallVectorTemplateBase< T, bool >::push_back(),llvm::ISD::SDIV,llvm::ISD::SDIVREM,llvm::SignedDivisionByConstantInfo::ShiftAmount,llvm::ISD::SIGN_EXTEND,llvm::SmallVectorBase< Size_T >::size(),Size,llvm::ISD::SMUL_LOHI,llvm::ISD::SPLAT_VECTOR,llvm::ISD::SRA,llvm::ISD::SRL,llvm::ISD::TRUNCATE,llvm::TargetLoweringBase::TypePromoteInteger,X, andY.
| virtual |
Targets may override this function to provide custom SDIV lowering for power-of-2 denominators.
If the target returns an emptySDValue, LLVM assumes SDIV is expensive and replaces it with a series of other integer operations.
Reimplemented inllvm::PPCTargetLowering.
Definition at line6265 of fileTargetLowering.cpp.
Referencesllvm::Function::getAttributes(),llvm::MachineFunction::getFunction(),llvm::SelectionDAG::getMachineFunction(),llvm::TargetLoweringBase::isIntDivCheap(), andN.
SDValue TargetLowering::buildSDIVPow2WithCMov | ( | SDNode * | N, |
constAPInt & | Divisor, | ||
SelectionDAG & | DAG, | ||
SmallVectorImpl<SDNode * > & | Created | ||
) | const |
Build sdiv by power-of-2 with conditional move instructions Ref: "Hacker's Delight" by Henry Warren 10-1 If conditional move/branch is preferred, we lower sdiv x, +/-2**k into: bgez x, label add x, x, 2**k-1 label: sra res, x, k neg res, res (when the divisor is negative)
Definition at line6292 of fileTargetLowering.cpp.
Referencesllvm::Add,llvm::ISD::ADD,llvm::APInt::countr_zero(),DL,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::APInt::getLowBitsSet(),llvm::SDValue::getNode(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::EVT::getSizeInBits(),llvm::APInt::isNonNegative(),N,llvm::SmallVectorTemplateBase< T, bool >::push_back(),llvm::ISD::SELECT,llvm::ISD::SETLT,llvm::ISD::SRA, andllvm::ISD::SUB.
| virtual |
Targets may override this function to provide custom SREM lowering for power-of-2 denominators.
If the target returns an emptySDValue, LLVM assumes SREM is expensive and replaces it with a series of other integer operations.
Definition at line6275 of fileTargetLowering.cpp.
Referencesllvm::Function::getAttributes(),llvm::MachineFunction::getFunction(),llvm::SelectionDAG::getMachineFunction(),llvm::TargetLoweringBase::isIntDivCheap(), andN.
SDValue TargetLowering::BuildUDIV | ( | SDNode * | N, |
SelectionDAG & | DAG, | ||
bool | IsAfterLegalization, | ||
bool | IsAfterLegalTypes, | ||
SmallVectorImpl<SDNode * > & | Created | ||
) | const |
Given anISD::UDIV node expressing a divide by constant, return a DAG expression to select that will generate the same value by multiplying by a magic number.
Ref: "Hacker's Delight" or "The PowerPC Compiler Writer's Guide".
Definition at line6499 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,assert(),llvm::ISD::BUILD_VECTOR,BuildExactUDIV(),llvm::CallingConv::C,llvm::SelectionDAG::computeKnownBits(),llvm::APInt::countl_zero(),llvm::KnownBits::countMinLeadingZeros(),llvm::UnsignedDivisionByConstantInfo::get(),llvm::APInt::getBitWidth(),llvm::SelectionDAG::getBuildVector(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::EVT::getIntegerVT(),llvm::SDValue::getNode(),llvm::SelectionDAG::getNode(),llvm::APInt::getOneBitSet(),llvm::SDValue::getOpcode(),llvm::EVT::getScalarSizeInBits(),llvm::EVT::getScalarType(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::TargetLoweringBase::getShiftAmountTy(),llvm::EVT::getSimpleVT(),llvm::EVT::getSizeInBits(),llvm::SelectionDAG::getSplatVector(),llvm::TargetLoweringBase::getTypeAction(),llvm::TargetLoweringBase::getTypeToTransformTo(),llvm::SelectionDAG::getUNDEF(),llvm::EVT::getVectorElementCount(),llvm::EVT::getVectorVT(),llvm::SelectionDAG::getVTList(),llvm::APInt::getZero(),llvm::UnsignedDivisionByConstantInfo::IsAdd,llvm::APInt::isOne(),llvm::TargetLoweringBase::isOperationCustom(),llvm::TargetLoweringBase::isOperationExpand(),llvm::TargetLoweringBase::isOperationLegal(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isSimple(),llvm::TargetLoweringBase::isTypeLegal(),llvm::EVT::isVector(),llvm::UnsignedDivisionByConstantInfo::Magic,llvm::ISD::matchUnaryPredicate(),llvm::ISD::MUL,llvm::ISD::MULHU,N,llvm::UnsignedDivisionByConstantInfo::PostShift,llvm::UnsignedDivisionByConstantInfo::PreShift,llvm::SmallVectorTemplateBase< T, bool >::push_back(),llvm::ISD::SETEQ,llvm::SmallVectorBase< Size_T >::size(),Size,llvm::ISD::SPLAT_VECTOR,llvm::ISD::SRL,llvm::ISD::SUB,llvm::ISD::TRUNCATE,llvm::TargetLoweringBase::TypePromoteInteger,llvm::ISD::UDIV,llvm::ISD::UDIVREM,llvm::ISD::UMUL_LOHI,X,Y, andllvm::ISD::ZERO_EXTEND.
| virtual |
Return true if Op can create undef or poison from non-undef & non-poison operands.
The DemandedElts argument limits the check to the requested vector elements.
Reimplemented inllvm::RISCVTargetLowering, andllvm::X86TargetLowering.
Definition at line3908 of fileTargetLowering.cpp.
Referencesassert(),llvm::ISD::BUILTIN_OP_END,llvm::ISD::INTRINSIC_VOID,llvm::ISD::INTRINSIC_W_CHAIN, andllvm::ISD::INTRINSIC_WO_CHAIN.
Referenced byllvm::SelectionDAG::canCreateUndefOrPoison(),llvm::RISCVTargetLowering::canCreateUndefOrPoisonForTargetNode(), andllvm::X86TargetLowering::canCreateUndefOrPoisonForTargetNode().
| inlinevirtual |
This hook should be implemented to check whether the return values described by the Outs array can fit into the return registers.
If false is returned, an sret-demotion is performed.
Reimplemented inllvm::VETargetLowering,llvm::SITargetLowering,llvm::HexagonTargetLowering,llvm::LanaiTargetLowering,llvm::LoongArchTargetLowering,llvm::RISCVTargetLowering,llvm::SparcTargetLowering,llvm::SystemZTargetLowering, andllvm::XtensaTargetLowering.
Definition at line4781 of fileTargetLowering.h.
Referenced byllvm::FastISel::lowerCallTo(),LowerCallTo(), andllvm::FunctionLoweringInfo::set().
| inlinevirtual |
Allows the target to handle physreg-carried dependency in target-specific way.
Used from theScheduleDAGSDNodes to decide whether to add the edge to the dependency graph. Def - input: Selection DAG node defininfg physical registerUser - input: Selection DAG node using physical register Op - input: Number ofUser operand PhysReg - inout: set to the physical register if the edge is necessary, unchanged otherwise Cost - inout: physical register copy cost. Returns 'true' is the edge is necessary, 'false' otherwise
Reimplemented inllvm::SITargetLowering.
Definition at line4490 of fileTargetLowering.h.
Referenced byCheckForPhysRegDependency().
| virtual |
Reimplemented inllvm::SITargetLowering, andllvm::PPCTargetLowering.
Definition at line5664 of fileTargetLowering.cpp.
| inlinevirtual |
Indicate whether this target prefers to combine FDIVs with the same divisor.
If the transform should never be done, return zero. If the transform should be done, return the minimum number of divisor uses that must exist.
Reimplemented inllvm::SITargetLowering, andllvm::NVPTXTargetLowering.
Definition at line5132 of fileTargetLowering.h.
| virtual |
Determines the constraint code and constraint type to use for the specificAsmOperandInfo, setting OpInfo.ConstraintCode and OpInfo.ConstraintType.
If the actual operand being passed in is available, it can be passed in as Op, otherwise an emptySDValue can be passed.
Definition at line6088 of fileTargetLowering.cpp.
Referencesassert(),C_Immediate,C_Other,llvm::TargetLowering::AsmOperandInfo::CallOperandVal,llvm::InlineAsm::ConstraintInfo::Codes,llvm::TargetLowering::AsmOperandInfo::ConstraintCode,llvm::TargetLowering::AsmOperandInfo::ConstraintType,llvm::TargetLowering::AsmOperandInfo::ConstraintVT,G, andlowerImmediateIfPossible().
Referenced byllvm::GCNTTIImpl::isInlineAsmSourceOfDivergence(),IsOperandAMemoryOperand(),llvm::SITargetLowering::requiresUniformRegister(), andllvm::FunctionLoweringInfo::set().
| virtual |
Determine the known alignment for the pointer valueR
.
This is can typically be inferred from the number of low known 0 bits. However, for a pointer with a non-integral address space, the alignment value may be independent from the known low bits.
Reimplemented inllvm::SITargetLowering.
Definition at line3801 of fileTargetLowering.cpp.
Referenced byllvm::GISelKnownBits::computeKnownAlignment().
| virtual |
Determine which of the bits of FrameIndexFIOp
are known to be 0.
Default implementation computes low bits based on alignment information. This should preserve known bits passed into it.
Reimplemented inllvm::SITargetLowering.
Definition at line3795 of fileTargetLowering.cpp.
Referencesllvm::MachineFunction::getFrameInfo(),llvm::MachineFrameInfo::getObjectAlign(),llvm::Log2(),llvm::APInt::setLowBits(), andllvm::KnownBits::Zero.
Referenced byllvm::SelectionDAG::computeKnownBits(),llvm::SITargetLowering::computeKnownBitsForFrameIndex(), andllvm::GISelKnownBits::computeKnownBitsImpl().
| virtual |
Determine which of the bits specified in Mask are known to be either zero or one and return them in the KnownZero/KnownOne bitsets.
The DemandedElts argument allows us to only collect the known bits that are shared by the requested vector elements. This is for GISel.
Reimplemented inllvm::SITargetLowering.
Definition at line3788 of fileTargetLowering.cpp.
Referencesllvm::KnownBits::resetAll().
Referenced byllvm::GISelKnownBits::computeKnownBitsImpl().
| virtual |
Determine which of the bits specified in Mask are known to be either zero or one and return them in the KnownZero/KnownOne bitsets.
Determine which of the bits specified in Mask are known to be either zero or one and return them in the Known.
The DemandedElts argument allows us to only collect the known bits that are shared by the requested vector elements.
Reimplemented inllvm::ARMTargetLowering,llvm::RISCVTargetLowering,llvm::AArch64TargetLowering,llvm::AMDGPUTargetLowering,llvm::SITargetLowering,llvm::LanaiTargetLowering,llvm::PPCTargetLowering,llvm::SparcTargetLowering,llvm::SystemZTargetLowering, andllvm::X86TargetLowering.
Definition at line3774 of fileTargetLowering.cpp.
Referencesassert(),llvm::ISD::BUILTIN_OP_END,llvm::ISD::INTRINSIC_VOID,llvm::ISD::INTRINSIC_W_CHAIN,llvm::ISD::INTRINSIC_WO_CHAIN, andllvm::KnownBits::resetAll().
Referenced byllvm::SelectionDAG::computeKnownBits().
| virtual |
This method can be implemented by targets that want to expose additional information about sign bits to GlobalISel combiners.
The DemandedElts argument allows us to only collect the minimum sign bits that are shared by the requested vector elements.
Reimplemented inllvm::AMDGPUTargetLowering.
Definition at line3822 of fileTargetLowering.cpp.
Referenced byllvm::GISelKnownBits::computeNumSignBits().
| virtual |
This method can be implemented by targets that want to expose additional information about sign bits to the DAGCombiner.
The DemandedElts argument allows us to only collect the minimum sign bits that are shared by the requested vector elements.
Reimplemented inllvm::AArch64TargetLowering,llvm::RISCVTargetLowering,llvm::SystemZTargetLowering,llvm::X86TargetLowering, andllvm::AMDGPUTargetLowering.
Definition at line3809 of fileTargetLowering.cpp.
Referencesassert(),llvm::ISD::BUILTIN_OP_END,llvm::ISD::INTRINSIC_VOID,llvm::ISD::INTRINSIC_W_CHAIN, andllvm::ISD::INTRINSIC_WO_CHAIN.
Referenced byllvm::SelectionDAG::ComputeNumSignBits().
| inlinevirtual |
This method returns a target specificFastISel object, or null if the target does not support "fast" ISel.
Reimplemented inllvm::AArch64TargetLowering,llvm::ARMTargetLowering,llvm::MipsTargetLowering,llvm::PPCTargetLowering, andllvm::X86TargetLowering.
Definition at line4925 of fileTargetLowering.h.
SDValue TargetLowering::createSelectForFMINNUM_FMAXNUM | ( | SDNode * | Node, |
SelectionDAG & | DAG | ||
) | const |
Try to convert the fminnum/fmaxnum to a compare/select sequence.
This is required for correctness since InstCombine might have canonicalized a fcmp+select sequence to a FMINNUM/FMAXNUM intrinsic. If we were to fall through to the default expansion/soften to libcall, we might introduce a link-time dependency on libm into a file that originally did not have one.
Definition at line8463 of fileTargetLowering.cpp.
Referencesassert(),llvm::ISD::FMAXNUM,llvm::ISD::FMINNUM,llvm::SelectionDAG::getSelectCC(),llvm::EVT::getSimpleVT(),llvm::TargetLoweringBase::isCondCodeLegal(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isVector(),llvm::SDNodeFlags::NoSignedZeros,llvm::SDNode::setFlags(),llvm::ISD::SETGT,llvm::ISD::SETLT,llvm::ISD::STRICT_FMAXNUM,llvm::ISD::STRICT_FMINNUM, andllvm::ISD::VSELECT.
SDValue TargetLowering::CTTZTableLookup | ( | SDNode * | N, |
SelectionDAG & | DAG, | ||
constSDLoc & | DL, | ||
EVT | VT, | ||
SDValue | Op, | ||
unsigned | NumBitsPerElt | ||
) | const |
Expand CTTZ via Table Lookup.
N | Node to expand |
Definition at line9306 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,llvm::BitWidth,llvm::ISD::CTTZ_ZERO_UNDEF,DL,llvm::ConstantDataArray::get(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getConstantPool(),llvm::MachinePointerInfo::getConstantPool(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getEntryNode(),llvm::SelectionDAG::getExtLoad(),llvm::SelectionDAG::getMachineFunction(),llvm::SelectionDAG::getMemBasePlusOffset(),llvm::SelectionDAG::getNode(),llvm::TargetLoweringBase::getPointerTy(),llvm::DataLayout::getPrefTypeAlign(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getSExtOrTrunc(),llvm::APInt::getZExtValue(),llvm::Log2_32(),Lookup(),llvm::APInt::lshr(),llvm::ISD::MUL,llvm::ISD::SETEQ,llvm::APInt::shl(),llvm::ISD::SRL,llvm::ISD::SUB, andllvm::ISD::ZEXTLOAD.
| virtual |
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' flag.
These instructions are special in various ways, which require special support to insert. The specifiedMachineInstr is created but not inserted into any basic blocks, and this method is called to expand it into a sequence of instructions, potentially also creating new basic blocks and control flow. As long as the returned basic block is different (i.e., we created a new one), the custom inserter is free to modify the rest ofMBB
.
Reimplemented inllvm::R600TargetLowering,llvm::SITargetLowering,llvm::BPFTargetLowering,llvm::MSP430TargetLowering,llvm::RISCVTargetLowering,llvm::SystemZTargetLowering,llvm::XtensaTargetLowering,llvm::AArch64TargetLowering,llvm::ARMTargetLowering,llvm::AVRTargetLowering,llvm::M68kTargetLowering,llvm::Mips16TargetLowering,llvm::MipsTargetLowering,llvm::MipsSETargetLowering,llvm::PPCTargetLowering,llvm::SparcTargetLowering,llvm::VETargetLowering,llvm::X86TargetLowering, andllvm::XCoreTargetLowering.
Definition at line316 of fileSelectionDAGISel.cpp.
Referencesllvm::dbgs(), andllvm_unreachable.
Referenced byllvm::R600TargetLowering::EmitInstrWithCustomInserter(),llvm::SITargetLowering::EmitInstrWithCustomInserter(), andrunImpl().
| inlinevirtual |
Reimplemented inllvm::X86TargetLowering.
Definition at line5595 of fileTargetLowering.h.
Referencesllvm_unreachable.
Referenced byllvm::SelectionDAGBuilder::visitSPDescriptorParent().
SDValue TargetLowering::expandABD | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand ABDS/ABDU nodes.
Expands vector/scalar ABDS/ABDU nodes.
N | Node to expand |
Definition at line9547 of fileTargetLowering.cpp.
Referencesllvm::ISD::ABDS,llvm::ISD::ABS,CC,llvm::TargetLoweringBase::getBooleanContents(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getFreeze(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SDValue::getValue(),llvm::SelectionDAG::getVTList(),llvm::TargetLoweringBase::isOperationLegal(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isScalarInteger(),llvm::TargetLoweringBase::isTypeLegal(),llvm::EVT::isVector(),LHS,N,llvm::ISD::OR,RHS,llvm::ISD::SETGT,llvm::ISD::SETUGT,llvm::ISD::SIGN_EXTEND,llvm::SelectionDAG::SignBitIsZero(),llvm::ISD::SMAX,llvm::ISD::SMIN,llvm::ISD::SUB,llvm::ISD::UMAX,llvm::ISD::UMIN,llvm::SelectionDAG::UnrollVectorOp(),llvm::ISD::USUBO,llvm::ISD::USUBSAT,llvm::ISD::VSELECT,llvm::SelectionDAG::willNotOverflowSub(),llvm::Xor,llvm::ISD::XOR, andllvm::TargetLoweringBase::ZeroOrNegativeOneBooleanContent.
SDValue TargetLowering::expandABS | ( | SDNode * | N, |
SelectionDAG & | DAG, | ||
bool | IsNegative =false | ||
) | const |
Expand ABS nodes.
Expands vector/scalar ABS nodes, vector nodes can only succeed if all operations are legal/custom. (ABS x) -> (XOR (ADD x, (SRA x, type_size)), (SRA x, type_size))
N | Node to expand |
IsNegative | indicate negated abs |
Definition at line9492 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getFreeze(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::TargetLoweringBase::isOperationLegal(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::TargetLoweringBase::isOperationLegalOrCustomOrPromote(),llvm::EVT::isVector(),N,llvm::ISD::SMAX,llvm::ISD::SMIN,llvm::ISD::SRA,llvm::ISD::SUB,llvm::ISD::UMIN,llvm::Xor, andllvm::ISD::XOR.
SDValue TargetLowering::expandAddSubSat | ( | SDNode * | Node, |
SelectionDAG & | DAG | ||
) | const |
Method for building the DAG expansion ofISD::[US][ADD|SUB]SAT.
This method accepts integers as its arguments.
Definition at line10670 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::AllOnes,llvm::ISD::AND,assert(),llvm::BitWidth,llvm::SelectionDAG::computeKnownBits(),llvm::SelectionDAG::getAllOnesConstant(),llvm::TargetLoweringBase::getBooleanContents(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getNOT(),llvm::SelectionDAG::getSelect(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getSExtOrTrunc(),llvm::APInt::getSignedMaxValue(),llvm::APInt::getSignedMinValue(),llvm::SelectionDAG::getVTList(),llvm::EVT::isInteger(),llvm::KnownBits::isNegative(),llvm::KnownBits::isNonNegative(),llvm::TargetLoweringBase::isOperationLegal(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isVector(),LHS,llvm_unreachable,llvm::ISD::OR,RHS,llvm::ISD::SADDO,llvm::ISD::SADDSAT,llvm::ISD::SRA,llvm::ISD::SSUBO,llvm::ISD::SSUBSAT,llvm::ISD::SUB,llvm::ISD::UADDO,llvm::ISD::UADDSAT,llvm::ISD::UMAX,llvm::ISD::UMIN,llvm::SelectionDAG::UnrollVectorOp(),llvm::ISD::USUBO,llvm::ISD::USUBSAT,llvm::ISD::VSELECT,llvm::ISD::XOR, andllvm::TargetLoweringBase::ZeroOrNegativeOneBooleanContent.
Referenced byllvm::RISCVTargetLowering::ReplaceNodeResults().
SDValue TargetLowering::expandAVG | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand vector/scalar AVGCEILS/AVGCEILU/AVGFLOORS/AVGFLOORU nodes.
N | Node to expand |
Definition at line9621 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::ISD::AND,llvm::ISD::ANY_EXTEND,assert(),llvm::ISD::AVGCEILS,llvm::ISD::AVGCEILU,llvm::ISD::AVGFLOORS,llvm::ISD::AVGFLOORU,llvm::SelectionDAG::computeKnownBits(),llvm::SelectionDAG::ComputeNumSignBits(),llvm::KnownBits::countMinLeadingZeros(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getFreeze(),llvm::EVT::getIntegerVT(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::SDValue::getValue(),llvm::SelectionDAG::getVTList(),llvm::EVT::isScalarInteger(),llvm::TargetLoweringBase::isTruncateFree(),llvm::TargetLoweringBase::isTypeLegal(),LHS,N,llvm::ISD::OR,RHS,llvm::ISD::SHL,llvm::ISD::SIGN_EXTEND,llvm::ISD::SRA,llvm::ISD::SRL,llvm::ISD::SUB,llvm::ISD::TRUNCATE,llvm::ISD::UADDO,llvm::Xor,llvm::ISD::XOR, andllvm::ISD::ZERO_EXTEND.
SDValue TargetLowering::expandBITREVERSE | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand BITREVERSE nodes.
Expands scalar/vector BITREVERSE nodes. Returns SDValue() if expand fails.
N | Node to expand |
Definition at line9837 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,llvm::ISD::BSWAP,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::APInt::getOneBitSet(),llvm::EVT::getScalarSizeInBits(),llvm::TargetLoweringBase::getShiftAmountTy(),llvm::APInt::getSplat(),I,llvm::isPowerOf2_32(),N,llvm::ISD::OR,llvm::ISD::SHL, andllvm::ISD::SRL.
SDValue TargetLowering::expandBSWAP | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand BSWAP nodes.
Expands scalar/vector BSWAP nodes with i16/i32/i64 scalar types. Returns SDValue() if expand fails.
N | Node to expand |
Definition at line9703 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::MVT::getScalarType(),llvm::TargetLoweringBase::getShiftAmountTy(),llvm::EVT::getSimpleVT(),llvm::EVT::isSimple(),N,llvm::ISD::OR,llvm::ISD::ROTL,llvm::ISD::SHL,llvm::MVT::SimpleTy, andllvm::ISD::SRL.
SDValue TargetLowering::expandCMP | ( | SDNode * | Node, |
SelectionDAG & | DAG | ||
) | const |
Method for building the DAG expansion ofISD::[US]CMP.
This method accepts integers as its arguments
Definition at line10786 of fileTargetLowering.cpp.
Referencesllvm::SelectionDAG::getAllOnesConstant(),llvm::TargetLoweringBase::getBooleanContents(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getSExtOrTrunc(),LHS,RHS,llvm::ISD::SETGT,llvm::ISD::SETLT,llvm::ISD::SETUGT,llvm::ISD::SETULT,llvm::TargetLoweringBase::shouldExpandCmpUsingSelects(),llvm::ISD::SUB,std::swap(),llvm::ISD::UCMP,llvm::TargetLoweringBase::UndefinedBooleanContent, andllvm::TargetLoweringBase::ZeroOrNegativeOneBooleanContent.
SDValue TargetLowering::expandCTLZ | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand CTLZ/CTLZ_ZERO_UNDEF nodes.
Expands vector/scalar CTLZ nodes, vector nodes can only succeed if all operations are legal/custom.
N | Node to expand |
Definition at line9229 of fileTargetLowering.cpp.
ReferencescanExpandVectorCTPOP(),llvm::ISD::CTLZ,llvm::ISD::CTLZ_ZERO_UNDEF,llvm::ISD::CTPOP,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getNOT(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::TargetLoweringBase::getShiftAmountTy(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::TargetLoweringBase::isOperationLegalOrCustomOrPromote(),llvm::isPowerOf2_32(),llvm::EVT::isVector(),llvm::ISD::OR,llvm::ISD::SETEQ, andllvm::ISD::SRL.
SDValue TargetLowering::expandCTPOP | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand CTPOP nodes.
Expands vector/scalar CTPOP nodes, vector nodes can only succeed if all operations are legal/custom.
N | Node to expand |
Definition at line9083 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::ISD::AND,assert(),canExpandVectorCTPOP(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::TargetLoweringBase::getShiftAmountTy(),llvm::APInt::getSplat(),llvm::TargetLoweringBase::getTypeToTransformTo(),llvm::EVT::isInteger(),llvm::TargetLoweringBase::isOperationLegalOrCustomOrPromote(),llvm::EVT::isVector(),llvm::ISD::MUL,llvm::ISD::SHL,llvm::ISD::SRL, andllvm::ISD::SUB.
SDValue TargetLowering::expandCTTZ | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand CTTZ/CTTZ_ZERO_UNDEF nodes.
Expands vector/scalar CTTZ nodes, vector nodes can only succeed if all operations are legal/custom.
N | Node to expand |
Definition at line9350 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,canExpandVectorCTPOP(),llvm::ISD::CTLZ,llvm::ISD::CTPOP,llvm::ISD::CTTZ,llvm::ISD::CTTZ_ZERO_UNDEF,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getNOT(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::TargetLoweringBase::isOperationExpand(),llvm::TargetLoweringBase::isOperationLegal(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::TargetLoweringBase::isOperationLegalOrCustomOrPromote(),llvm::isPowerOf2_32(),llvm::EVT::isVector(),llvm::ISD::SETEQ,llvm::ISD::SUB, andllvm::ISD::XOR.
bool TargetLowering::expandDIVREMByConstant | ( | SDNode * | N, |
SmallVectorImpl<SDValue > & | Result, | ||
EVT | HiLoVT, | ||
SelectionDAG & | DAG, | ||
SDValue | LL =SDValue() , | ||
SDValue | LH =SDValue() | ||
) | const |
Attempt to expand an n-bit div/rem/divrem by constant using a n/2-bit urem by constant and other arithmetic ops.
The n/2-bit urem by constant will be expanded by DAGCombiner. This is not possible for all constant divisors.
N | Node to expand |
Result | A vector that will be filled with the lo and high parts of the results. For *DIVREM, this will be the quotient parts followed by the remainder parts. |
HiLoVT | The value type to use for the Lo and Hi parts. Should be half of VT. |
LL | Low bits of the LHS of the operation. You can use this parameter if you want to control how low bits are extracted from the LHS. |
LH | High bits of the LHS of the operation. See LL for meaning. |
Definition at line7815 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::ISD::AND,assert(),llvm::BitWidth,llvm::ISD::BUILD_PAIR,llvm::APInt::countr_zero(),llvm::APInt::getBitWidth(),llvm::TargetLoweringBase::getBooleanContents(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::APInt::getLowBitsSet(),llvm::SelectionDAG::getNode(),llvm::APInt::getOneBitSet(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::SDValue::getValue(),llvm::SelectionDAG::getVTList(),llvm::SelectionDAG::getZExtOrTrunc(),llvm::APInt::isOne(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::APInt::lshrInPlace(),llvm::ISD::MUL,llvm::ISD::MULHU,llvm::APInt::multiplicativeInverse(),N,llvm::ISD::OR,llvm::ISD::SDIV,llvm::ISD::SDIVREM,llvm::ISD::SETULT,llvm::ISD::SHL,llvm::SelectionDAG::shouldOptForSize(),llvm::SelectionDAG::SplitScalar(),llvm::ISD::SREM,llvm::ISD::SRL,llvm::ISD::SUB,llvm::APInt::trunc(),llvm::ISD::UADDO,llvm::ISD::UADDO_CARRY,llvm::ISD::UDIV,llvm::ISD::UDIVREM,llvm::APInt::uge(),llvm::APInt::ule(),llvm::ISD::UMUL_LOHI,llvm::APInt::urem(),llvm::ISD::UREM, andllvm::TargetLoweringBase::ZeroOrOneBooleanContent.
SDValue TargetLowering::expandFixedPointDiv | ( | unsigned | Opcode, |
constSDLoc & | dl, | ||
SDValue | LHS, | ||
SDValue | RHS, | ||
unsigned | Scale, | ||
SelectionDAG & | DAG | ||
) | const |
Method for building the DAG expansion ofISD::[US]DIVFIX[SAT].
This method accepts integers as its arguments. Note: This method may fail if the division could not be performed within the type. Clients must retry with a wider type if this happens.
Definition at line11141 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,assert(),llvm::SelectionDAG::computeKnownBits(),llvm::SelectionDAG::ComputeNumSignBits(),llvm::KnownBits::countMinLeadingZeros(),llvm::KnownBits::countMinTrailingZeros(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::SDValue::getValue(),llvm::SelectionDAG::getVTList(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::TargetLoweringBase::isTypeLegal(),LHS,RHS,llvm::ISD::SDIV,llvm::ISD::SDIVFIX,llvm::ISD::SDIVFIXSAT,llvm::ISD::SDIVREM,llvm::ISD::SETLT,llvm::ISD::SETNE,llvm::ISD::SHL,Signed,llvm::ISD::SRA,llvm::ISD::SREM,llvm::ISD::SRL,llvm::ISD::SUB,llvm::ISD::UDIV,llvm::ISD::UDIVFIX,llvm::ISD::UDIVFIXSAT, andllvm::ISD::XOR.
Referenced byearlyExpandDIVFIX().
SDValue TargetLowering::expandFixedPointMul | ( | SDNode * | Node, |
SelectionDAG & | DAG | ||
) | const |
Method for building the DAG expansion ofISD::[U|S]MULFIX[SAT].
This method accepts integers as its arguments.
Definition at line10984 of fileTargetLowering.cpp.
Referencesassert(),llvm::ISD::FSHR,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::APInt::getHighBitsSet(),llvm::EVT::getIntegerVT(),llvm::APInt::getLowBitsSet(),llvm::APInt::getMaxValue(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSelectCC(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::APInt::getSignedMaxValue(),llvm::APInt::getSignedMinValue(),llvm::EVT::getVectorElementCount(),llvm::EVT::getVectorVT(),llvm::SelectionDAG::getVTList(),llvm::Hi,llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isVector(),LHS,llvm::Lo,llvm::ISD::MUL,llvm::ISD::MULHS,llvm::ISD::MULHU,RHS,llvm::ISD::SETGT,llvm::ISD::SETLT,llvm::ISD::SETNE,llvm::ISD::SETUGT,llvm::ISD::SIGN_EXTEND,Signed,llvm::ISD::SMUL_LOHI,llvm::ISD::SMULFIX,llvm::ISD::SMULFIXSAT,llvm::ISD::SMULO,llvm::ISD::SRA,llvm::ISD::TRUNCATE,llvm::ISD::UMUL_LOHI,llvm::ISD::UMULFIX,llvm::ISD::UMULFIXSAT,llvm::ISD::UMULO,llvm::Xor,llvm::ISD::XOR, andllvm::ISD::ZERO_EXTEND.
SDValue TargetLowering::expandFMINIMUM_FMAXIMUM | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand fminimum/fmaximum into multiple comparison with selects.
Definition at line8545 of fileTargetLowering.cpp.
ReferencesDL,llvm::fcNegZero,llvm::fcPosZero,llvm::ISD::FMAXIMUM,llvm::ISD::FMAXNUM,llvm::ISD::FMAXNUM_IEEE,llvm::ISD::FMINNUM,llvm::ISD::FMINNUM_IEEE,llvm::SelectionDAG::getConstantFP(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::EVT::getFltSemantics(),llvm::APFloat::getNaN(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getTargetConstant(),llvm::ISD::IS_FPCLASS,llvm::SelectionDAG::isKnownNeverNaN(),llvm::SelectionDAG::isKnownNeverZeroFloat(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isVector(),LHS,N,RHS,llvm::ISD::SETOEQ,llvm::ISD::SETOGT,llvm::ISD::SETOLT,llvm::ISD::SETUO,llvm::SelectionDAG::UnrollVectorOp(), andllvm::ISD::VSELECT.
SDValue TargetLowering::expandFMINIMUMNUM_FMAXIMUMNUM | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand fminimumnum/fmaximumnum into multiple comparison with selects.
Definition at line8612 of fileTargetLowering.cpp.
ReferencesDL,llvm::ISD::FCANONICALIZE,llvm::fcNegZero,llvm::fcPosZero,llvm::ISD::FMAXIMUM,llvm::ISD::FMAXIMUMNUM,llvm::ISD::FMAXNUM,llvm::ISD::FMAXNUM_IEEE,llvm::ISD::FMINIMUM,llvm::ISD::FMINIMUMNUM,llvm::ISD::FMINNUM,llvm::ISD::FMINNUM_IEEE,llvm::SelectionDAG::getConstantFP(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSelectCC(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getTarget(),llvm::SelectionDAG::getTargetConstant(),llvm::ISD::IS_FPCLASS,llvm::SelectionDAG::isKnownNeverNaN(),llvm::SelectionDAG::isKnownNeverSNaN(),llvm::SelectionDAG::isKnownNeverZeroFloat(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isVector(),LHS,llvm::TargetMachine::Options,Options,RHS,llvm::ISD::SETEQ,llvm::ISD::SETGT,llvm::ISD::SETLT,llvm::ISD::SETUO,llvm::SelectionDAG::UnrollVectorOp(), andllvm::ISD::VSELECT.
SDValue TargetLowering::expandFMINNUM_FMAXNUM | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand fminnum/fmaxnum into fminnum_ieee/fmaxnum_ieee with quieted inputs.
Definition at line8489 of fileTargetLowering.cpp.
Referencesllvm::ISD::FCANONICALIZE,llvm::ISD::FMAXIMUM,llvm::ISD::FMAXNUM_IEEE,llvm::ISD::FMINIMUM,llvm::ISD::FMINNUM,llvm::ISD::FMINNUM_IEEE,llvm::SelectionDAG::getNode(),llvm::SelectionDAG::isKnownNeverNaN(),llvm::SelectionDAG::isKnownNeverSNaN(),llvm::SelectionDAG::isKnownNeverZeroFloat(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isScalableVector(), andllvm::report_fatal_error().
SDValue TargetLowering::expandFP_ROUND | ( | SDNode * | Node, |
SelectionDAG & | DAG | ||
) | const |
Expand round(fp) to fp conversion.
N | Node to expand |
Definition at line11661 of fileTargetLowering.cpp.
Referencesllvm::Add,llvm::ISD::ADD,llvm::ISD::AND,assert(),llvm::ISD::BITCAST,llvm::EVT::changeVectorElementType(),F32,llvm::ISD::FP_ROUND,llvm::ISD::FP_TO_BF16,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarType(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::EVT::isVector(),llvm::ISD::OR,llvm::ISD::SETUO,llvm::ISD::SRL, andllvm::ISD::TRUNCATE.
SDValue TargetLowering::expandFP_TO_INT_SAT | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand FP_TO_[US]INT_SAT into FP_TO_[US]INT and selects or min/max.
N | Node to expand |
Definition at line11483 of fileTargetLowering.cpp.
Referencesassert(),llvm::APFloat::convertFromAPInt(),llvm::ISD::FMAXNUM,llvm::ISD::FMINNUM,llvm::ISD::FP_EXTEND,llvm::ISD::FP_TO_SINT,llvm::ISD::FP_TO_SINT_SAT,llvm::ISD::FP_TO_UINT,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getConstantFP(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::EVT::getFltSemantics(),llvm::APInt::getMaxValue(),llvm::APInt::getMinValue(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::APInt::getSignedMaxValue(),llvm::APInt::getSignedMinValue(),llvm::TargetLoweringBase::isOperationLegal(),llvm::APFloatBase::opInexact,llvm::APFloatBase::rmTowardZero,Select,llvm::ISD::SETOGT,llvm::ISD::SETULT,llvm::ISD::SETUO,llvm::APInt::sext(), andllvm::APInt::zext().
bool TargetLowering::expandFP_TO_SINT | ( | SDNode * | N, |
SDValue & | Result, | ||
SelectionDAG & | DAG | ||
) | const |
Expand float(f32) to SINT(i64) conversion.
N | Node to expand |
Result | output after conversion |
Definition at line8230 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,llvm::ISD::BITCAST,llvm::EVT::changeTypeToInteger(),llvm::Exponent,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getSelectCC(),llvm::SelectionDAG::getSExtOrTrunc(),llvm::TargetLoweringBase::getShiftAmountTy(),llvm::APInt::getSignMask(),llvm::SelectionDAG::getZExtOrTrunc(),llvm::ISD::OR,llvm::ISD::SETGT,llvm::ISD::SETLT,llvm::ISD::SHL,llvm::ISD::SRA,llvm::ISD::SRL,llvm::ISD::SUB, andllvm::ISD::XOR.
Referenced byllvm::R600TargetLowering::ReplaceNodeResults().
bool TargetLowering::expandFP_TO_UINT | ( | SDNode * | N, |
SDValue & | Result, | ||
SDValue & | Chain, | ||
SelectionDAG & | DAG | ||
) | const |
Expand float to UINT conversion.
N | Node to expand |
Result | output after conversion |
Chain | output chain after conversion |
Definition at line8301 of fileTargetLowering.cpp.
Referencesllvm::APFloat::convertFromAPInt(),llvm::ISD::FP_TO_SINT,llvm::ISD::FSUB,llvm::SelectionDAG::getBoolExtOrTrunc(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getConstantFP(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::EVT::getFltSemantics(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::APInt::getSignMask(),llvm::SDValue::getValue(),llvm::APInt::getZero(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::TargetLoweringBase::isOperationLegalOrCustomOrPromote(),llvm::EVT::isVector(),llvm::APFloatBase::opOverflow,llvm::APFloatBase::rmNearestTiesToEven,llvm::ISD::SETLT,llvm::TargetLoweringBase::shouldUseStrictFP_TO_INT(),llvm::ISD::STRICT_FP_TO_SINT,llvm::ISD::STRICT_FSUB, andllvm::ISD::XOR.
SDValue TargetLowering::expandFunnelShift | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand funnel shift.
N | Node to expand |
Definition at line8034 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,DL,expandVPFunnelShift(),llvm::ISD::FSHL,llvm::ISD::FSHR,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getNOT(),llvm::EVT::getScalarSizeInBits(),isNonZeroModBitWidthOrUndef(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::TargetLoweringBase::isOperationLegalOrCustomOrPromote(),llvm::isPowerOf2_32(),llvm::EVT::isVector(),llvm::ISD::OR,llvm::ISD::SHL,llvm::ISD::SRL,llvm::ISD::SUB,llvm::ISD::UREM,X, andY.
| virtual |
Expands target specific indirect branch for the case ofJumpTable expansion.
Reimplemented inllvm::RISCVTargetLowering, andllvm::X86TargetLowering.
Definition at line478 of fileTargetLowering.cpp.
ReferencesAddr,llvm::ISD::BRIND,llvm::SelectionDAG::getJumpTableDebugInfo(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getTarget(),llvm::TargetMachine::getTargetTriple(), andllvm::Triple::isOSBinFormatCOFF().
Referenced byllvm::RISCVTargetLowering::expandIndirectJTBranch(), andllvm::X86TargetLowering::expandIndirectJTBranch().
This hook allows the target to expand an inline asm call to be explicit llvm code if it wants to.
This is useful for turning simple inline asms into LLVM intrinsics, which gives the compiler more information about the behavior of the code.
Reimplemented inllvm::ARMTargetLowering, andllvm::X86TargetLowering.
Definition at line4946 of fileTargetLowering.h.
SDValue TargetLowering::expandIntMINMAX | ( | SDNode * | Node, |
SelectionDAG & | DAG | ||
) | const |
Method for building the DAG expansion ofISD::[US][MIN|MAX].
This method accepts integers as its arguments.
Definition at line10589 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,CC,Cond,DL,llvm::SelectionDAG::doesNodeExist(),llvm::TargetLoweringBase::getBooleanContents(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getFreeze(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SDValue::getValueType(),llvm::SelectionDAG::getVTList(),llvm::isOneOrOneSplat(),llvm::TargetLoweringBase::isOperationLegal(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isVector(),llvm_unreachable,llvm::ISD::SETCC,llvm::ISD::SETEQ,llvm::ISD::SETGE,llvm::ISD::SETGT,llvm::ISD::SETLE,llvm::ISD::SETLT,llvm::ISD::SETUGE,llvm::ISD::SETUGT,llvm::ISD::SETULE,llvm::ISD::SETULT,llvm::ISD::SMAX,llvm::ISD::SMIN,llvm::ISD::SUB,llvm::ISD::UMAX,llvm::ISD::UMIN,llvm::SelectionDAG::UnrollVectorOp(),llvm::ISD::USUBSAT,llvm::ISD::VSELECT, andllvm::TargetLoweringBase::ZeroOrNegativeOneBooleanContent.
SDValue TargetLowering::expandIS_FPCLASS | ( | EVT | ResultVT, |
SDValue | Op, | ||
FPClassTest | Test, | ||
SDNodeFlags | Flags, | ||
constSDLoc & | DL, | ||
SelectionDAG & | DAG | ||
) | const |
Expand check for floating point class.
ResultVT | The type of intrinsic call result. |
Op | The tested value. |
Test | The test to perform. |
Flags | The optimization flags. |
Definition at line8724 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,assert(),llvm::APFloat::bitcastToAPInt(),llvm::ISD::BUILD_VECTOR,llvm::APInt::clearBit(),llvm::ISD::ConstantFP,DL,llvm::ISD::EXTRACT_ELEMENT,llvm::ISD::FABS,llvm::fcAllFlags,llvm::fcFinite,llvm::fcInf,llvm::fcNan,llvm::fcNegFinite,llvm::fcNegInf,llvm::fcNegNormal,llvm::fcNegSubnormal,llvm::fcNone,llvm::fcNormal,llvm::fcPosFinite,llvm::fcPosInf,llvm::fcPosNormal,llvm::fcPosSubnormal,llvm::fcPosZero,llvm::fcQNan,llvm::fcSubnormal,llvm::fcZero,llvm::APInt::getActiveBits(),llvm::APInt::getAllOnes(),llvm::SelectionDAG::getBitcast(),llvm::SelectionDAG::getBoolConstant(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getConstantFP(),llvm::SelectionDAG::getContext(),llvm::Type::getFltSemantics(),llvm::APFloat::getInf(),llvm::EVT::getIntegerVT(),llvm::APFloat::getLargest(),llvm::SelectionDAG::getMachineFunction(),llvm::SelectionDAG::getNode(),llvm::APInt::getOneBitSet(),llvm::EVT::getScalarSizeInBits(),llvm::EVT::getScalarType(),llvm::SelectionDAG::getSetCC(),llvm::APInt::getSignedMaxValue(),llvm::APInt::getSignMask(),llvm::EVT::getSimpleVT(),llvm::APFloat::getSmallestNormalized(),llvm::EVT::getTypeForEVT(),llvm::EVT::getVectorElementCount(),llvm::EVT::getVectorVT(),llvm::invertFPClassTestIfSimpler(),llvm::TargetLoweringBase::isCondCodeLegalOrCustom(),llvm::TargetLoweringBase::isFAbsFree(),isFCmpEqualZero(),llvm::EVT::isFloatingPoint(),llvm::TargetLoweringBase::isOperationLegal(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isVector(),llvm::ISD::OR,llvm::APInt::setBit(),llvm::ISD::SETCC,llvm::ISD::SETEQ,llvm::ISD::SETGE,llvm::ISD::SETGT,llvm::ISD::SETLT,llvm::ISD::SETNE,llvm::ISD::SETO,llvm::ISD::SETOEQ,llvm::ISD::SETOGE,llvm::ISD::SETOLT,llvm::ISD::SETONE,llvm::ISD::SETUEQ,llvm::ISD::SETUGE,llvm::ISD::SETULT,llvm::ISD::SETUNE,llvm::ISD::SETUO,llvm::APInt::shl(),llvm::ISD::SUB,llvm::Test, andllvm::ISD::XOR.
bool TargetLowering::expandMUL | ( | SDNode * | N, |
SDValue & | Lo, | ||
SDValue & | Hi, | ||
EVT | HiLoVT, | ||
SelectionDAG & | DAG, | ||
MulExpansionKind | Kind, | ||
SDValue | LL =SDValue() , | ||
SDValue | LH =SDValue() , | ||
SDValue | RL =SDValue() , | ||
SDValue | RH =SDValue() | ||
) | const |
Expand a MUL into two nodes.
One that computes the high bits of the result and one that computes the low bits.
HiLoVT | The value type to use for the Lo and Hi nodes. |
LL | Low bits of the LHS of the MUL. You can use this parameter if you want to control how low bits are extracted from the LHS. |
LH | High bits of the LHS of the MUL. See LL for meaning. |
RL | Low bits of the RHS of the MUL. See LL for meaning |
RH | High bits of the RHS of the MUL. See LL for meaning. |
Definition at line7778 of fileTargetLowering.cpp.
bool TargetLowering::expandMUL_LOHI | ( | unsigned | Opcode, |
EVT | VT, | ||
constSDLoc & | dl, | ||
SDValue | LHS, | ||
SDValue | RHS, | ||
SmallVectorImpl<SDValue > & | Result, | ||
EVT | HiLoVT, | ||
SelectionDAG & | DAG, | ||
MulExpansionKind | Kind, | ||
SDValue | LL =SDValue() , | ||
SDValue | LH =SDValue() , | ||
SDValue | RL =SDValue() , | ||
SDValue | RH =SDValue() | ||
) | const |
Expand a MUL or [US]MUL_LOHI of n-bit values into two or four nodes, respectively, each computing an n/2-bit part of the result.
Result | A vector that will be filled with the parts of the result in little-endian order. |
LL | Low bits of the LHS of the MUL. You can use this parameter if you want to control how low bits are extracted from the LHS. |
LH | High bits of the LHS of the MUL. See LL for meaning. |
RL | Low bits of the RHS of the MUL. See LL for meaning |
RH | High bits of the RHS of the MUL. See LL for meaning. |
Definition at line7603 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::ISD::ADDC,llvm::ISD::ADDE,llvm::TargetLoweringBase::Always,assert(),llvm::SelectionDAG::ComputeMaxSignificantBits(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::APInt::getHighBitsSet(),llvm::SDValue::getNode(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getSelectCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::SDValue::getValue(),llvm::SelectionDAG::getVTList(),llvm::Hi,llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isVector(),LHS,llvm::Lo,llvm::SelectionDAG::MaskedValueIsZero(),Merge,llvm::ISD::MUL,llvm::ISD::MULHS,llvm::ISD::MULHU,llvm::ISD::OR,RHS,llvm::ISD::SETLT,llvm::ISD::SHL,Signed,llvm::ISD::SMUL_LOHI,llvm::ISD::SRL,llvm::ISD::SUB,llvm::ISD::TRUNCATE,llvm::ISD::UADDO_CARRY,llvm::ISD::UMUL_LOHI, andllvm::ISD::ZERO_EXTEND.
bool TargetLowering::expandMULO | ( | SDNode * | Node, |
SDValue & | Result, | ||
SDValue & | Overflow, | ||
SelectionDAG & | DAG | ||
) | const |
Method for building the DAG expansion ofISD::[US]MULO.
Returns whether expansion was successful and populates the Result and Overflow arguments.
Definition at line11312 of fileTargetLowering.cpp.
Referencesassert(),llvm::EVT::bitsLT(),llvm::CallingConv::C,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::EVT::getIntegerVT(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::EVT::getSizeInBits(),llvm::SDValue::getValue(),llvm::SDValue::getValueSizeInBits(),llvm::SDValue::getValueType(),llvm::EVT::getVectorElementCount(),llvm::EVT::getVectorVT(),llvm::SelectionDAG::getVTList(),llvm::isConstOrConstSplat(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),isSigned(),llvm::TargetLoweringBase::isTypeLegal(),llvm::EVT::isVector(),LHS,llvm::Mul,llvm::ISD::MUL,llvm::ISD::MULHS,llvm::ISD::MULHU,RHS,llvm::ISD::SETNE,llvm::ISD::SHL,llvm::ISD::SIGN_EXTEND,llvm::ISD::SMUL_LOHI,llvm::ISD::SMULO,llvm::ISD::SRA,llvm::ISD::SRL,llvm::ISD::TRUNCATE,llvm::ISD::UMUL_LOHI, andllvm::ISD::ZERO_EXTEND.
bool TargetLowering::expandREM | ( | SDNode * | Node, |
SDValue & | Result, | ||
SelectionDAG & | DAG | ||
) | const |
Expand an SREM or UREM using SDIV/UDIV or SDIVREM/UDIVREM, if legal.
Returns true if the expansion was successful.
Definition at line11459 of fileTargetLowering.cpp.
Referencesllvm::SelectionDAG::getNode(),llvm::SDValue::getValue(),llvm::SelectionDAG::getVTList(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),isSigned(),llvm::Mul,llvm::ISD::MUL,llvm::ISD::SDIV,llvm::ISD::SDIVREM,llvm::ISD::SREM,llvm::ISD::SUB,llvm::ISD::UDIV, andllvm::ISD::UDIVREM.
SDValue TargetLowering::expandROT | ( | SDNode * | N, |
bool | AllowVectorOps, | ||
SelectionDAG & | DAG | ||
) | const |
Expand rotations.
N | Node to expand |
AllowVectorOps | expand vector rotate, this should only be performed if the legalization is happening outside of LegalizeVectorOps |
Definition at line8123 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,DL,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SDValue::getValueType(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::TargetLoweringBase::isOperationLegalOrCustomOrPromote(),llvm::isPowerOf2_32(),llvm::EVT::isVector(),llvm::ISD::OR,llvm::ISD::ROTL,llvm::ISD::ROTR,llvm::ISD::SHL,llvm::ISD::SRL,llvm::ISD::SUB, andllvm::ISD::UREM.
SDValue TargetLowering::expandRoundInexactToOdd | ( | EVT | ResultVT, |
SDValue | Op, | ||
constSDLoc & | DL, | ||
SelectionDAG & | DAG | ||
) | const |
Truncate Op to ResultVT.
If the result is exact, leave it alone. If it is not exact, force the result to be odd.
ResultVT | The type of result. |
Op | The value to round. |
Definition at line11593 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::And,llvm::ISD::AND,llvm::ISD::BITCAST,llvm::EVT::changeTypeToInteger(),llvm::ISD::FABS,llvm::SelectionDAG::getAllOnesConstant(),llvm::SelectionDAG::getBitcast(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getFPExtendOrRound(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::EVT::getScalarType(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::APInt::getSignedMaxValue(),llvm::APInt::getSignMask(),llvm::SDValue::getValueType(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::ISD::OR,llvm::ISD::SETNE,llvm::ISD::SETOGT,llvm::ISD::SETUEQ,llvm::ISD::SRL, andllvm::ISD::TRUNCATE.
void TargetLowering::expandSADDSUBO | ( | SDNode * | Node, |
SDValue & | Result, | ||
SDValue & | Overflow, | ||
SelectionDAG & | DAG | ||
) | const |
Method for building the DAG expansion of ISD::S(ADD|SUB)O.
Expansion always suceeds and populates the Result and Overflow arguments.
Definition at line11272 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::SelectionDAG::getBoolExtOrTrunc(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::TargetLoweringBase::isOperationLegal(),LHS,RHS,llvm::ISD::SADDO,llvm::ISD::SADDSAT,llvm::ISD::SETGT,llvm::ISD::SETLT,llvm::ISD::SETNE,llvm::ISD::SSUBSAT,llvm::ISD::SUB, andllvm::ISD::XOR.
void TargetLowering::expandShiftParts | ( | SDNode * | N, |
SDValue & | Lo, | ||
SDValue & | Hi, | ||
SelectionDAG & | DAG | ||
) | const |
Expand shift-by-parts.
N | Node to expand |
Lo | lower-output-part after conversion |
Hi | upper-output-part after conversion |
Definition at line8178 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,assert(),Cond,llvm::ISD::FSHL,llvm::ISD::FSHR,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SDValue::getValueType(),llvm::Hi,llvm::isPowerOf2_32(),llvm::Lo,llvm::ISD::SELECT,llvm::ISD::SETNE,llvm::ISD::SHL,llvm::ISD::SHL_PARTS,llvm::ISD::SRA,llvm::ISD::SRA_PARTS, andllvm::ISD::SRL.
Referenced byLowerShiftParts().
SDValue TargetLowering::expandShlSat | ( | SDNode * | Node, |
SelectionDAG & | DAG | ||
) | const |
Method for building the DAG expansion ofISD::[US]SHLSAT.
This method accepts integers as its arguments.
Definition at line10821 of fileTargetLowering.cpp.
Referencesassert(),Cond,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::APInt::getMaxValue(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::APInt::getSignedMaxValue(),llvm::APInt::getSignedMinValue(),llvm::EVT::isInteger(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isVector(),LHS,RHS,llvm::ISD::SETLT,llvm::ISD::SETNE,llvm::ISD::SHL,llvm::ISD::SRA,llvm::ISD::SRL,llvm::ISD::SSHLSAT,llvm::SelectionDAG::UnrollVectorOp(),llvm::ISD::USHLSAT, andllvm::ISD::VSELECT.
void TargetLowering::expandUADDSUBO | ( | SDNode * | Node, |
SDValue & | Result, | ||
SDValue & | Overflow, | ||
SelectionDAG & | DAG | ||
) | const |
Method for building the DAG expansion of ISD::U(ADD|SUB)O.
Expansion always suceeds and populates the Result and Overflow arguments.
Definition at line11226 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,CC,llvm::SelectionDAG::getBoolExtOrTrunc(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SDValue::getNode(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::isAllOnesConstant(),llvm::isOneConstant(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),LHS,RHS,llvm::ISD::SETEQ,llvm::ISD::SETNE,llvm::ISD::SETUGT,llvm::ISD::SETULT,llvm::ISD::SUB,llvm::ISD::UADDO,llvm::ISD::UADDO_CARRY, andllvm::ISD::USUBO_CARRY.
bool TargetLowering::expandUINT_TO_FP | ( | SDNode * | N, |
SDValue & | Result, | ||
SDValue & | Chain, | ||
SelectionDAG & | DAG | ||
) | const |
Expand UINT(i64) to double(f64) conversion.
N | Node to expand |
Result | output after conversion |
Chain | output chain after conversion |
Definition at line8403 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,llvm::ISD::FADD,llvm::ISD::FSUB,llvm::SelectionDAG::getBitcast(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getConstantFP(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarType(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::Hi,llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::TargetLoweringBase::isOperationLegalOrCustomOrPromote(),llvm::EVT::isVector(),llvm::Lo,llvm::ISD::OR,llvm::ISD::SINT_TO_FP, andllvm::ISD::SRL.
std::pair<SDValue,SDValue > TargetLowering::expandUnalignedLoad | ( | LoadSDNode * | LD, |
SelectionDAG & | DAG | ||
) | const |
Expands an unaligned load to 2 half-size loads for an integer, and possibly more for vectors.
Definition at line10128 of fileTargetLowering.cpp.
Referencesllvm::ISD::ANY_EXTEND,assert(),llvm::ISD::BITCAST,llvm::SelectionDAG::CreateStackTemporary(),llvm::ISD::EXTLOAD,llvm::ISD::FP_EXTEND,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getExtLoad(),llvm::TypeSize::getFixed(),llvm::MachinePointerInfo::getFixedStack(),llvm::EVT::getIntegerVT(),llvm::SelectionDAG::getLoad(),llvm::SelectionDAG::getMachineFunction(),llvm::SDValue::getNode(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getObjectPtrOffset(),llvm::TargetLoweringBase::getRegisterType(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::EVT::getSizeInBits(),llvm::MVT::getSizeInBits(),llvm::SelectionDAG::getStore(),llvm::EVT::getStoreSize(),llvm::SelectionDAG::getTruncStore(),llvm::SDValue::getValue(),llvm::Hi,llvm::EVT::isFloatingPoint(),llvm::EVT::isInteger(),llvm::DataLayout::isLittleEndian(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::TargetLoweringBase::isTypeLegal(),llvm::EVT::isVector(),llvm::Lo,llvm::ISD::LOAD,llvm::ISD::NON_EXTLOAD,llvm::Offset,llvm::ISD::OR,Ptr,llvm::SmallVectorTemplateBase< T, bool >::push_back(),llvm::ISD::SHL,llvm::ISD::TokenFactor,llvm::ISD::UNINDEXED, andllvm::ISD::ZEXTLOAD.
Referenced byllvm::HexagonTargetLowering::LowerUnalignedLoad(), andllvm::AMDGPUTargetLowering::performLoadCombine().
SDValue TargetLowering::expandUnalignedStore | ( | StoreSDNode * | ST, |
SelectionDAG & | DAG | ||
) | const |
Expands an unaligned store to 2 half-size stores for integer values, and possibly more for vectors.
Definition at line10277 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,assert(),llvm::ISD::BITCAST,llvm::CallingConv::C,llvm::SelectionDAG::CreateStackTemporary(),llvm::ISD::EXTLOAD,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getExtLoad(),llvm::TypeSize::getFixed(),llvm::EVT::getFixedSizeInBits(),llvm::MachinePointerInfo::getFixedStack(),llvm::EVT::getHalfSizedIntegerVT(),llvm::EVT::getIntegerVT(),llvm::SelectionDAG::getLoad(),llvm::APInt::getLowBitsSet(),llvm::SelectionDAG::getMachineFunction(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getObjectPtrOffset(),llvm::TargetLoweringBase::getRegisterType(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::EVT::getSizeInBits(),llvm::MVT::getSizeInBits(),llvm::SelectionDAG::getStore(),llvm::EVT::getStoreSize(),llvm::SelectionDAG::getTruncStore(),llvm::SDValue::getValueType(),llvm::Hi,llvm::EVT::isFloatingPoint(),llvm::EVT::isInteger(),llvm::DataLayout::isLittleEndian(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::TargetLoweringBase::isTypeLegal(),llvm::EVT::isVector(),llvm::Lo,llvm::Offset,Ptr,llvm::SmallVectorTemplateBase< T, bool >::push_back(),scalarizeVectorStore(),llvm::ISD::SRL,llvm::ISD::STORE,llvm::ISD::TokenFactor, andllvm::ISD::UNINDEXED.
Referenced byllvm::HexagonTargetLowering::LowerStore(), andllvm::AMDGPUTargetLowering::performStoreCombine().
SDValue TargetLowering::expandVecReduce | ( | SDNode * | Node, |
SelectionDAG & | DAG | ||
) | const |
Expand a VECREDUCE_* into an explicit calculation.
If Count is specified, only the first Count elements of the vector are used.
Definition at line11392 of fileTargetLowering.cpp.
Referencesllvm::ISD::ANY_EXTEND,llvm::SelectionDAG::ExtractVectorElements(),llvm::SelectionDAG::getContext(),llvm::EVT::getHalfNumVectorElementsVT(),llvm::SelectionDAG::getNode(),llvm::ISD::getVecReduceBaseOpcode(),llvm::EVT::getVectorElementType(),llvm::EVT::getVectorNumElements(),llvm::Hi,llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::EVT::isPow2VectorType(),llvm::EVT::isScalableVector(),llvm::Lo,llvm::report_fatal_error(), andllvm::SelectionDAG::SplitVector().
SDValue TargetLowering::expandVecReduceSeq | ( | SDNode * | Node, |
SelectionDAG & | DAG | ||
) | const |
Expand a VECREDUCE_SEQ_* into an explicit ordered calculation.
Definition at line11432 of fileTargetLowering.cpp.
Referencesllvm::SelectionDAG::ExtractVectorElements(),llvm::SelectionDAG::getNode(),llvm::SDValue::getValueType(),llvm::ISD::getVecReduceBaseOpcode(),llvm::EVT::getVectorElementType(),llvm::EVT::getVectorNumElements(),llvm::EVT::isScalableVector(), andllvm::report_fatal_error().
SDValue TargetLowering::expandVECTOR_COMPRESS | ( | SDNode * | Node, |
SelectionDAG & | DAG | ||
) | const |
Expand a vector VECTOR_COMPRESS into a sequence of extract element, store temporarily, advance store position, before re-loading the final vector.
Definition at line11789 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::EVT::changeTypeToInteger(),llvm::EVT::changeVectorElementType(),llvm::SelectionDAG::CreateStackTemporary(),DL,llvm::ISD::EXTRACT_VECTOR_ELT,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getEntryNode(),llvm::MachinePointerInfo::getFixedStack(),llvm::SelectionDAG::getFreeze(),llvm::SelectionDAG::getLoad(),llvm::SelectionDAG::getMachineFunction(),llvm::SDValue::getNode(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getReducedAlign(),llvm::EVT::getScalarType(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getSetCC(),llvm::SelectionDAG::getStore(),llvm::EVT::getStoreSize(),llvm::MachinePointerInfo::getUnknownStack(),llvm::SDValue::getValue(),llvm::SDValue::getValueType(),llvm::SelectionDAG::getVectorIdxConstant(),llvm::TargetLoweringBase::getVectorIdxTy(),llvm::EVT::getVectorNumElements(),I,Idx,llvm::ISD::isConstantSplatVector(),llvm::EVT::isScalableVector(),llvm::SDValue::isUndef(),llvm::report_fatal_error(),llvm::ISD::SETUGT,llvm::ISD::TRUNCATE,llvm::ISD::UMIN,llvm::SDNodeFlags::Unpredictable,llvm::ISD::VECREDUCE_ADD, andllvm::ISD::ZERO_EXTEND.
SDValue TargetLowering::expandVectorFindLastActive | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand VECTOR_FIND_LAST_ACTIVE nodes.
N | Node to expand |
Definition at line9455 of fileTargetLowering.cpp.
Referencesllvm::EVT::changeVectorElementType(),DL,llvm::TargetLoweringBase::getBitWidthForCttzElements(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::MachineFunction::getFunction(),llvm::MVT::getIntegerVT(),llvm::SelectionDAG::getMachineFunction(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarType(),llvm::SelectionDAG::getSelect(),llvm::EVT::getSimpleVT(),llvm::SelectionDAG::getStepVector(),llvm::SelectionDAG::getTargetLoweringInfo(),llvm::TargetLoweringBase::getTypeAction(),llvm::EVT::getTypeForEVT(),llvm::TargetLoweringBase::getTypeToTransformTo(),llvm::EVT::getVectorElementCount(),llvm::EVT::getVectorElementType(),llvm::getVScaleRange(),llvm::SelectionDAG::getZExtOrTrunc(),llvm::EVT::isScalableVector(),N,llvm::TargetLoweringBase::TypePromoteInteger, andllvm::ISD::VECREDUCE_UMAX.
SDValue TargetLowering::expandVectorNaryOpBySplitting | ( | SDNode * | Node, |
SelectionDAG & | DAG | ||
) | const |
Definition at line12086 of fileTargetLowering.cpp.
Referencesllvm::ISD::CONCAT_VECTORS,DL,llvm::SelectionDAG::getNode(),llvm::SelectionDAG::GetSplitDestVTs(),llvm::EVT::getVectorElementCount(),llvm::Hi,llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isKnownMultipleOf(),llvm::TargetLoweringBase::isOperationLegalOrCustomOrPromote(),llvm::TargetLoweringBase::isTypeLegal(),llvm::EVT::isVector(),llvm::Lo,llvm::SmallVectorTemplateBase< T, bool >::push_back(), andllvm::SelectionDAG::SplitVector().
SDValue TargetLowering::expandVectorSplice | ( | SDNode * | Node, |
SelectionDAG & | DAG | ||
) | const |
Method for building the DAG expansion ofISD::VECTOR_SPLICE.
This method accepts vectors as its arguments.
Definition at line11715 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,assert(),llvm::SelectionDAG::CreateStackTemporary(),DL,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getEntryNode(),llvm::EVT::getFixedSizeInBits(),llvm::MachinePointerInfo::getFixedStack(),llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(),llvm::SelectionDAG::getLoad(),llvm::SelectionDAG::getMachineFunction(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getReducedAlign(),llvm::SelectionDAG::getStore(),llvm::EVT::getStoreSize(),llvm::MachinePointerInfo::getUnknownStack(),llvm::EVT::getVectorElementCount(),llvm::EVT::getVectorElementType(),llvm::EVT::getVectorMinNumElements(),llvm::EVT::getVectorVT(),llvm::SelectionDAG::getVScale(),llvm::ISD::SUB,llvm::ISD::UMIN, andllvm::ISD::VECTOR_SPLICE.
SDValue TargetLowering::expandVPBITREVERSE | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand VP_BITREVERSE nodes.
Expands VP_BITREVERSE nodes with i8/i16/i32/i64 scalar types.
N | Node to expand |
Definition at line9898 of fileTargetLowering.cpp.
Referencesassert(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::TargetLoweringBase::getShiftAmountTy(),llvm::APInt::getSplat(),llvm::isPowerOf2_32(), andN.
SDValue TargetLowering::expandVPBSWAP | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand VP_BSWAP nodes.
Expands VP_BSWAP nodes with i16/i32/i64 scalar types. Returns SDValue() if expand fails.
N | Node to expand |
Definition at line9761 of fileTargetLowering.cpp.
Referencesllvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::MVT::getScalarType(),llvm::TargetLoweringBase::getShiftAmountTy(),llvm::EVT::getSimpleVT(),llvm::EVT::isSimple(),N, andllvm::MVT::SimpleTy.
SDValue TargetLowering::expandVPCTLZ | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand VP_CTLZ/VP_CTLZ_ZERO_UNDEF nodes.
N | Node to expand |
Definition at line9279 of fileTargetLowering.cpp.
Referencesllvm::SelectionDAG::getAllOnesConstant(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(), andllvm::TargetLoweringBase::getShiftAmountTy().
SDValue TargetLowering::expandVPCTPOP | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand VP_CTPOP nodes.
Definition at line9160 of fileTargetLowering.cpp.
Referencesassert(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::TargetLoweringBase::getShiftAmountTy(),llvm::APInt::getSplat(),llvm::TargetLoweringBase::getTypeToTransformTo(),llvm::EVT::isInteger(), andllvm::TargetLoweringBase::isOperationLegalOrCustomOrPromote().
SDValue TargetLowering::expandVPCTTZ | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand VP_CTTZ/VP_CTTZ_ZERO_UNDEF nodes.
N | Node to expand |
Definition at line9406 of fileTargetLowering.cpp.
Referencesllvm::SelectionDAG::getAllOnesConstant(),llvm::SelectionDAG::getConstant(), andllvm::SelectionDAG::getNode().
SDValue TargetLowering::expandVPCTTZElements | ( | SDNode * | N, |
SelectionDAG & | DAG | ||
) | const |
Expand VP_CTTZ_ELTS/VP_CTTZ_ELTS_ZERO_UNDEF nodes.
N | Node to expand |
Definition at line9422 of fileTargetLowering.cpp.
ReferencesDL,llvm::SelectionDAG::getCondCode(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarType(),llvm::SelectionDAG::getSplat(),llvm::SelectionDAG::getStepVector(),llvm::EVT::getVectorElementCount(),llvm::EVT::getVectorVT(),llvm::SelectionDAG::getZExtOrTrunc(),N,Select,llvm::ISD::SETNE, andllvm::Splat.
| virtual |
Determines the optimal series of memory ops to replace the memset / memcpy.
Return true if the number of memory ops is below the threshold (Limit). Note that this is always the case when Limit is ~0. It returns the types of the sequence of memory ops to perform memset / memcpy by reference.
Reimplemented inllvm::SystemZTargetLowering.
Definition at line200 of fileTargetLowering.cpp.
Referencesllvm::TargetLoweringBase::allowsMisalignedMemoryAccesses(),assert(),llvm::EVT::bitsGT(),llvm::CallingConv::Fast,llvm::TargetLoweringBase::getOptimalMemOpType(),llvm::EVT::getSimpleVT(),llvm::EVT::getSizeInBits(),llvm::EVT::isFloatingPoint(),llvm::EVT::isInteger(),llvm::MVT::isInteger(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::TargetLoweringBase::isSafeMemOpType(),llvm::TargetLoweringBase::isTypeLegal(),llvm::EVT::isVector(),llvm::MachineMemOperand::MONone,llvm::MVT::SimpleTy,Size, andllvm::ISD::STORE.
Referenced byllvm::SystemZTargetLowering::findOptimalMemOpLowering(),getMemcpyLoadsAndStores(),getMemmoveLoadsAndStores(), andgetMemsetStores().
void TargetLowering::forceExpandMultiply | ( | SelectionDAG & | DAG, |
constSDLoc & | dl, | ||
bool | Signed, | ||
SDValue & | Lo, | ||
SDValue & | Hi, | ||
SDValue | LHS, | ||
SDValue | RHS, | ||
SDValue | HiLHS =SDValue() , | ||
SDValue | HiRHS =SDValue() | ||
) | const |
Calculate the product twice the width of LHS and RHS.
If HiLHS/HiRHS are non-null they will be included in the multiplication. The expansion works by splitting the 2 inputs into 4 pieces that we can multiply and add together without neding MULH or MUL_LOHI.
Definition at line10860 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::ISD::AND,assert(),llvm::SelectionDAG::getConstant(),llvm::APInt::getLowBitsSet(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::EVT::getSizeInBits(),llvm::Hi,LHS,llvm::Lo,llvm::ISD::MUL,RHS,llvm::ISD::SHL,Signed,llvm::ISD::SRA, andllvm::ISD::SRL.
void TargetLowering::forceExpandWideMUL | ( | SelectionDAG & | DAG, |
constSDLoc & | dl, | ||
bool | Signed, | ||
constSDValue | LHS, | ||
constSDValue | RHS, | ||
SDValue & | Lo, | ||
SDValue & | Hi | ||
) | const |
Calculate full product of LHS and RHS either via a libcall or through brute force expansion of the multiplication.
The expansion works by splitting the 2 inputs into 4 pieces that we can multiply and add together without needing MULH or MUL_LOHI.
Definition at line10918 of fileTargetLowering.cpp.
Referencesassert(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::EVT::getFixedSizeInBits(),llvm::EVT::getIntegerVT(),llvm::TargetLoweringBase::getLibcallName(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::EVT::getSizeInBits(),llvm::Hi,llvm::DataLayout::isLittleEndian(),LHS,llvm::Lo,llvm::ISD::MERGE_VALUES,RHS,llvm::TargetLowering::MakeLibCallOptions::setIsPostTypeLegalization(),llvm::TargetLowering::MakeLibCallOptions::setIsSigned(),Signed, andllvm::ISD::SRA.
| inlinevirtual |
For some targets, an LLVM struct type must be broken down into multiple simple types, but the calling convention specifies that the entire struct must be passed in a block of consecutive registers.
Reimplemented inllvm::AArch64TargetLowering,llvm::ARMTargetLowering,llvm::PPCTargetLowering, andllvm::X86TargetLowering.
Definition at line4842 of fileTargetLowering.h.
Referenced byllvm::FastISel::lowerCallTo(),LowerCallTo(), andllvm::CallLowering::splitToValueTypes().
| inline |
This is the helper function to return the newly negated expression only when the cost is cheaper.
Definition at line4452 of fileTargetLowering.h.
Referencesllvm::TargetLoweringBase::Cheaper,llvm::Depth, andgetCheaperOrNeutralNegatedExpression().
Referenced bycombineFMA(),combineFMADDSUB(), andllvm::X86TargetLowering::getNegatedExpression().
| inline |
Definition at line4431 of fileTargetLowering.h.
ReferencesCostThreshold,llvm::Depth,llvm::TargetLoweringBase::Expensive,getNegatedExpression(),llvm::SDValue::getNode(),llvm::SelectionDAG::RemoveDeadNode(), andllvm::SDNode::use_empty().
Referenced bygetCheaperNegatedExpression().
TargetLowering::ConstraintGroup TargetLowering::getConstraintPreferences | ( | TargetLowering::AsmOperandInfo & | OpInfo | ) | const |
Given an OpInfo with list of constraints codes as strings, return a sorted Vector of pairs of constraint codes and their types in priority of what we'd prefer to lower them as.
If there are multiple different constraints that we could pick for this operand (e.g.
This may contain immediates that cannot be lowered, but it is meant to be a machine agnostic order of preferences.
"imr") try to pick the 'best' one. This is somewhat tricky: constraints (TargetLowering::ConstraintType) fall into seven classes:Register -> one specific register RegisterClass -> a group of regs Memory -> memory Address -> a symbolic memory reference Immediate -> immediate values Other -> magic values (such as "Flag Output Operands") Unknown -> something we don't recognize yet and can't handle Ideally, we would pick the most specific constraint possible: if we have something that fits into a register, we would pick it. The problem here is that if we have something that could either be in a register or in memory that use of the register could cause selection ofother operands to fail: they might only succeed if we pick memory. Because of this the heuristic we use is:
1) If there is an 'other' constraint, and if the operand is valid for that constraint, use it. This makes us take advantage of 'i' constraints when available. 2) Otherwise, pick the most general constraint present. This prefers 'm' over 'r', for example.
Definition at line6038 of fileTargetLowering.cpp.
ReferencesC_Memory,C_Register,C_RegisterClass,llvm::InlineAsm::ConstraintInfo::Codes,llvm::InlineAsm::ConstraintInfo::hasMatchingInput(), andllvm::InlineAsm::ConstraintInfo::isIndirect.
Referenced bycomputeConstraintToUse().
| virtual |
Given a constraint, return the type of constraint it is for this target.
Reimplemented inllvm::SITargetLowering,llvm::ARMTargetLowering,llvm::AVRTargetLowering,llvm::BPFTargetLowering,llvm::HexagonTargetLowering,llvm::MSP430TargetLowering,llvm::NVPTXTargetLowering,llvm::PPCTargetLowering,llvm::RISCVTargetLowering,llvm::SparcTargetLowering,llvm::SystemZTargetLowering,llvm::VETargetLowering,llvm::X86TargetLowering,llvm::XtensaTargetLowering, andllvm::M68kTargetLowering.
Definition at line5525 of fileTargetLowering.cpp.
Referencesllvm::StringRef::size(), andllvm::StringRef::substr().
Referenced bycomputeConstraintToUse(),llvm::SITargetLowering::getConstraintType(),llvm::ARMTargetLowering::getConstraintType(),llvm::AVRTargetLowering::getConstraintType(),llvm::BPFTargetLowering::getConstraintType(),llvm::HexagonTargetLowering::getConstraintType(),llvm::MSP430TargetLowering::getConstraintType(),llvm::NVPTXTargetLowering::getConstraintType(),llvm::PPCTargetLowering::getConstraintType(),llvm::RISCVTargetLowering::getConstraintType(),llvm::SparcTargetLowering::getConstraintType(),llvm::SystemZTargetLowering::getConstraintType(),llvm::VETargetLowering::getConstraintType(),llvm::X86TargetLowering::getConstraintType(),llvm::XtensaTargetLowering::getConstraintType(), andllvm::M68kTargetLowering::getConstraintType().
| inlinevirtual |
Reimplemented inllvm::ARMTargetLowering,llvm::AVRTargetLowering,llvm::M68kTargetLowering,llvm::PPCTargetLowering,llvm::RISCVTargetLowering,llvm::SystemZTargetLowering, andllvm::X86TargetLowering.
Definition at line5062 of fileTargetLowering.h.
Referencesllvm::InlineAsm::m,llvm::InlineAsm::o,llvm::InlineAsm::p,llvm::InlineAsm::Unknown, andllvm::InlineAsm::X.
Referenced byllvm::ARMTargetLowering::getInlineAsmMemConstraint(),llvm::AVRTargetLowering::getInlineAsmMemConstraint(),llvm::M68kTargetLowering::getInlineAsmMemConstraint(),llvm::PPCTargetLowering::getInlineAsmMemConstraint(),llvm::RISCVTargetLowering::getInlineAsmMemConstraint(),llvm::SystemZTargetLowering::getInlineAsmMemConstraint(),llvm::X86TargetLowering::getInlineAsmMemConstraint(), andllvm::InlineAsmLowering::lowerInlineAsm().
| virtual |
Return the entry encoding for a jump table in the current function.
The returned value is a member of theMachineJumpTableInfo::JTEntryKind enum.
Reimplemented inllvm::ARMTargetLowering,llvm::M68kTargetLowering,llvm::NVPTXTargetLowering,llvm::PPCTargetLowering,llvm::RISCVTargetLowering,llvm::VETargetLowering,llvm::X86TargetLowering, andllvm::XCoreTargetLowering.
Definition at line444 of fileTargetLowering.cpp.
Referencesllvm::MachineJumpTableInfo::EK_BlockAddress,llvm::MachineJumpTableInfo::EK_GPRel32BlockAddress,llvm::MachineJumpTableInfo::EK_LabelDifference32, andllvm::TargetLoweringBase::getTargetMachine().
Referenced byllvm::PPCTargetLowering::getJumpTableEncoding(),llvm::RISCVTargetLowering::getJumpTableEncoding(),llvm::VETargetLowering::getJumpTableEncoding(), andllvm::X86TargetLowering::getJumpTableEncoding().
| inlinevirtual |
Reimplemented inllvm::NVPTXTargetLowering.
Definition at line3857 of fileTargetLowering.h.
ReferencesDL, andllvm::TargetLoweringBase::getPointerTy().
Referenced byllvm::SelectionDAGBuilder::visitJumpTable(), andllvm::SelectionDAGBuilder::visitJumpTableHeader().
| virtual |
Examine constraint type and operand type and determine a weight value.
The operand object must already have been set up with the operand type.
This object must already have been set up with the operand type and the current alternative constraint selected.
Definition at line5945 of fileTargetLowering.cpp.
Referencesinfo.
| virtual |
Return the newly negated expression if the cost is not expensive and set the cost inCost
to indicate that if it is cheaper or neutral to do the negation.
Reimplemented inllvm::AMDGPUTargetLowering,llvm::X86TargetLowering, andllvm::PPCTargetLowering.
Definition at line7295 of fileTargetLowering.cpp.
Referencesllvm::all_of(),llvm::any_of(),llvm::ISD::BUILD_VECTOR,llvm::CallingConv::C,llvm::TargetLoweringBase::Cheaper,llvm::ISD::ConstantFP,llvm::Depth,DL,llvm::TargetLoweringBase::Expensive,llvm::ISD::FADD,llvm::ISD::FDIV,llvm::ISD::FMA,llvm::ISD::FMAD,llvm::ISD::FMUL,llvm::ISD::FNEG,llvm::ISD::FP_EXTEND,llvm::ISD::FP_ROUND,llvm::ISD::FSIN,llvm::ISD::FSUB,llvm::SelectionDAG::getBuildVector(),llvm::SelectionDAG::getConstantFP(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getSelect(),llvm::SelectionDAG::getTarget(),llvm::isConstOrConstSplatFP(),llvm::TargetLoweringBase::isFPExtFree(),llvm::TargetLoweringBase::isFPImmLegal(),llvm::TargetLoweringBase::isOperationLegal(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),LHS,llvm::SelectionDAG::MaxRecursionDepth,N,llvm::neg(),llvm::TargetLoweringBase::Neutral,llvm::TargetMachine::Options,Options,llvm::SmallVectorTemplateBase< T, bool >::push_back(),llvm::SelectionDAG::RemoveDeadNode(),RHS,llvm::ISD::SELECT,llvm::SDValue::use_empty(),llvm::ISD::VSELECT,X, andY.
Referenced bycombineFneg(),getCheaperOrNeutralNegatedExpression(),llvm::AMDGPUTargetLowering::getNegatedExpression(),llvm::X86TargetLowering::getNegatedExpression(),llvm::PPCTargetLowering::getNegatedExpression(), andgetNegatedExpression().
| inline |
This is the helper function to return the newly negated expression if the cost is not expensive.
Definition at line4461 of fileTargetLowering.h.
Referencesllvm::Depth,llvm::TargetLoweringBase::Expensive, andgetNegatedExpression().
| virtual |
Returns relocation base for the given PIC jumptable.
Reimplemented inllvm::HexagonTargetLowering,llvm::M68kTargetLowering,llvm::PPCTargetLowering,llvm::VETargetLowering, andllvm::X86TargetLowering.
Definition at line457 of fileTargetLowering.cpp.
Referencesllvm::MachineJumpTableInfo::EK_GPRel32BlockAddress,llvm::MachineJumpTableInfo::EK_GPRel64BlockAddress,llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getGLOBAL_OFFSET_TABLE(), andllvm::TargetLoweringBase::getPointerTy().
Referenced byllvm::PPCTargetLowering::getPICJumpTableRelocBase().
| virtual |
This returns the relocation base for the given PIC jumptable, the same as getPICJumpTableRelocBase, but as anMCExpr.
Reimplemented inllvm::M68kTargetLowering,llvm::PPCTargetLowering, andllvm::X86TargetLowering.
Definition at line472 of fileTargetLowering.cpp.
Referencesllvm::MCSymbolRefExpr::create(), andllvm::MachineFunction::getJTISymbol().
Referenced byllvm::AsmPrinter::getCodeViewJumpTableInfo(),llvm::PPCTargetLowering::getPICJumpTableRelocBaseExpr(), andllvm::X86TargetLowering::getPICJumpTableRelocBaseExpr().
| inlinevirtual |
Returns true by value, base pointer and offset pointer and addressing mode by reference if this node can be combined with a load / store to form a post-indexed load / store.
Reimplemented inllvm::ARMTargetLowering,llvm::AVRTargetLowering,llvm::HexagonTargetLowering, andllvm::RISCVTargetLowering.
Definition at line3837 of fileTargetLowering.h.
Referenced byshouldCombineToPostInc().
| inlinevirtual |
Returns true by value, base pointer and offset pointer and addressing mode by reference if the node's address can be legally represented as pre-indexed load / store address.
Reimplemented inllvm::ARMTargetLowering,llvm::AVRTargetLowering,llvm::PPCTargetLowering, andllvm::RISCVTargetLowering.
Definition at line3827 of fileTargetLowering.h.
| inlinevirtual |
Return a reciprocal estimate value for the input operand.
Enabled
is a ReciprocalEstimate enum with value either 'Unspecified' or 'Enabled' as set by a potential default override attribute. IfRefinementSteps
is 'Unspecified', the number of Newton-Raphson refinement iterations required to generate a sufficient (though not necessarily IEEE-754 compliant) estimate is returned in that parameter. A target may choose to implement its own refinement within this function. If that's true, then return '0' as the number of RefinementSteps to avoid any further refinement of the estimate. An emptySDValue return means no estimate sequence can be created.
Reimplemented inllvm::AMDGPUTargetLowering, andllvm::LoongArchTargetLowering.
Definition at line5177 of fileTargetLowering.h.
| virtual |
Given a physical register constraint (e.g.
{edx}), return the register number and the register class for the register.
Given a register class constraint, like 'r', if this corresponds directly to an LLVM register class, return a register of 0 and the register class pointer.
This should only be used for C_Register constraints. On error, this returns a register number of 0 and a null register class pointer.
Reimplemented inllvm::SITargetLowering,llvm::ARMTargetLowering,llvm::AVRTargetLowering,llvm::BPFTargetLowering,llvm::HexagonTargetLowering,llvm::LanaiTargetLowering,llvm::M68kTargetLowering,llvm::MSP430TargetLowering,llvm::NVPTXTargetLowering,llvm::PPCTargetLowering,llvm::RISCVTargetLowering,llvm::SparcTargetLowering,llvm::SPIRVTargetLowering,llvm::SystemZTargetLowering,llvm::VETargetLowering,llvm::X86TargetLowering, andllvm::XtensaTargetLowering.
Definition at line5669 of fileTargetLowering.cpp.
Referencesassert(),llvm::StringRef::data(),llvm::StringRef::end(),llvm::TargetRegisterInfo::getRegAsmName(),llvm::TargetLoweringBase::isLegalRC(),llvm::TargetRegisterInfo::isTypeLegalForClass(),llvm::TargetRegisterInfo::regclasses(),RegName,llvm::StringRef::size(), andllvm::StringRef::starts_with().
Referenced byllvm::SITargetLowering::getRegForInlineAsmConstraint(),llvm::ARMTargetLowering::getRegForInlineAsmConstraint(),llvm::AVRTargetLowering::getRegForInlineAsmConstraint(),llvm::BPFTargetLowering::getRegForInlineAsmConstraint(),llvm::HexagonTargetLowering::getRegForInlineAsmConstraint(),llvm::LanaiTargetLowering::getRegForInlineAsmConstraint(),llvm::M68kTargetLowering::getRegForInlineAsmConstraint(),llvm::MSP430TargetLowering::getRegForInlineAsmConstraint(),llvm::NVPTXTargetLowering::getRegForInlineAsmConstraint(),llvm::PPCTargetLowering::getRegForInlineAsmConstraint(),llvm::RISCVTargetLowering::getRegForInlineAsmConstraint(),llvm::SparcTargetLowering::getRegForInlineAsmConstraint(),llvm::SystemZTargetLowering::getRegForInlineAsmConstraint(),llvm::VETargetLowering::getRegForInlineAsmConstraint(),llvm::X86TargetLowering::getRegForInlineAsmConstraint(),llvm::XtensaTargetLowering::getRegForInlineAsmConstraint(),getRegistersForValue(),patchMatchingInput(), andllvm::FunctionLoweringInfo::set().
| inlinevirtual |
Return the register ID of the name passed in.
Used by named register global variables extension. There is no target-independent behaviour so the default action is to bail.
Reimplemented inllvm::SITargetLowering,llvm::AVRTargetLowering,llvm::HexagonTargetLowering,llvm::LanaiTargetLowering,llvm::LoongArchTargetLowering,llvm::MipsTargetLowering,llvm::PPCTargetLowering,llvm::RISCVTargetLowering,llvm::SparcTargetLowering,llvm::SystemZTargetLowering,llvm::VETargetLowering, andllvm::X86TargetLowering.
Definition at line4821 of fileTargetLowering.h.
Referencesllvm::report_fatal_error().
Referenced byllvm::LegalizerHelper::lowerReadWriteRegister().
Returns a 0 terminated array of rounding control registers that can be attached into strict FP call.
Reimplemented inllvm::AArch64TargetLowering, andllvm::SITargetLowering.
Definition at line4865 of fileTargetLowering.h.
Referenced byllvm::InlineAsmLowering::lowerInlineAsm().
| inlinevirtual |
Returns a 0 terminated array of registers that can be safely used as scratch registers.
Reimplemented inllvm::AArch64TargetLowering,llvm::PPCTargetLowering, andllvm::SystemZTargetLowering.
Definition at line4859 of fileTargetLowering.h.
Referenced byllvm::FastISel::selectPatchpoint(), andllvm::FastISel::selectStackmap().
| virtual |
Examine constraint string and operand type and determine a weight value.
Examine constraint type and operand type and determine a weight value.
The operand object must already have been set up with the operand type.
This object must already have been set up with the operand type and the current alternative constraint selected.
Reimplemented inllvm::ARMTargetLowering,llvm::AVRTargetLowering,llvm::LanaiTargetLowering,llvm::PPCTargetLowering,llvm::SparcTargetLowering,llvm::SystemZTargetLowering,llvm::X86TargetLowering, andllvm::XtensaTargetLowering.
Definition at line5969 of fileTargetLowering.cpp.
Referencesllvm::Value::getType(),info, andllvm::Type::isIntegerTy().
Referenced byllvm::ARMTargetLowering::getSingleConstraintMatchWeight(),llvm::AVRTargetLowering::getSingleConstraintMatchWeight(),llvm::LanaiTargetLowering::getSingleConstraintMatchWeight(),llvm::PPCTargetLowering::getSingleConstraintMatchWeight(),llvm::SparcTargetLowering::getSingleConstraintMatchWeight(),llvm::SystemZTargetLowering::getSingleConstraintMatchWeight(),llvm::X86TargetLowering::getSingleConstraintMatchWeight(), andllvm::XtensaTargetLowering::getSingleConstraintMatchWeight().
| inlinevirtual |
Hooks for building estimates in place of slower divisions and square roots.
Return either a square root or its reciprocal estimate value for the input operand.Enabled
is a ReciprocalEstimate enum with value either 'Unspecified' or 'Enabled' as set by a potential default override attribute. IfRefinementSteps
is 'Unspecified', the number of Newton-Raphson refinement iterations required to generate a sufficient (though not necessarily IEEE-754 compliant) estimate is returned in that parameter. The boolean UseOneConstNR output is used to select a Newton-Raphson algorithm implementation that uses either one or two constants. The boolean Reciprocal is used to select whether the estimate is for the square root of the input operand or the reciprocal of its square root. A target may choose to implement its own refinement within this function. If that's true, then return '0' as the number of RefinementSteps to avoid any further refinement of the estimate. An emptySDValue return means no estimate sequence can be created.
Reimplemented inllvm::NVPTXTargetLowering,llvm::AMDGPUTargetLowering, andllvm::LoongArchTargetLowering.
Definition at line5154 of fileTargetLowering.h.
| virtual |
Return a target-dependent comparison result if the input operand is suitable for use with a square root estimate calculation.
For example, the comparison may check if the operand is NAN, INF, zero, normal, etc. The result should be used as the condition operand for a select or branch.
Definition at line7270 of fileTargetLowering.cpp.
ReferencesDL,llvm::ISD::FABS,llvm::SelectionDAG::getConstantFP(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::EVT::getFltSemantics(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::APFloat::getSmallestNormalized(),llvm::DenormalMode::PositiveZero,llvm::DenormalMode::PreserveSign,llvm::ISD::SETEQ, andllvm::ISD::SETLT.
| inlinevirtual |
Return a target-dependent result if the input operand is not suitable for use with a square root estimate calculation.
Definition at line5191 of fileTargetLowering.h.
Referencesllvm::SelectionDAG::getConstantFP(), andllvm::SDValue::getValueType().
| virtual |
This method returns the constant pool value that will be loaded by LD.
NOTE: You must check for implicit extensions of the constant by LD.
Reimplemented inllvm::RISCVTargetLowering, andllvm::X86TargetLowering.
Definition at line3883 of fileTargetLowering.cpp.
Referenced byllvm::SelectionDAG::computeKnownBits(), andllvm::SelectionDAG::ComputeNumSignBits().
This method returns the name of a target specific DAG node.
Reimplemented inllvm::AArch64TargetLowering,llvm::AMDGPUTargetLowering,llvm::ARCTargetLowering,llvm::ARMTargetLowering,llvm::AVRTargetLowering,llvm::BPFTargetLowering,llvm::HexagonTargetLowering,llvm::LanaiTargetLowering,llvm::LoongArchTargetLowering,llvm::M68kTargetLowering,llvm::MipsTargetLowering,llvm::MSP430TargetLowering,llvm::NVPTXTargetLowering,llvm::PPCTargetLowering,llvm::RISCVTargetLowering,llvm::SparcTargetLowering,llvm::SystemZTargetLowering,llvm::VETargetLowering,llvm::X86TargetLowering,llvm::XCoreTargetLowering, andllvm::XtensaTargetLowering.
Definition at line43 of fileTargetLowering.cpp.
Referenced byllvm::SDNode::getOperationName().
| inlinevirtual |
Return the type that should be used to zero or sign extend a zeroext/signext integer return value.
FIXME: Some C calling conventions require the return type to be promoted, but this is not true all the time, e.g. i1/i8/i16 on x86/x86_64. It is also not necessary for non-C calling conventions. The frontend should handle this and include all of the necessary information.
Reimplemented inllvm::AMDGPUTargetLowering, andllvm::MipsTargetLowering.
Definition at line4832 of fileTargetLowering.h.
Referencesllvm::EVT::bitsLT(), andllvm::TargetLoweringBase::getRegisterType().
Referenced byllvm::GetReturnInfo().
SDValue TargetLowering::getVectorElementPointer | ( | SelectionDAG & | DAG, |
SDValue | VecPtr, | ||
EVT | VecVT, | ||
SDValue | Index | ||
) | const |
Get a pointer to vector elementIdx
located in memory for a vector of typeVecVT
starting at a base address ofVecPtr
.
IfIdx
is out of bounds the returned pointer is unspecified, but will be within the vector bounds.
Definition at line10483 of fileTargetLowering.cpp.
Referencesllvm::SelectionDAG::getContext(),llvm::EVT::getVectorElementType(), andllvm::EVT::getVectorVT().
Referenced bycombineExtractFromVectorLoad().
SDValue TargetLowering::getVectorSubVecPointer | ( | SelectionDAG & | DAG, |
SDValue | VecPtr, | ||
EVT | VecVT, | ||
EVT | SubVecVT, | ||
SDValue | Index | ||
) | const |
Get a pointer to a sub-vector of typeSubVecVT
at indexIdx
located in memory for a vector of typeVecVT
starting at a base address ofVecPtr
.
IfIdx
plus the size ofSubVecVT
is out of bounds the returned pointer is unspecified, but the value returned will be such that the entire subvector would be within the vector bounds.
Definition at line10492 of fileTargetLowering.cpp.
Referencesassert(),clampDynamicVectorIndex(),llvm::SelectionDAG::getConstant(),llvm::EVT::getFixedSizeInBits(),llvm::SelectionDAG::getMemBasePlusOffset(),llvm::SelectionDAG::getNode(),llvm::EVT::getSizeInBits(),llvm::SDValue::getValueType(),llvm::EVT::getVectorElementCount(),llvm::EVT::getVectorElementType(),llvm::SelectionDAG::getVScale(),llvm::SelectionDAG::getZExtOrTrunc(),llvm::EVT::isScalableVector(), andllvm::ISD::MUL.
Target-specific cleanup for formal ByVal parameters.
Reimplemented inllvm::MipsTargetLowering.
Definition at line4776 of fileTargetLowering.h.
Referenced byllvm::CCState::HandleByVal().
SDValue TargetLowering::IncrementMemoryAddress | ( | SDValue | Addr, |
SDValue | Mask, | ||
constSDLoc & | DL, | ||
EVT | DataVT, | ||
SelectionDAG & | DAG, | ||
bool | IsCompressedMemory | ||
) | const |
Increments memory addressAddr
according to the type of the valueDataVT
that should be stored.
If the data is stored in compressed form, the memory address should be incremented according to the number of the stored elements. This number is equal to the number of '1's bits in theMask
.DataVT
is a vector type.Mask
is a vector value.DataVT
andMask
have the same number of vector elements.
Definition at line10411 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,Addr,assert(),llvm::ISD::CTPOP,DL,llvm::SelectionDAG::getBitcast(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::EVT::getFixedSizeInBits(),llvm::EVT::getIntegerVT(),llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(),llvm::SelectionDAG::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::EVT::getSizeInBits(),llvm::EVT::getStoreSize(),llvm::EVT::getVectorElementCount(),llvm::SelectionDAG::getVScale(),llvm::SelectionDAG::getZExtOrTrunc(),llvm::EVT::isScalableVector(),llvm::ISD::MUL,llvm::report_fatal_error(), andllvm::ISD::ZERO_EXTEND.
| inlinevirtual |
Perform necessary initialization to handle a subset of CSRs explicitly via copies.
This function is called at the beginning of instruction selection.
Reimplemented inllvm::AArch64TargetLowering, andllvm::SITargetLowering.
Definition at line4409 of fileTargetLowering.h.
Referencesllvm_unreachable.
Referenced byllvm::SelectionDAGISel::runOnMachineFunction().
| inlinevirtual |
Insert explicit copies in entry and exit blocks.
We copy a subset of CSRs to virtual registers in the entry block, and copy them back to physical registers in the exit blocks. This function is called at the end of instruction selection.
Reimplemented inllvm::AArch64TargetLowering, andllvm::SITargetLowering.
Definition at line4417 of fileTargetLowering.h.
Referencesllvm_unreachable.
Referenced byllvm::SelectionDAGISel::runOnMachineFunction().
Return if the N is a constant or constant vector equal to the false value fromgetBooleanContents().
Definition at line3981 of fileTargetLowering.cpp.
Referencesllvm::ConstantSDNode::getAPIntValue(),llvm::TargetLoweringBase::getBooleanContents(),llvm::BuildVectorSDNode::getConstantSplatNode(),llvm::ConstantSDNode::isZero(),N, andllvm::TargetLoweringBase::UndefinedBooleanContent.
Return if the N is a constant or constant vector equal to the true value fromgetBooleanContents().
Definition at line3951 of fileTargetLowering.cpp.
Referencesllvm::APInt::getBitWidth(),llvm::TargetLoweringBase::getBooleanContents(),llvm::APInt::isAllOnes(),llvm::isConstOrConstSplat(),llvm::APInt::isOne(),llvm_unreachable,N,llvm::APInt::trunc(),llvm::TargetLoweringBase::UndefinedBooleanContent,llvm::TargetLoweringBase::ZeroOrNegativeOneBooleanContent, andllvm::TargetLoweringBase::ZeroOrOneBooleanContent.
Referenced byPerformXORCombine().
| inlinevirtual |
Reimplemented inllvm::X86TargetLowering.
Definition at line4351 of fileTargetLowering.h.
Referencesllvm::TargetLoweringBase::None.
Referenced byfoldAndOrOfSETCC().
| inlinevirtual |
GlobalISel - return true if it is profitable to move this shift by a constant amount through its operand, adjusting any immediate operands as necessary to preserve semantics.
This transformation may not be desirable if it disrupts a particularly auspicious target-specific tree (e.g. bitfield extraction inAArch64). By default, it returns true.
MI | the shift instruction |
IsAfterLegal | true if running after legalization. |
Definition at line4322 of fileTargetLowering.h.
| inlinevirtual |
Return true if it is profitable to move this shift by a constant amount through its operand, adjusting any immediate operands as necessary to preserve semantics.
This transformation may not be desirable if it disrupts a particularly auspicious target-specific tree (e.g. bitfield extraction inAArch64). By default, it returns true.
N | the shift node |
Level | the current DAGCombine legalization level. |
Reimplemented inllvm::AArch64TargetLowering,llvm::AMDGPUTargetLowering,llvm::ARMTargetLowering, andllvm::RISCVTargetLowering.
Definition at line4303 of fileTargetLowering.h.
Referencesllvm::SDValue::getOpcode(),llvm::SDValue::getOperand(),llvm::SDNode::hasOneUse(),N, andllvm::ISD::SIGN_EXTEND.
| inlinevirtual |
Return true if it is profitable to combine an XOR of a logical shift to create a logical shift of NOT.
This transformation may not be desirable if it disrupts a particularly auspicious target-specific tree (e.g. BIC on ARM/AArch64). By default, it returns true.
Reimplemented inllvm::AArch64TargetLowering, andllvm::ARMTargetLowering.
Definition at line4360 of fileTargetLowering.h.
This method query the target whether it is beneficial for dag combiner to promote the specified node.
If true, it should return the desired promotion type by reference.
Reimplemented inllvm::X86TargetLowering.
Definition at line4384 of fileTargetLowering.h.
| inlinevirtual |
GlobalISel - return true if it's profitable to perform the combine: shl ([sza]ext x), y => zext (shl x, y)
Reimplemented inllvm::AArch64TargetLowering.
Definition at line4329 of fileTargetLowering.h.
| inlinevirtual |
Return true if it is profitable for dag combiner to transform a floating point op of specified opcode to a equivalent op of an integer type.
e.g. f32 load -> i32 load can be profitable onARM.
Reimplemented inllvm::ARMTargetLowering, andllvm::PPCTargetLowering.
Definition at line4376 of fileTargetLowering.h.
bool TargetLowering::isExtendedTrueVal | ( | constConstantSDNode * | N, |
EVT | VT, | ||
bool | SExt | ||
) | const |
Return ifN
is a True value when extended toVT
.
Definition at line4005 of fileTargetLowering.cpp.
Referencesllvm::TargetLoweringBase::getBooleanContents(),llvm_unreachable,N,llvm::TargetLoweringBase::UndefinedBooleanContent,llvm::TargetLoweringBase::ZeroOrNegativeOneBooleanContent, andllvm::TargetLoweringBase::ZeroOrOneBooleanContent.
| virtual |
Returns true (and theGlobalValue and the offset) if the node is a GlobalAddress + offset.
Definition at line5484 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::SDValue::getNode(),N, andllvm::Offset.
Referenced byllvm::SelectionDAG::InferPtrAlign(), andisConsecutiveLSLoc().
| virtual |
Return true if this function can prove thatOp
is never poison and, ifPoisonOnly
is false, does not have undef bits.
The DemandedElts argument limits the check to the requested vector elements.
Reimplemented inllvm::SystemZTargetLowering, andllvm::X86TargetLowering.
Definition at line3887 of fileTargetLowering.cpp.
Referencesllvm::all_of(),assert(),llvm::ISD::BUILTIN_OP_END,llvm::Depth,llvm::ISD::INTRINSIC_VOID,llvm::ISD::INTRINSIC_W_CHAIN,llvm::ISD::INTRINSIC_WO_CHAIN, andPoisonOnly.
Referenced byllvm::SelectionDAG::isGuaranteedNotToBeUndefOrPoison(), andllvm::X86TargetLowering::isGuaranteedNotToBeUndefOrPoisonForTargetNode().
| inlinevirtual |
Returns true if the specified base+offset is a legal indexed addressing mode for this target.
MI
is the load or store instruction that is being considered for transformation.
Definition at line3848 of fileTargetLowering.h.
| inlinevirtual |
On x86, return true if the operand with index OpNo is a CALL or JUMP instruction, which can use either a memory constraint or an address constraint.
-fasm-blocks "__asm call foo" lowers to call void asm sideeffect inteldialect "call ${0:P}", "*m..."
This function is used by a hack to choose the address constraint, lowering to a direct call.
Reimplemented inllvm::X86TargetLowering.
Definition at line3890 of fileTargetLowering.h.
bool TargetLowering::isInTailCallPosition | ( | SelectionDAG & | DAG, |
SDNode * | Node, | ||
SDValue & | Chain | ||
) | const |
Check whether a given call node is in tail position within its function.
If so, it sets Chain to the input chain of the tail call.
Definition at line53 of fileTargetLowering.cpp.
Referencesllvm::AttrBuilder::contains(),F,llvm::MachineFunction::getFunction(),llvm::SelectionDAG::getMachineFunction(),llvm::AttrBuilder::hasAttributes(),isUsedByReturnOnly(), andllvm::AttrBuilder::removeAttribute().
| virtual |
IfSNaN
is false,.
Op
is known to never be any NaN. IfsNaN
is true, returns ifOp
is known to never be a signaling NaN.Reimplemented inllvm::AMDGPUTargetLowering, andllvm::SITargetLowering.
Definition at line3921 of fileTargetLowering.cpp.
Referencesassert(),llvm::ISD::BUILTIN_OP_END,llvm::ISD::INTRINSIC_VOID,llvm::ISD::INTRINSIC_W_CHAIN, andllvm::ISD::INTRINSIC_WO_CHAIN.
Referenced byllvm::SelectionDAG::isKnownNeverNaN().
| virtual |
Return true if folding a constant offset with the given GlobalAddress is legal.
It is frequently not legal in PIC relocation models.
Reimplemented inllvm::AArch64TargetLowering,llvm::SITargetLowering,llvm::ARMTargetLowering,llvm::AVRTargetLowering,llvm::BPFTargetLowering,llvm::HexagonTargetLowering,llvm::LoongArchTargetLowering,llvm::PPCTargetLowering,llvm::RISCVTargetLowering,llvm::SparcTargetLowering,llvm::VETargetLowering, andllvm::XtensaTargetLowering.
Definition at line490 of fileTargetLowering.cpp.
Referencesllvm::GlobalAddressSDNode::getGlobal(), andllvm::TargetLoweringBase::getTargetMachine().
Referenced byllvm::SelectionDAG::FoldSymbolOffset(), andllvm::SelectionDAG::isConstantIntBuildVectorOrConstantInt().
bool TargetLowering::isPositionIndependent | ( | ) | const |
Definition at line47 of fileTargetLowering.cpp.
Referencesllvm::TargetLoweringBase::getTargetMachine(), andllvm::TargetMachine::isPositionIndependent().
Referenced byllvm::MipsTargetLowering::AdjustInstrPostInstrSelection(),llvm::PPCTargetLowering::emitEHSjLjLongJmp(),llvm::VETargetLowering::emitSjLjDispatchBlock(),llvm::RISCVTargetLowering::getJumpTableEncoding(),llvm::VETargetLowering::getJumpTableEncoding(),llvm::X86TargetLowering::getJumpTableEncoding(),llvm::VETargetLowering::getPICJumpTableRelocBase(),llvm::X86TargetLowering::isLegalAddressingMode(),llvm::XtensaTargetLowering::LowerCall(),llvm::VETargetLowering::LowerCall(),llvm::SparcTargetLowering::LowerCall_32(),llvm::SparcTargetLowering::LowerCall_64(),llvm::HexagonTargetLowering::LowerConstantPool(),llvm::RISCVTargetLowering::LowerCustomJumpTableEntry(),llvm::VETargetLowering::LowerCustomJumpTableEntry(),llvm::X86TargetLowering::LowerCustomJumpTableEntry(),llvm::VETargetLowering::lowerINTRINSIC_WO_CHAIN(),llvm::HexagonTargetLowering::LowerJumpTable(),llvm::VETargetLowering::lowerToTLSGeneralDynamicModel(),llvm::HexagonTargetLowering::LowerToTLSInitialExecModel(),llvm::SparcTargetLowering::makeAddress(),llvm::VETargetLowering::makeAddress(),llvm::VETargetLowering::prepareMBB(),llvm::VETargetLowering::prepareSymbol(), andpromoteToConstantPool().
| inlinevirtual |
Reimplemented inllvm::AMDGPUTargetLowering, andllvm::SITargetLowering.
Definition at line3815 of fileTargetLowering.h.
ReferencesMRI.
| inlinevirtual |
Reimplemented inllvm::AArch64TargetLowering, andllvm::SITargetLowering.
Definition at line3804 of fileTargetLowering.h.
Referencesllvm::SDValue::hasOneUse().
Referenced byllvm::CombinerHelper::tryReassocBinOp().
Reimplemented inllvm::AMDGPUTargetLowering.
Definition at line3820 of fileTargetLowering.h.
Referenced byllvm::SelectionDAG::calculateDivergence().
| inlinevirtual |
Reimplemented inllvm::SITargetLowering.
Definition at line3792 of fileTargetLowering.h.
Referenced byllvm::SelectionDAG::calculateDivergence(), andllvm::SelectionDAG::getRegister().
| virtual |
Return true if vectorOp
has the same value across allDemandedElts
, indicating any elements which may be undef in the outputUndefElts
.
Reimplemented inllvm::X86TargetLowering.
Definition at line3934 of fileTargetLowering.cpp.
Referencesassert(),llvm::ISD::BUILTIN_OP_END,llvm::ISD::INTRINSIC_VOID,llvm::ISD::INTRINSIC_W_CHAIN, andllvm::ISD::INTRINSIC_WO_CHAIN.
Referenced byllvm::SelectionDAG::isSplatValue(), andllvm::X86TargetLowering::isSplatValueForTargetNode().
Returns true if the given Opc is considered a canonical constant for the target, which should not be transformed back into a BUILD_VECTOR.
Reimplemented inllvm::HexagonTargetLowering, andllvm::X86TargetLowering.
Definition at line4223 of fileTargetLowering.h.
Referencesllvm::ISD::SPLAT_VECTOR, andllvm::ISD::SPLAT_VECTOR_PARTS.
Referenced byllvm::HexagonTargetLowering::isTargetCanonicalConstantNode(), andllvm::X86TargetLowering::isTargetCanonicalConstantNode().
Return true if the target has native support for the specified value type and it is 'desirable' to use the type for the given node type.
e.g. On x86 i16 is legal, but undesirable since i16 instruction encodings are longer and some i16 instructions are slow.
Reimplemented inllvm::SITargetLowering,llvm::AArch64TargetLowering, andllvm::X86TargetLowering.
Definition at line4368 of fileTargetLowering.h.
Referencesllvm::TargetLoweringBase::isTypeLegal().
Referenced byfoldToSaturated(),llvm::SITargetLowering::isTypeDesirableForOp(), andllvm::AArch64TargetLowering::isTypeDesirableForOp().
Return true if result of the specified node is used by a return node only.
It also compute and return the input chain for the tail call.
This is used to determine whether it is possible to codegen a libcall as tail call at legalization time.
Reimplemented inllvm::LoongArchTargetLowering, andllvm::RISCVTargetLowering.
Definition at line4807 of fileTargetLowering.h.
Referenced byisInTailCallPosition().
| inlinevirtual |
Reimplemented inllvm::X86TargetLowering.
Definition at line5617 of fileTargetLowering.h.
| inlinevirtual |
Target-specific combining of register parts into its original value.
Reimplemented inllvm::RISCVTargetLowering, andllvm::SystemZTargetLowering.
Definition at line4499 of fileTargetLowering.h.
Referenced bygetCopyFromParts().
bool TargetLowering::LegalizeSetCCCondCode | ( | SelectionDAG & | DAG, |
EVT | VT, | ||
SDValue & | LHS, | ||
SDValue & | RHS, | ||
SDValue & | CC, | ||
SDValue | Mask, | ||
SDValue | EVL, | ||
bool & | NeedInvert, | ||
constSDLoc & | dl, | ||
SDValue & | Chain, | ||
bool | IsSignaling =false | ||
) | const |
Legalize a SETCC or VP_SETCC with given LHS and RHS and condition code CC on the current target.
A VP_SETCC will additionally be given a Mask and/or EVL not equal to SDValue().
If the SETCC has been legalized using AND / OR, then the legalized node will be stored in LHS. RHS and CC will be set to SDValue(). NeedInvert will be set to false. This will also hold if the VP_SETCC has been legalized using VP_AND / VP_OR.
If the SETCC / VP_SETCC has been legalized by using getSetCCSwappedOperands(), then the values of LHS and RHS will be swapped, CC will be set to the new condition, and NeedInvert will be set to false.
If the SETCC / VP_SETCC has been legalized using the inverse condcode, then LHS and RHS will be unchanged, CC will set to the inverted condcode, and NeedInvert will be set to true. The caller must invert the result of the SETCC withSelectionDAG::getLogicalNOT() or take equivalent action to swap the effect of a true/false result.
Definition at line11893 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,assert(),CC,llvm::TargetLoweringBase::Expand,llvm::SelectionDAG::getCondCode(),llvm::TargetLoweringBase::getCondCodeAction(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getNOT(),llvm::SelectionDAG::getSetCC(),llvm::ISD::getSetCCSwappedOperands(),llvm::SelectionDAG::getSetCCVP(),llvm::SDValue::getValue(),llvm::SelectionDAG::getZExtOrTrunc(),llvm::TargetLoweringBase::isCondCodeLegal(),llvm::TargetLoweringBase::isCondCodeLegalOrCustom(),llvm::MVT::isInteger(),llvm::TargetLoweringBase::Legal,LHS,llvm_unreachable,llvm::ISD::OR,RHS,llvm::ISD::SETCC_INVALID,llvm::ISD::SETEQ,llvm::ISD::SETGE,llvm::ISD::SETGT,llvm::ISD::SETLE,llvm::ISD::SETLT,llvm::ISD::SETNE,llvm::ISD::SETO,llvm::ISD::SETOEQ,llvm::ISD::SETOGE,llvm::ISD::SETOGT,llvm::ISD::SETOLE,llvm::ISD::SETOLT,llvm::ISD::SETONE,llvm::ISD::SETUEQ,llvm::ISD::SETUGE,llvm::ISD::SETUGT,llvm::ISD::SETULE,llvm::ISD::SETULT,llvm::ISD::SETUNE,llvm::ISD::SETUO,std::swap(),llvm::ISD::TokenFactor, andllvm::ISD::XOR.
| virtual |
Lower the specified operand into the Ops vector.
If it is invalid, don't add anything to Ops.
Reimplemented inllvm::SITargetLowering,llvm::ARMTargetLowering,llvm::AVRTargetLowering,llvm::LanaiTargetLowering,llvm::M68kTargetLowering,llvm::NVPTXTargetLowering,llvm::PPCTargetLowering,llvm::RISCVTargetLowering,llvm::SparcTargetLowering,llvm::SystemZTargetLowering,llvm::X86TargetLowering, andllvm::XtensaTargetLowering.
Definition at line5587 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::CallingConv::C,llvm::TargetLoweringBase::getBooleanContents(),llvm::TargetLoweringBase::getExtendForContent(),llvm::SelectionDAG::getTargetBlockAddress(),llvm::SelectionDAG::getTargetConstant(),llvm::SelectionDAG::getTargetGlobalAddress(),llvm::Offset,llvm::ISD::SIGN_EXTEND,llvm::StringRef::size(),llvm::ISD::SUB, andllvm::ISD::ZERO_EXTEND.
Referenced byllvm::SITargetLowering::LowerAsmOperandForConstraint(),llvm::ARMTargetLowering::LowerAsmOperandForConstraint(),llvm::AVRTargetLowering::LowerAsmOperandForConstraint(),llvm::LanaiTargetLowering::LowerAsmOperandForConstraint(),llvm::M68kTargetLowering::LowerAsmOperandForConstraint(),llvm::NVPTXTargetLowering::LowerAsmOperandForConstraint(),llvm::PPCTargetLowering::LowerAsmOperandForConstraint(),llvm::RISCVTargetLowering::LowerAsmOperandForConstraint(),llvm::SparcTargetLowering::LowerAsmOperandForConstraint(),llvm::SystemZTargetLowering::LowerAsmOperandForConstraint(),llvm::X86TargetLowering::LowerAsmOperandForConstraint(),llvm::XtensaTargetLowering::LowerAsmOperandForConstraint(), andlowerImmediateIfPossible().
| virtual |
Reimplemented inllvm::X86TargetLowering.
Definition at line5579 of fileTargetLowering.cpp.
| inlinevirtual |
This hook must be implemented to lower calls into the specified DAG.
The outgoing arguments to the call are described by the Outs array, and the values to be returned by the call are described by the Ins array. The implementation should fill in the InVals array with legal-type return values from the call, and return the resulting token chain value.
Reimplemented inllvm::AMDGPUTargetLowering,llvm::SITargetLowering,llvm::NVPTXTargetLowering,llvm::SystemZTargetLowering,llvm::XtensaTargetLowering,llvm::HexagonTargetLowering,llvm::LoongArchTargetLowering,llvm::RISCVTargetLowering,llvm::SparcTargetLowering, andllvm::VETargetLowering.
Definition at line4770 of fileTargetLowering.h.
Referencesllvm_unreachable.
Referenced byLowerCallTo().
std::pair<SDValue,SDValue > TargetLowering::LowerCallTo | ( | TargetLowering::CallLoweringInfo & | CLI | ) | const |
This function lowers an abstract call to a function into an actual call.
TargetLowering::LowerCallTo - This is the default LowerCallTo implementation, which just calls LowerCall.
This returns a pair of operands. The first element is the return value for the function (if RetTy is not VoidTy). The second element is the outgoing token chain. It calls LowerCall to do the actual lowering.
FIXME: When all targets are migrated to using LowerCall, this hook should be integrated into SDISel.
Definition at line10958 of fileSelectionDAGBuilder.cpp.
Referencesllvm::Add,llvm::ISD::ADD,llvm::ISD::ANY_EXTEND,llvm::SmallVectorImpl< T >::append(),llvm::ISD::InputArg::ArgVT,assert(),llvm::ISD::AssertSext,llvm::ISD::AssertZext,llvm::TargetLowering::CallLoweringInfo::CallConv,CanLowerReturn(),llvm::TargetLowering::CallLoweringInfo::CB,llvm::TargetLowering::CallLoweringInfo::Chain,llvm::ComputeValueVTs(),llvm::MachineFrameInfo::CreateStackObject(),llvm::TargetLowering::CallLoweringInfo::DAG,llvm::TargetLowering::CallLoweringInfo::DL,DL,llvm::SmallVectorBase< Size_T >::empty(),llvm::ISD::InputArg::Flags,llvm::ISD::OutputArg::Flags,functionArgumentNeedsConsecutiveRegisters(),llvm::PointerType::get(),llvm::TargetLoweringBase::getABIAlignmentForCallingConv(),getAddressSpace(),llvm::TargetLowering::CallLoweringInfo::getArgs(),llvm::TargetLoweringBase::getByValTypeAlignment(),llvm::SelectionDAG::getConstant(),llvm::Type::getContext(),getCopyFromParts(),getCopyToParts(),llvm::SelectionDAG::getDataLayout(),llvm::TypeSize::getFixed(),llvm::MachinePointerInfo::getFixedStack(),llvm::SelectionDAG::getFrameIndex(),llvm::TargetLoweringBase::getFrameIndexTy(),llvm::MachineFunction::getFrameInfo(),llvm::SelectionDAG::getLoad(),llvm::SelectionDAG::getMachineFunction(),llvm::SDValue::getNode(),getNode(),llvm::SelectionDAG::getNode(),llvm::TargetLoweringBase::getNumRegisters(),llvm::TargetLoweringBase::getNumRegistersForCallingConv(),llvm::MachineFrameInfo::getObjectAlign(),llvm::Type::getPointerAddressSpace(),llvm::TargetLoweringBase::getPointerTy(),llvm::TargetLoweringBase::getRegisterType(),llvm::TargetLoweringBase::getRegisterTypeForCallingConv(),getReturnAttrs(),llvm::GetReturnInfo(),getSimpleVT(),llvm::EVT::getSizeInBits(),llvm::MVT::getSizeInBits(),llvm::EVT::getTypeForEVT(),llvm::SDValue::getValueType(),llvm::TargetLoweringBase::getValueType(),llvm::Type::getVoidTy(),llvm::SelectionDAG::getVTList(),I,llvm::TargetLowering::CallLoweringInfo::Ins,llvm::TargetLowering::CallLoweringInfo::InVals,llvm::TargetLowering::CallLoweringInfo::IsInReg,llvm::Type::isPointerTy(),llvm::TargetLowering::CallLoweringInfo::IsPostTypeLegalization,llvm::TargetLowering::CallLoweringInfo::IsReturnValueUsed,llvm::TargetLoweringBase::ArgListEntry::IsSwiftError,llvm::TargetLowering::CallLoweringInfo::IsTailCall,llvm::TargetLowering::CallLoweringInfo::IsVarArg,LowerCall(),llvm::ISD::MERGE_VALUES,llvm::SDNodeFlags::NoUnsignedWrap,llvm::TargetLowering::CallLoweringInfo::NumFixedArgs,llvm::Offset,llvm::TargetLowering::CallLoweringInfo::Outs,llvm::TargetLowering::CallLoweringInfo::OutVals,llvm::SmallVectorTemplateBase< T, bool >::push_back(),llvm::SmallVectorImpl< T >::resize(),llvm::TargetLowering::CallLoweringInfo::RetSExt,llvm::TargetLowering::CallLoweringInfo::RetTy,llvm::TargetLowering::CallLoweringInfo::RetZExt,llvm::ISD::ArgFlagsTy::setInReg(),llvm::ISD::ArgFlagsTy::setOrigAlign(),llvm::ISD::ArgFlagsTy::setPointer(),llvm::ISD::ArgFlagsTy::setPointerAddrSpace(),llvm::SelectionDAG::setRoot(),llvm::ISD::ArgFlagsTy::setSExt(),llvm::ISD::ArgFlagsTy::setSplit(),llvm::ISD::ArgFlagsTy::setSplitEnd(),llvm::ISD::ArgFlagsTy::setSwiftError(),llvm::ISD::ArgFlagsTy::setZExt(),llvm::ISD::SIGN_EXTEND,llvm::SmallVectorBase< Size_T >::size(),supportSwiftError(),llvm::SmallVectorImpl< T >::swap(),llvm::ISD::TokenFactor,llvm::ISD::InputArg::Used,llvm::ISD::InputArg::VT,llvm::CallingConv::X86_VectorCall, andllvm::ISD::ZERO_EXTEND.
Referenced byemitSMEStateSaveRestore(),llvm::HexagonSelectionDAGInfo::EmitTargetCodeForMemcpy(),llvm::XCoreSelectionDAGInfo::EmitTargetCodeForMemcpy(),llvm::SelectionDAG::expandMultipleResultFPLibCall(),llvm::SelectionDAG::getAtomicMemcpy(),llvm::SelectionDAG::getAtomicMemmove(),llvm::SelectionDAG::getAtomicMemset(),llvm::SelectionDAG::getMemcpy(),llvm::SelectionDAG::getMemmove(),llvm::SelectionDAG::getMemset(),llvm::VETargetLowering::lowerDYNAMIC_STACKALLOC(),llvm::SparcTargetLowering::LowerF128Compare(),llvm::SparcTargetLowering::LowerF128Op(),LowerFSINCOS(),llvm::SelectionDAGBuilder::lowerInvokable(),llvm::SystemZTargetLowering::makeExternalCall(),llvm::SelectionDAG::makeStateFunctionCall(), andllvm::SelectionDAGBuilder::visitSPDescriptorParent().
SDValue TargetLowering::lowerCmpEqZeroToCtlzSrl | ( | SDValue | Op, |
SelectionDAG & | DAG | ||
) | const |
Definition at line10566 of fileTargetLowering.cpp.
Referencesassert(),llvm::EVT::bitsLT(),CC,llvm::ISD::CTLZ,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getNode(),llvm::EVT::getSizeInBits(),llvm::TargetLoweringBase::isCtlzFast(),llvm::isNullConstant(),llvm::Log2_32(),llvm::ISD::SETCC,llvm::ISD::SETEQ,llvm::ISD::SRL,llvm::ISD::TRUNCATE, andllvm::ISD::ZERO_EXTEND.
| inlinevirtual |
Reimplemented inllvm::M68kTargetLowering,llvm::RISCVTargetLowering,llvm::VETargetLowering, andllvm::X86TargetLowering.
Definition at line3862 of fileTargetLowering.h.
Referencesllvm_unreachable.
| inlinevirtual |
This hook must be implemented to lower the incoming (formal) arguments, described by the Ins array, into the specified DAG.
The implementation should fill in the InVals array with legal-type argument values, and return the resulting token chain value.
Reimplemented inllvm::R600TargetLowering,llvm::SITargetLowering,llvm::HexagonTargetLowering,llvm::LoongArchTargetLowering,llvm::NVPTXTargetLowering,llvm::RISCVTargetLowering,llvm::SparcTargetLowering,llvm::SystemZTargetLowering,llvm::VETargetLowering, andllvm::XtensaTargetLowering.
Definition at line4510 of fileTargetLowering.h.
Referencesllvm_unreachable.
| virtual |
This callback is invoked for operations that are unsupported by the target, which are registered to use 'custom' lowering, and whose defined values are all legal.
If the target has no operations that require custom lowering, it need not implement this. The default implementation of this aborts.
Reimplemented inllvm::AArch64TargetLowering,llvm::AMDGPUTargetLowering,llvm::R600TargetLowering,llvm::SITargetLowering,llvm::ARCTargetLowering,llvm::ARMTargetLowering,llvm::AVRTargetLowering,llvm::BPFTargetLowering,llvm::CSKYTargetLowering,llvm::HexagonTargetLowering,llvm::LanaiTargetLowering,llvm::LoongArchTargetLowering,llvm::M68kTargetLowering,llvm::MipsTargetLowering,llvm::MipsSETargetLowering,llvm::MSP430TargetLowering,llvm::NVPTXTargetLowering,llvm::PPCTargetLowering,llvm::RISCVTargetLowering,llvm::SparcTargetLowering,llvm::SystemZTargetLowering,llvm::VETargetLowering,llvm::X86TargetLowering,llvm::XCoreTargetLowering, andllvm::XtensaTargetLowering.
Definition at line11372 of fileSelectionDAGBuilder.cpp.
Referencesllvm_unreachable.
Referenced byLowerOperationWrapper().
| virtual |
This callback is invoked by the type legalizer to legalize nodes with an illegal operand type but legal result types.
Places new result values for the node in Results (their number and types must exactly match those of the original return values of the node), or leaves Results empty, which indicates that the node is not to be custom lowered after all.
It replaces the LowerOperation callback in the typeLegalizer. The reason we can not do away with LowerOperation entirely is that LegalizeDAG isn't yet ready to use this callback.
TODO: Consider merging with ReplaceNodeResults.
The target places new result values for the node in Results (their number and types must exactly match those of the original return values of the node), or leaves Results empty, which indicates that the node is not to be custom lowered after all. The default implementation calls LowerOperation.
Reimplemented inllvm::HexagonTargetLowering, andllvm::SystemZTargetLowering.
Definition at line11347 of fileSelectionDAGBuilder.cpp.
Referencesassert(),llvm::SDValue::getNode(),llvm::SDNode::getNumValues(),llvm::SDValue::getValue(),I,LowerOperation(),N, andResults.
Referenced byllvm::HexagonTargetLowering::LowerOperationWrapper(), andllvm::MipsTargetLowering::ReplaceNodeResults().
| inlinevirtual |
This hook must be implemented to lower outgoing return values, described by the Outs array, into the specified DAG.
The implementation should return the resulting token chain value.
Reimplemented inllvm::AMDGPUTargetLowering,llvm::SITargetLowering,llvm::HexagonTargetLowering,llvm::LoongArchTargetLowering,llvm::NVPTXTargetLowering,llvm::RISCVTargetLowering,llvm::SparcTargetLowering,llvm::SystemZTargetLowering,llvm::VETargetLowering, andllvm::XtensaTargetLowering.
Definition at line4793 of fileTargetLowering.h.
Referencesllvm_unreachable.
| virtual |
Lower TLS global addressSDNode for target independent emulated TLS model.
Definition at line10526 of fileTargetLowering.cpp.
Referencesassert(),llvm::CallingConv::C,llvm::PointerType::get(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getEntryNode(),llvm::SelectionDAG::getExternalSymbol(),llvm::MachineFunction::getFrameInfo(),llvm::GlobalAddressSDNode::getGlobal(),llvm::SelectionDAG::getGlobalAddress(),llvm::SelectionDAG::getMachineFunction(),llvm::Value::getName(),llvm::Module::getNamedGlobal(),llvm::GlobalAddressSDNode::getOffset(),llvm::GlobalValue::getParent(),llvm::TargetLoweringBase::getPointerTy(),llvm::MachineFrameInfo::setAdjustsStack(),llvm::TargetLowering::CallLoweringInfo::setChain(),llvm::TargetLowering::CallLoweringInfo::setDebugLoc(),llvm::MachineFrameInfo::setHasCalls(),llvm::TargetLowering::CallLoweringInfo::setLibCallee(), andllvm::Value::stripPointerCastsAndAliases().
Referenced byllvm::SparcTargetLowering::LowerGlobalTLSAddress().
Try to replace an X constraint, which matches anything, with another that has more specific requirements based on the type of the corresponding operand.
This returns null if there is no replacement to make.
Reimplemented inllvm::ARMTargetLowering, andllvm::X86TargetLowering.
Definition at line5571 of fileTargetLowering.cpp.
Referencesllvm::EVT::isFloatingPoint(), andllvm::EVT::isInteger().
Referenced bycomputeConstraintToUse(), andllvm::X86TargetLowering::LowerXConstraint().
std::pair<SDValue,SDValue > TargetLowering::makeLibCall | ( | SelectionDAG & | DAG, |
RTLIB::Libcall | LC, | ||
EVT | RetVT, | ||
ArrayRef<SDValue > | Ops, | ||
MakeLibCallOptions | CallOptions, | ||
constSDLoc & | dl, | ||
SDValue | Chain =SDValue() | ||
) | const |
Returns a pair of (return value, chain).
Generate a libcall taking the given operands as arguments and returning a result of type RetVT.
It is an error to pass RTLIB::UNKNOWN_LIBCALL asLC
.
Definition at line147 of fileTargetLowering.cpp.
Referencesllvm::TargetLowering::MakeLibCallOptions::DoesNotReturn,llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getEntryNode(),llvm::SelectionDAG::getExternalSymbol(),llvm::TargetLoweringBase::getLibcallCallingConv(),llvm::TargetLoweringBase::getLibcallName(),llvm::TargetLoweringBase::getPointerTy(),llvm::EVT::getTypeForEVT(),llvm::TargetLowering::MakeLibCallOptions::IsPostTypeLegalization,llvm::TargetLowering::MakeLibCallOptions::IsReturnValueUsed,llvm::TargetLowering::MakeLibCallOptions::IsSigned,llvm::TargetLowering::MakeLibCallOptions::IsSoften,llvm::TargetLowering::MakeLibCallOptions::OpsVTBeforeSoften,llvm::report_fatal_error(),RetTy,llvm::TargetLowering::MakeLibCallOptions::RetVTBeforeSoften,llvm::TargetLowering::CallLoweringInfo::setChain(),llvm::TargetLowering::CallLoweringInfo::setDebugLoc(),llvm::TargetLowering::CallLoweringInfo::setDiscardResult(),llvm::TargetLowering::CallLoweringInfo::setIsPostTypeLegalization(),llvm::TargetLowering::CallLoweringInfo::setLibCallee(),llvm::TargetLowering::CallLoweringInfo::setNoReturn(),llvm::TargetLowering::CallLoweringInfo::setSExtResult(),llvm::TargetLowering::CallLoweringInfo::setZExtResult(),llvm::TargetLoweringBase::shouldExtendTypeInLibCall(),llvm::TargetLoweringBase::shouldSignExtendTypeInLibCall(), andllvm::ArrayRef< T >::size().
Referenced byllvm::RISCVTargetLowering::LowerOperation(),llvm::LoongArchTargetLowering::ReplaceNodeResults(),llvm::RISCVTargetLowering::ReplaceNodeResults(), andllvm::SelectionDAGBuilder::visitSPDescriptorFailure().
Return true if the target may be able emit the call instruction as a tail call.
This is used by optimization passes to determine if it's profitable to duplicate return instructions to enable tailcall optimization.
Reimplemented inllvm::SITargetLowering,llvm::HexagonTargetLowering,llvm::LoongArchTargetLowering,llvm::RISCVTargetLowering, andllvm::SystemZTargetLowering.
Definition at line4814 of fileTargetLowering.h.
| delete |
bool TargetLowering::parametersInCSRMatch | ( | constMachineRegisterInfo & | MRI, |
constuint32_t * | CallerPreservedMask, | ||
constSmallVectorImpl<CCValAssign > & | ArgLocs, | ||
constSmallVectorImpl<SDValue > & | OutVals | ||
) | const |
Check whether parameters to a call that are passed in callee saved registers are the same as from the calling function.
This needs to be checked for tail call eligibility.
Definition at line83 of fileTargetLowering.cpp.
Referencesllvm::ISD::AssertZext,llvm::MachineOperand::clobbersPhysReg(),llvm::ISD::CopyFromReg,llvm::CCValAssign::getLocReg(),I,llvm::CCValAssign::isRegLoc(),MRI, andllvm::SmallVectorBase< Size_T >::size().
Referenced byllvm::SITargetLowering::isEligibleForTailCallOptimization().
| virtual |
Split up the constraint string from the inline assembly value into the specific constraints and their prefixes, and also tie in the associated operand values.
If this returns an empty vector, and if the constraint string itself isn't empty, there was an error parsing.
Information about all of the constraints.
Definition at line5731 of fileTargetLowering.cpp.
Referencesassert(),llvm::TargetLowering::AsmOperandInfo::CallOperandVal,llvm::TargetLowering::AsmOperandInfo::ConstraintCode,llvm::TargetLowering::AsmOperandInfo::ConstraintVT,DL,llvm::IntegerType::get(),llvm::TargetLoweringBase::getAsmOperandValueType(),llvm::Type::getContext(),llvm::EVT::getSimpleVT(),llvm::MVT::getSizeInBits(),llvm::Value::getType(),llvm::InlineAsm::ConstraintInfo::hasMatchingInput(),llvm::InlineAsm::isClobber,llvm::MVT::isFloatingPoint(),llvm::InlineAsm::ConstraintInfo::isIndirect,llvm::InlineAsm::isInput,llvm::MVT::isInteger(),llvm::InlineAsm::isLabel,llvm::InlineAsm::isOutput,llvm::EVT::isSimple(),llvm::Type::isSingleValueType(),llvm::Type::isSized(),llvm::InlineAsm::ConstraintInfo::MatchingInput,llvm::InlineAsm::ConstraintInfo::multipleAlternatives,llvm::report_fatal_error(),TRI, andllvm::InlineAsm::ConstraintInfo::Type.
Referenced byllvm::GCNTTIImpl::isInlineAsmSourceOfDivergence(),IsOperandAMemoryOperand(),llvm::InlineAsmLowering::lowerInlineAsm(),llvm::SITargetLowering::requiresUniformRegister(), andllvm::FunctionLoweringInfo::set().
| virtual |
This method will be invoked for all target nodes and for any target-independent nodes that the target has registered with invoke it for.
The semantics are as follows: ReturnValue: SDValue.Val == 0 - No change was made SDValue.Val == N - N was replaced, is dead, and is already handled. otherwise - N should be replaced by the returned Operand.
In addition, methods provided byDAGCombinerInfo may be used to perform more complex transformations.
Reimplemented inllvm::AArch64TargetLowering,llvm::AMDGPUTargetLowering,llvm::R600TargetLowering,llvm::SITargetLowering,llvm::ARMTargetLowering,llvm::HexagonTargetLowering,llvm::LanaiTargetLowering,llvm::LoongArchTargetLowering,llvm::MipsTargetLowering,llvm::MipsSETargetLowering,llvm::PPCTargetLowering,llvm::RISCVTargetLowering,llvm::SparcTargetLowering,llvm::SystemZTargetLowering,llvm::VETargetLowering, andllvm::X86TargetLowering.
Definition at line5514 of fileTargetLowering.cpp.
| inlinevirtual |
This callback is used to prepare for a volatile or atomic load.
It takes a chain node as input and returns the chain for the load itself.
Having a callback like this is necessary for targets likeSystemZ, which allows a CPU to reuse the result of a previous load indefinitely, even if a cache-coherent store is performed by another CPU. The default implementation does nothing.
Definition at line4876 of fileTargetLowering.h.
| inlinevirtual |
This callback is invoked when a node result type is illegal for the target, and the operation was registered to use 'custom' lowering for that result type.
The target places new result values for the node in Results (their number and types must exactly match those of the original return values of the node), or leaves Results empty, which indicates that the node is not to be custom lowered after all.
If the target has no operations that require custom lowering, it need not implement this. The default implementation aborts.
Reimplemented inllvm::AMDGPUTargetLowering,llvm::R600TargetLowering,llvm::SITargetLowering,llvm::ARMTargetLowering,llvm::AVRTargetLowering,llvm::HexagonTargetLowering,llvm::LoongArchTargetLowering,llvm::MipsTargetLowering,llvm::PPCTargetLowering,llvm::RISCVTargetLowering,llvm::SparcTargetLowering,llvm::SystemZTargetLowering,llvm::VETargetLowering,llvm::X86TargetLowering, andllvm::XCoreTargetLowering.
Definition at line4914 of fileTargetLowering.h.
Referencesllvm_unreachable.
std::pair<SDValue,SDValue > TargetLowering::scalarizeVectorLoad | ( | LoadSDNode * | LD, |
SelectionDAG & | DAG | ||
) | const |
Turn load of vector type into a load of the individual elements.
LD | load to expand |
Definition at line9961 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,assert(),llvm::ISD::EXTLOAD,llvm::SelectionDAG::getBuildVector(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::ISD::getExtForLoadExtType(),llvm::SelectionDAG::getExtLoad(),llvm::TypeSize::getFixed(),llvm::EVT::getIntegerVT(),llvm::APInt::getLowBitsSet(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getObjectPtrOffset(),llvm::EVT::getScalarType(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::EVT::getSizeInBits(),llvm::EVT::getStoreSizeInBits(),llvm::SDValue::getValue(),llvm::EVT::getVectorNumElements(),Idx,llvm::DataLayout::isBigEndian(),llvm::EVT::isByteSized(),llvm::EVT::isScalableVector(),llvm::ISD::NON_EXTLOAD,llvm::SmallVectorTemplateBase< T, bool >::push_back(),llvm::report_fatal_error(),llvm::ISD::SRL,llvm::ISD::TokenFactor, andllvm::ISD::TRUNCATE.
Referenced byllvm::AMDGPUTargetLowering::SplitVectorLoad().
SDValue TargetLowering::scalarizeVectorStore | ( | StoreSDNode * | ST, |
SelectionDAG & | DAG | ||
) | const |
ST | Store with a vector value type |
Definition at line10050 of fileTargetLowering.cpp.
Referencesassert(),llvm::ISD::EXTRACT_VECTOR_ELT,llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::TypeSize::getFixed(),llvm::EVT::getIntegerVT(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getObjectPtrOffset(),llvm::EVT::getScalarType(),llvm::EVT::getSizeInBits(),llvm::SelectionDAG::getStore(),llvm::SelectionDAG::getTruncStore(),llvm::SelectionDAG::getVectorIdxConstant(),llvm::EVT::getVectorNumElements(),Idx,llvm::DataLayout::isBigEndian(),llvm::EVT::isByteSized(),llvm::EVT::isScalableVector(),llvm::ISD::OR,Ptr,llvm::SmallVectorTemplateBase< T, bool >::push_back(),llvm::report_fatal_error(),llvm::ISD::SHL,llvm::ISD::TokenFactor,llvm::ISD::TRUNCATE, andllvm::ISD::ZERO_EXTEND.
Referenced byllvm::AMDGPUTargetLowering::SplitVectorStore().
| inlinevirtual |
Return true if the target supports simplifying demanded vector elements by converting them to undefs.
Definition at line4091 of fileTargetLowering.h.
| inlinevirtual |
For most targets, an LLVM type must be broken down into multiple smaller types.
Usually the halves are ordered according to the endianness but for some platform that would break. So this method will default to matching the endianness but can be overridden.
Reimplemented inllvm::AVRTargetLowering.
Definition at line4853 of fileTargetLowering.h.
ReferencesDL.
bool TargetLowering::ShrinkDemandedConstant | ( | SDValue | Op, |
constAPInt & | DemandedBits, | ||
constAPInt & | DemandedElts, | ||
TargetLoweringOpt & | TLO | ||
) | const |
Check to see if the specified operand of the specified instruction is a constant integer.
If the specified instruction has a constant integer operand and there are bits set in that constant that are not demanded, then clear those bits and return true.
If so, check to see if there are any bits set in the constant that are not demanded. If so, shrink the constant and return true.
Definition at line514 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,llvm::CallingConv::C,llvm::TargetLowering::TargetLoweringOpt::CombineTo(),llvm::TargetLowering::TargetLoweringOpt::DAG,DL,llvm::SelectionDAG::getConstant(),llvm::SDValue::getNode(),llvm::SelectionDAG::getNode(),llvm::APInt::isZero(),llvm::TargetLowering::TargetLoweringOpt::New,llvm::ISD::OR, andllvm::ISD::XOR.
Referenced byllvm::AMDGPUTargetLowering::PerformDAGCombine(), andllvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode().
bool TargetLowering::ShrinkDemandedConstant | ( | SDValue | Op, |
constAPInt & | DemandedBits, | ||
TargetLoweringOpt & | TLO | ||
) | const |
Helper wrapper around ShrinkDemandedConstant, demanding all elements.
Definition at line561 of fileTargetLowering.cpp.
Referencesllvm::APInt::getAllOnes(),llvm::EVT::getVectorNumElements(),llvm::EVT::isVector(), andShrinkDemandedConstant().
bool TargetLowering::ShrinkDemandedOp | ( | SDValue | Op, |
unsigned | BitWidth, | ||
constAPInt & | DemandedBits, | ||
TargetLoweringOpt & | TLO | ||
) | const |
Convert x+y to (VT)((SmallVT)x+(SmallVT)y) if the casts are free.
This uses isTruncateFree/isZExtFree and ANY_EXTEND for the widening cast, but it could be generalized for targets with other types of implicit widening casts.
Definition at line575 of fileTargetLowering.cpp.
Referencesllvm::ISD::ANY_EXTEND,assert(),llvm::bit_ceil(),llvm::BitWidth,llvm::TargetLowering::TargetLoweringOpt::CombineTo(),llvm::TargetLowering::TargetLoweringOpt::DAG,llvm::SDNodeFlags::Disjoint,llvm::SelectionDAG::getContext(),llvm::EVT::getIntegerVT(),llvm::SelectionDAG::getNode(),llvm::DWARFExpression::Operation::getNumOperands(),llvm::TargetLoweringBase::isTruncateFree(),llvm::EVT::isVector(),llvm::TargetLoweringBase::isZExtFree(),llvm::NextPowerOf2(),llvm::SDNodeFlags::None,llvm::ISD::TRUNCATE, andX.
bool TargetLowering::SimplifyDemandedBits | ( | SDValue | Op, |
constAPInt & | DemandedBits, | ||
constAPInt & | DemandedElts, | ||
DAGCombinerInfo & | DCI | ||
) | const |
Helper wrapper around SimplifyDemandedBits.
Adds Op back to the worklist upon success.
Definition at line640 of fileTargetLowering.cpp.
Referencesllvm::TargetLowering::DAGCombinerInfo::AddToWorklist(),llvm::TargetLowering::DAGCombinerInfo::CommitTargetLoweringOpt(),llvm::TargetLowering::DAGCombinerInfo::DAG,llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalize(), andllvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps().
bool TargetLowering::SimplifyDemandedBits | ( | SDValue | Op, |
constAPInt & | OriginalDemandedBits, | ||
constAPInt & | OriginalDemandedElts, | ||
KnownBits & | Known, | ||
TargetLoweringOpt & | TLO, | ||
unsigned | Depth =0 , | ||
bool | AssumeSingleUse =false | ||
) | const |
Look at Op.
At this point, we know that only theDemandedBits bits of the result of Op are ever used downstream. If we can use this information to simplify Op, create a new simplified DAG node and return true, returning the original and new nodes in Old and New. Otherwise, analyze the expression and return a mask of KnownOne and KnownZero bits for the expression (used to simplify the caller). The KnownZero/One bits may only be accurate for those bits in the Demanded masks.AssumeSingleUse
When this parameter is true, this function will attempt to simplifyOp
even if there are multiple uses. Callers are responsible for correctly updating the DAG based on the results of this function, because simply replacing TLO.Old with TLO.New will be incorrect when this parameter is true and TLO.Old has multiple uses.
At this point, we know that only the OriginalDemandedBits of the result of Op are ever used downstream. If we can use this information to simplify Op, create a new simplified DAG node and return true, returning the original and new nodes in Old and New. Otherwise, analyze the expression and return a mask of Known bits for the expression (used to simplify the caller). The Known bits may only be accurate for those bits in the OriginalDemandedBits and OriginalDemandedElts.
Definition at line1134 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::alignDown(),llvm::ISD::AND,llvm::ISD::ANY_EXTEND,llvm::ISD::ANY_EXTEND_VECTOR_INREG,llvm::any_of(),llvm::KnownBits::anyext(),llvm::KnownBits::anyextOrTrunc(),assert(),llvm::ISD::AssertZext,llvm::bit_ceil(),llvm::ISD::BITCAST,llvm::ISD::BITREVERSE,llvm::BitWidth,llvm::ISD::BSWAP,llvm::ISD::BUILD_PAIR,llvm::ISD::BUILD_VECTOR,llvm::ISD::BUILTIN_OP_END,llvm::APInt::byteSwap(),llvm::CallingConv::C,CC,llvm::APInt::clearBit(),llvm::APInt::clearHighBits(),combineShiftToAVG(),llvm::TargetLowering::TargetLoweringOpt::CombineTo(),llvm::KnownBits::computeForAddSub(),llvm::SelectionDAG::computeKnownBits(),llvm::SelectionDAG::ComputeMaxSignificantBits(),llvm::SelectionDAG::ComputeNumSignBits(),llvm::KnownBits::concat(),llvm::ISD::CONCAT_VECTORS,llvm::ISD::Constant,llvm::ISD::ConstantFP,llvm::APInt::countLeadingZeros(),llvm::KnownBits::countMinLeadingZeros(),llvm::KnownBits::countMinSignBits(),llvm::ISD::CTPOP,llvm::TargetLowering::TargetLoweringOpt::DAG,llvm::Depth,llvm::SDNodeFlags::Disjoint,llvm::ISD::EXTRACT_SUBVECTOR,llvm::ISD::EXTRACT_VECTOR_ELT,llvm::APInt::extractBits(),llvm::ISD::FGETSIGN,llvm::SelectionDAG::FoldConstantArithmetic(),llvm::ISD::FSHL,llvm::ISD::FSHR,llvm::APInt::getAllOnes(),llvm::SelectionDAG::getAllOnesConstant(),llvm::ConstantSDNode::getAPIntValue(),llvm::SelectionDAG::getBitcast(),llvm::APInt::getBitsSet(),llvm::APInt::getBitWidth(),llvm::KnownBits::getBitWidth(),llvm::TargetLoweringBase::getBooleanContents(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getConstantFP(),llvm::SDValue::getConstantOperandVal(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(),llvm::EVT::getFltSemantics(),llvm::APInt::getHighBitsSet(),llvm::EVT::getIntegerVT(),llvm::APInt::getLowBitsSet(),llvm::SDValue::getNode(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getNOT(),llvm::DWARFExpression::Operation::getNumOperands(),llvm::APInt::getOneBitSet(),llvm::SDValue::getOpcode(),llvm::SDValue::getOperand(),llvm::TargetLoweringBase::getOperationAction(),llvm::EVT::getScalarSizeInBits(),llvm::SDValue::getScalarValueSizeInBits(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::getShuffleDemandedElts(),llvm::APInt::getSignMask(),llvm::EVT::getSizeInBits(),llvm::SelectionDAG::getUNDEF(),llvm::SelectionDAG::getValidMaximumShiftAmount(),llvm::SelectionDAG::getValidShiftAmount(),llvm::SDValue::getValueSizeInBits(),llvm::SDValue::getValueType(),llvm::SelectionDAG::getValueType(),llvm::EVT::getVectorElementCount(),llvm::EVT::getVectorNumElements(),llvm::SelectionDAG::getVectorShuffle(),llvm::EVT::getVectorVT(),llvm::APInt::getZero(),llvm::SelectionDAG::getZeroExtendInReg(),llvm::SDValue::hasOneUse(),llvm::SDNode::hasOneUse(),I,Idx,llvm::ISD::INSERT_SUBVECTOR,llvm::ISD::INSERT_VECTOR_ELT,llvm::APInt::insertBits(),llvm::KnownBits::intersectWith(),llvm::ISD::INTRINSIC_WO_CHAIN,llvm::APInt::isAllOnes(),llvm::isBitwiseNot(),llvm::ISD::isBuildVectorAllZeros(),llvm::ISD::isBuildVectorOfConstantSDNodes(),llvm::isConstOrConstSplat(),llvm::EVT::isFixedLengthVector(),llvm::EVT::isFloatingPoint(),llvm::EVT::isInteger(),llvm::DataLayout::isLittleEndian(),llvm::TargetLoweringBase::isNarrowingProfitable(),llvm::APInt::isNegatedPowerOf2(),llvm::KnownBits::isNonNegative(),llvm::isNullConstant(),llvm::ConstantSDNode::isOpaque(),llvm::TargetLoweringBase::isOperationLegal(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::APInt::isPowerOf2(),llvm::isPowerOf2_32(),llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(),llvm::EVT::isScalableVector(),llvm::EVT::isSimple(),llvm::TargetLoweringBase::isTruncateFree(),llvm::SDValue::isUndef(),llvm::KnownBits::isUnknown(),llvm::EVT::isVector(),llvm::APInt::isZero(),llvm::ConstantSDNode::isZero(),llvm::TargetLoweringBase::isZExtFree(),llvm::ISD::isZEXTLoad(),llvm::TargetLoweringBase::Legal,llvm::TargetLowering::TargetLoweringOpt::LegalOperations(),llvm::TargetLowering::TargetLoweringOpt::LegalOps,llvm::TargetLowering::TargetLoweringOpt::LegalTypes(),llvm::ISD::LOAD,llvm::Log2(),llvm::APInt::logBase2(),llvm::APInt::lshr(),llvm::APInt::lshrInPlace(),llvm::KnownBits::makeConstant(),llvm::SelectionDAG::MaskedValueIsZero(),llvm::SelectionDAG::MaxRecursionDepth,llvm::Mul,llvm::ISD::MUL,llvm::KnownBits::mul(),llvm::NextPowerOf2(),llvm::SDNodeFlags::NonNeg,llvm::SDNodeFlags::NoWrap,llvm::Offset,llvm::KnownBits::One,llvm::ISD::OR,llvm::ISD::PARITY,llvm::KnownBits::resetAll(),llvm::APInt::reverseBits(),llvm::ISD::ROTL,llvm::ISD::ROTR,llvm::ISD::SCALAR_TO_VECTOR,llvm::ISD::SELECT,llvm::ISD::SELECT_CC,llvm::APInt::setAllBits(),llvm::APInt::setBit(),llvm::APInt::setBitsFrom(),llvm::ISD::SETCC,llvm::APInt::setHighBits(),llvm::APInt::setLowBits(),llvm::ISD::SETLT,llvm::APInt::setSignBit(),llvm::KnownBits::sext(),llvm::KnownBits::sge(),llvm::KnownBits::sgt(),llvm::APInt::shl(),llvm::ISD::SHL,ShrinkDemandedConstant(),llvm::ISD::SIGN_EXTEND,llvm::ISD::SIGN_EXTEND_INREG,llvm::ISD::SIGN_EXTEND_VECTOR_INREG,llvm::KnownBits::sle(),llvm::KnownBits::slt(),llvm::ISD::SMAX,llvm::KnownBits::smax(),llvm::ISD::SMIN,llvm::KnownBits::smin(),llvm::ISD::SPLAT_VECTOR,llvm::ISD::SRA,llvm::ISD::SRL,llvm::ISD::SUB,llvm::ISD::TargetConstant,llvm::KnownBits::trunc(),llvm::APInt::trunc(),llvm::ISD::TRUNCATE,llvm::KnownBits::uge(),llvm::KnownBits::ugt(),llvm::KnownBits::ule(),llvm::KnownBits::ult(),llvm::ISD::UMAX,llvm::KnownBits::umax(),llvm::ISD::UMIN,llvm::KnownBits::umin(),llvm::KnownBits::unionWith(),llvm::ISD::VECTOR_SHUFFLE,llvm::ISD::VSELECT,X,llvm::Xor,llvm::ISD::XOR,Y,llvm::KnownBits::Zero,llvm::ISD::ZERO_EXTEND,llvm::ISD::ZERO_EXTEND_VECTOR_INREG,llvm::TargetLoweringBase::ZeroOrNegativeOneBooleanContent,llvm::TargetLoweringBase::ZeroOrOneBooleanContent,llvm::KnownBits::zext(), andllvm::APInt::zext().
Referenced bycombineAnd(),combineAndnp(),combineBEXTR(),combineBT(),combineExtractVectorElt(),combineGatherScatter(),combineMaskedLoad(),combineMaskedStore(),combineMOVMSK(),combinePDEP(),combinePMULDQ(),combineTESTP(),combineVectorInsert(),combineVectorShiftImm(),combineVSelectToBLENDV(),combineVTRUNC(),combineX86GatherScatter(),llvm::AArch64TargetLowering::PerformDAGCombine(),llvm::AMDGPUTargetLowering::PerformDAGCombine(),llvm::ARMTargetLowering::PerformDAGCombine(),llvm::RISCVTargetLowering::PerformDAGCombine(),llvm::ARMTargetLowering::PerformIntrinsicCombine(),PerformPREDICATE_CASTCombine(),performTBISimplification(),performVectorShiftCombine(),PerformVMOVhrCombine(),llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(), andsimplifyMul24().
bool TargetLowering::SimplifyDemandedBits | ( | SDValue | Op, |
constAPInt & | DemandedBits, | ||
DAGCombinerInfo & | DCI | ||
) | const |
Helper wrapper around SimplifyDemandedBits.
Adds Op back to the worklist upon success.
Definition at line625 of fileTargetLowering.cpp.
Referencesllvm::TargetLowering::DAGCombinerInfo::AddToWorklist(),llvm::TargetLowering::DAGCombinerInfo::CommitTargetLoweringOpt(),llvm::TargetLowering::DAGCombinerInfo::DAG,llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalize(), andllvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps().
bool TargetLowering::SimplifyDemandedBits | ( | SDValue | Op, |
constAPInt & | DemandedBits, | ||
KnownBits & | Known, | ||
TargetLoweringOpt & | TLO, | ||
unsigned | Depth =0 , | ||
bool | AssumeSingleUse =false | ||
) | const |
Helper wrapper around SimplifyDemandedBits, demanding all elements.
Adds Op back to the worklist upon success.
Definition at line657 of fileTargetLowering.cpp.
Referencesllvm::Depth,llvm::APInt::getAllOnes(),llvm::EVT::getVectorNumElements(), andllvm::EVT::isFixedLengthVector().
| virtual |
Attempt to simplify any target nodes based on the demanded bits/elts, returning true on success.
Otherwise, analyze the expression and return a mask of KnownOne and KnownZero bits for the expression (used to simplify the caller). The KnownZero/One bits may only be accurate for those bits in the Demanded masks.
Reimplemented inllvm::X86TargetLowering, andllvm::ARMTargetLowering.
Definition at line3840 of fileTargetLowering.cpp.
Referencesassert(),llvm::ISD::BUILTIN_OP_END,llvm::TargetLowering::TargetLoweringOpt::DAG,llvm::Depth,llvm::ISD::INTRINSIC_VOID,llvm::ISD::INTRINSIC_W_CHAIN, andllvm::ISD::INTRINSIC_WO_CHAIN.
Referenced byllvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(), andllvm::ARMTargetLowering::SimplifyDemandedBitsForTargetNode().
bool TargetLowering::SimplifyDemandedVectorElts | ( | SDValue | Op, |
constAPInt & | DemandedEltMask, | ||
APInt & | KnownUndef, | ||
APInt & | KnownZero, | ||
TargetLoweringOpt & | TLO, | ||
unsigned | Depth =0 , | ||
bool | AssumeSingleUse =false | ||
) | const |
Look at Vector Op.
At this point, we know that only the DemandedElts elements of the result of Op are ever used downstream. If we can use this information to simplify Op, create a new simplified DAG node and return true, storing the original and new nodes in TLO. Otherwise, analyze the expression and return a mask of KnownUndef and KnownZero elements for the expression (used to simplify the caller). The KnownUndef/Zero elements may only be accurate for those bits in the DemandedMask.AssumeSingleUse
When this parameter is true, this function will attempt to simplifyOp
even if there are multiple uses. Callers are responsible for correctly updating the DAG based on the results of this function, because simply replacing TLO.Old with TLO.New will be incorrect when this parameter is true and TLO.Old has multiple uses.
Definition at line3077 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::ISD::AND,llvm::ISD::ANY_EXTEND_VECTOR_INREG,llvm::any_of(),llvm::SmallVectorImpl< T >::append(),assert(),llvm::ISD::AVGCEILS,llvm::ISD::AVGCEILU,llvm::ISD::AVGFLOORS,llvm::ISD::AVGFLOORU,llvm::ISD::BITCAST,llvm::ISD::BUILD_VECTOR,llvm::ISD::BUILTIN_OP_END,llvm::APInt::clearAllBits(),llvm::APInt::clearBit(),llvm::TargetLowering::TargetLoweringOpt::CombineTo(),llvm::ISD::CONCAT_VECTORS,llvm::TargetLowering::TargetLoweringOpt::DAG,llvm::Depth,DL,llvm::ISD::EXTRACT_SUBVECTOR,llvm::ISD::EXTRACT_VECTOR_ELT,llvm::APInt::extractBits(),llvm::ISD::FADD,llvm::ISD::FDIV,llvm::ISD::FMUL,llvm::SelectionDAG::FoldConstantArithmetic(),llvm::ISD::FP_TO_SINT,llvm::ISD::FP_TO_UINT,llvm::ISD::FREEZE,llvm::ISD::FREM,llvm::ISD::FSUB,llvm::APInt::getAllOnes(),llvm::SelectionDAG::getAllOnesConstant(),llvm::SelectionDAG::getBitcast(),llvm::APInt::getBitWidth(),llvm::SelectionDAG::getBuildVector(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getDataLayout(),llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(),llvm::SelectionDAG::getFreeze(),getKnownUndefForVectorBinop(),llvm::SDValue::getNode(),llvm::SelectionDAG::getNode(),llvm::DWARFExpression::Operation::getNumOperands(),llvm::APInt::getOneBitSet(),llvm::SDValue::getOpcode(),llvm::SDValue::getOperand(),llvm::EVT::getScalarSizeInBits(),llvm::EVT::getScalarType(),llvm::SelectionDAG::getUNDEF(),llvm::SDValue::getValueType(),llvm::TargetLoweringBase::getValueType(),llvm::EVT::getVectorElementCount(),llvm::EVT::getVectorNumElements(),llvm::APInt::getZero(),Idx,llvm::ISD::INSERT_SUBVECTOR,llvm::ISD::INSERT_VECTOR_ELT,llvm::APInt::insertBits(),llvm::APInt::isAllOnes(),llvm::SelectionDAG::isGuaranteedNotToBeUndefOrPoison(),llvm::DataLayout::isLittleEndian(),llvm::isNullConstant(),llvm::isNullFPConstant(),llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(),llvm::EVT::isScalableVector(),llvm::APInt::isSubsetOf(),llvm::SDValue::isUndef(),isUndef(),llvm::EVT::isVector(),llvm::TargetLowering::TargetLoweringOpt::LegalOps,LHS,llvm::SelectionDAG::MaxRecursionDepth,llvm::ISD::MUL,llvm::ISD::MULHS,llvm::ISD::MULHU,llvm::ISD::OR,llvm::SmallVectorTemplateBase< T, bool >::push_back(),RHS,llvm::ISD::ROTL,llvm::ISD::ROTR,llvm::ISD::SCALAR_TO_VECTOR,llvm::APIntOps::ScaleBitMask(),llvm::APInt::setAllBits(),llvm::APInt::setBit(),llvm::APInt::setBits(),llvm::APInt::setBitVal(),llvm::APInt::setHighBits(),llvm::APInt::shl(),llvm::ISD::SHL,llvm::ISD::SIGN_EXTEND,llvm::ISD::SIGN_EXTEND_VECTOR_INREG,llvm::ISD::SINT_TO_FP,llvm::ISD::SRA,llvm::ISD::SRL,llvm::ISD::SUB,true,llvm::ISD::TRUNCATE,llvm::ISD::UINT_TO_FP,llvm::ISD::VECTOR_SHUFFLE,llvm::ISD::VSELECT,llvm::ISD::XOR,llvm::KnownBits::Zero,llvm::ISD::ZERO_EXTEND,llvm::ISD::ZERO_EXTEND_VECTOR_INREG,llvm::APInt::zext(), andllvm::APInt::zextOrTrunc().
Referenced bycombineAnd(),combineAndnp(),combineCVTPH2PS(),combineKSHIFT(),combineOr(),combineShuffle(),combineVectorShiftVar(),combineVEXTRACT_STORE(),combineVPMADD(),combineX86INT_TO_FP(),PerformVMOVNCombine(),PerformVQMOVNCombine(),llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(),llvm::X86TargetLowering::SimplifyDemandedVectorEltsForTargetNode(), andllvm::X86TargetLowering::SimplifyDemandedVectorEltsForTargetShuffle().
bool TargetLowering::SimplifyDemandedVectorElts | ( | SDValue | Op, |
constAPInt & | DemandedElts, | ||
DAGCombinerInfo & | DCI | ||
) | const |
Helper wrapper around SimplifyDemandedVectorElts.
Adds Op back to the worklist upon success.
Definition at line3011 of fileTargetLowering.cpp.
Referencesllvm::TargetLowering::DAGCombinerInfo::AddToWorklist(),llvm::TargetLowering::DAGCombinerInfo::CommitTargetLoweringOpt(),llvm::TargetLowering::DAGCombinerInfo::DAG,llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalize(), andllvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps().
| virtual |
Attempt to simplify any target nodes based on the demanded vector elements, returning true on success.
Otherwise, analyze the expression and return a mask of KnownUndef and KnownZero elements for the expression (used to simplify the caller). The KnownUndef/Zero elements may only be accurate for those bits in the DemandedMask.
Reimplemented inllvm::X86TargetLowering.
Definition at line3828 of fileTargetLowering.cpp.
Referencesassert(),llvm::ISD::BUILTIN_OP_END,llvm::ISD::INTRINSIC_VOID,llvm::ISD::INTRINSIC_W_CHAIN, andllvm::ISD::INTRINSIC_WO_CHAIN.
SDValue TargetLowering::SimplifyMultipleUseDemandedBits | ( | SDValue | Op, |
constAPInt & | DemandedBits, | ||
constAPInt & | DemandedElts, | ||
SelectionDAG & | DAG, | ||
unsigned | Depth =0 | ||
) | const |
More limited version of SimplifyDemandedBits that can be used to "lookthrough" ops that don't contribute to the DemandedBits/DemandedElts - bitwise ops etc.
Definition at line675 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::ISD::AND,llvm::ISD::ANY_EXTEND_VECTOR_INREG,assert(),llvm::ISD::BITCAST,llvm::BitWidth,llvm::ISD::BUILTIN_OP_END,CC,llvm::SelectionDAG::computeKnownBits(),llvm::SelectionDAG::ComputeNumSignBits(),llvm::Depth,llvm::APInt::extractBits(),llvm::ISD::FREEZE,llvm::SelectionDAG::getBitcast(),llvm::APInt::getBitWidth(),llvm::TargetLoweringBase::getBooleanContents(),llvm::SelectionDAG::getDataLayout(),llvm::SDValue::getNode(),llvm::EVT::getScalarSizeInBits(),llvm::SDValue::getScalarValueSizeInBits(),llvm::EVT::getSizeInBits(),llvm::SelectionDAG::getUNDEF(),llvm::SelectionDAG::getValidMaximumShiftAmount(),llvm::SDValue::getValueType(),llvm::EVT::getVectorNumElements(),llvm::APInt::getZero(),Idx,llvm::ISD::INSERT_SUBVECTOR,llvm::ISD::INSERT_VECTOR_ELT,llvm::APInt::insertBits(),llvm::ISD::isBuildVectorAllZeros(),llvm::SelectionDAG::isGuaranteedNotToBeUndefOrPoison(),llvm::EVT::isInteger(),llvm::DataLayout::isLittleEndian(),llvm::isNullConstant(),llvm::EVT::isScalableVector(),llvm::EVT::isVector(),llvm::APInt::isZero(),llvm::KnownBits::isZero(),llvm::SelectionDAG::MaxRecursionDepth,llvm::Offset,llvm::KnownBits::One,llvm::ISD::OR,llvm::peekThroughBitcasts(),llvm::APInt::setBit(),llvm::ISD::SETCC,llvm::ISD::SETLT,llvm::ISD::SHL,llvm::TargetLoweringBase::shouldRemoveRedundantExtend(),llvm::ISD::SIGN_EXTEND_INREG,llvm::ISD::SIGN_EXTEND_VECTOR_INREG,llvm::ISD::SRL,llvm::ISD::VECTOR_SHUFFLE,llvm::ISD::XOR,llvm::KnownBits::Zero,llvm::ISD::ZERO_EXTEND_VECTOR_INREG, andllvm::TargetLoweringBase::ZeroOrNegativeOneBooleanContent.
Referenced bycombineAnd(),combineMaskedLoad(),combineMaskedStore(),combinePTESTCC(),combineVSelectToBLENDV(),matchRotateSub(),llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(),llvm::X86TargetLowering::SimplifyDemandedVectorEltsForTargetNode(), andsimplifyMul24().
SDValue TargetLowering::SimplifyMultipleUseDemandedBits | ( | SDValue | Op, |
constAPInt & | DemandedBits, | ||
SelectionDAG & | DAG, | ||
unsigned | Depth =0 | ||
) | const |
Helper wrapper around SimplifyMultipleUseDemandedBits, demanding all elements.
Definition at line963 of fileTargetLowering.cpp.
Referencesllvm::Depth,llvm::APInt::getAllOnes(),llvm::EVT::getVectorNumElements(), andllvm::EVT::isFixedLengthVector().
| virtual |
More limited version of SimplifyDemandedBits that can be used to "lookthrough" ops that don't contribute to the DemandedBits/DemandedElts - bitwise ops etc.
Reimplemented inllvm::X86TargetLowering.
Definition at line3853 of fileTargetLowering.cpp.
Referencesassert(),llvm::ISD::BUILTIN_OP_END,llvm::ISD::INTRINSIC_VOID,llvm::ISD::INTRINSIC_W_CHAIN, andllvm::ISD::INTRINSIC_WO_CHAIN.
Referenced byllvm::X86TargetLowering::SimplifyMultipleUseDemandedBitsForTargetNode().
SDValue TargetLowering::SimplifyMultipleUseDemandedVectorElts | ( | SDValue | Op, |
constAPInt & | DemandedElts, | ||
SelectionDAG & | DAG, | ||
unsigned | Depth =0 | ||
) | const |
Helper wrapper around SimplifyMultipleUseDemandedBits, demanding all bits from only some vector elements.
Definition at line977 of fileTargetLowering.cpp.
Referencesllvm::Depth, andllvm::APInt::getAllOnes().
Referenced bycombineX86ShufflesRecursively(), andllvm::X86TargetLowering::SimplifyDemandedVectorEltsForTargetNode().
SDValue TargetLowering::SimplifySetCC | ( | EVT | VT, |
SDValue | N0, | ||
SDValue | N1, | ||
ISD::CondCode | Cond, | ||
bool | foldBooleans, | ||
DAGCombinerInfo & | DCI, | ||
constSDLoc & | dl | ||
) | const |
Try to simplify a setcc built with the specified operands and cc.
If it is unable to simplify it, return a nullSDValue.
Definition at line4505 of fileTargetLowering.cpp.
Referencesllvm::ISD::ADD,llvm::TargetLowering::DAGCombinerInfo::AddToWorklist(),llvm::TargetLoweringBase::allowsMemoryAccess(),llvm::And,llvm::ISD::AND,llvm::ISD::ANY_EXTEND,assert(),llvm::ISD::AssertZext,llvm::EVT::bitsGT(),llvm::EVT::bitsLE(),llvm::EVT::bitsLT(),llvm::BitWidth,llvm::CallingConv::C,CC,llvm::commonAlignment(),llvm::SelectionDAG::computeKnownBits(),Cond,llvm::KnownBits::countMaxPopulation(),llvm::KnownBits::countMinPopulation(),llvm::APInt::countr_one(),llvm::APInt::countr_zero(),llvm::ISD::CTLZ,llvm::TargetLowering::DAGCombinerInfo::DAG,llvm::SelectionDAG::doesNodeExist(),llvm::ISD::FABS,llvm::fcInf,llvm::fcNan,llvm::fcNegInf,llvm::fcNone,llvm::fcPosInf,llvm::ISD::FNEG,llvm::SelectionDAG::FoldSetCC(),foldSetCCWithFunnelShift(),foldSetCCWithRotate(),llvm::APInt::getActiveBits(),llvm::SelectionDAG::getAllOnesConstant(),llvm::Function::getAttributes(),llvm::APInt::getBitsSetFrom(),llvm::APInt::getBitWidth(),llvm::SelectionDAG::getBoolConstant(),llvm::TargetLoweringBase::getBooleanContents(),llvm::SelectionDAG::getBoolExtOrTrunc(),llvm::SelectionDAG::getConstant(),llvm::SDValue::getConstantOperandAPInt(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::TargetLoweringBase::getExtendForContent(),llvm::TypeSize::getFixed(),llvm::SDNode::getFlags(),llvm::MachineFunction::getFunction(),llvm::APInt::getHighBitsSet(),llvm::EVT::getIntegerVT(),llvm::SelectionDAG::getLoad(),llvm::APInt::getLowBitsSet(),llvm::SelectionDAG::getMachineFunction(),llvm::APInt::getMaxValue(),llvm::APInt::getMinValue(),llvm::SDValue::getNode(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getNOT(),llvm::SelectionDAG::getObjectPtrOffset(),llvm::SDValue::getOpcode(),llvm::SDNode::getOpcode(),llvm::SDValue::getOperand(),llvm::SDNode::getOperand(),llvm::EVT::getScalarSizeInBits(),llvm::EVT::getScalarType(),llvm::SDValue::getScalarValueSizeInBits(),llvm::SelectionDAG::getSetCC(),llvm::ISD::getSetCCInverse(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::ISD::getSetCCSwappedOperands(),llvm::APInt::getSExtValue(),llvm::SelectionDAG::getShiftAmountConstant(),llvm::APInt::getSignedMaxValue(),llvm::APInt::getSignedMinValue(),llvm::APInt::getSignificantBits(),llvm::SDValue::getSimpleValueType(),llvm::EVT::getSimpleVT(),llvm::EVT::getSizeInBits(),llvm::SelectionDAG::getTargetConstant(),llvm::ISD::getUnorderedFlavor(),llvm::SDValue::getValueSizeInBits(),llvm::SDValue::getValueType(),llvm::SDNode::getValueType(),llvm::SelectionDAG::getVTList(),llvm::AttributeList::hasFnAttr(),llvm::SDNodeFlags::hasNoSignedWrap(),llvm::SDNodeFlags::hasNoUnsignedWrap(),llvm::SDValue::hasOneUse(),llvm::SDNode::hasOneUse(),llvm::Hi,llvm::APInt::intersects(),llvm::ISD::IS_FPCLASS,llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalize(),llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(),llvm::isBitwiseNot(),llvm::TargetLowering::DAGCombinerInfo::isCalledByLegalizer(),llvm::TargetLoweringBase::isCommutativeBinOp(),llvm::TargetLoweringBase::isCondCodeLegal(),llvm::SelectionDAG::isConstantIntBuildVectorOrConstantInt(),llvm::isConstFalseVal(),llvm::isConstOrConstSplat(),llvm::TargetLoweringBase::isFPImmLegal(),llvm::TargetLoweringBase::isIntDivCheap(),llvm::EVT::isInteger(),llvm::TargetLoweringBase::isLegalICmpImmediate(),llvm::DataLayout::isLittleEndian(),llvm::APInt::isMaxSignedValue(),llvm::APInt::isMinSignedValue(),llvm::APInt::isNegatedPowerOf2(),llvm::APInt::isNegative(),llvm::APInt::isNonNegative(),llvm::APInt::isOne(),llvm::isOneConstant(),llvm::TargetLoweringBase::isOperationLegal(),llvm::TargetLoweringBase::isOperationLegalOrCustom(),llvm::TargetLoweringBase::isPaddedAtMostSignificantBitsWhenStored(),llvm::APInt::isPowerOf2(),llvm::TargetLoweringBase::isSExtCheaperThanZExt(),llvm::ISD::isSignedIntSetCC(),llvm::APInt::isSubsetOf(),llvm::ISD::isTrueWhenEqual(),llvm::TargetLoweringBase::isTypeLegal(),llvm::EVT::isVector(),llvm::APInt::isZero(),LHS,llvm_unreachable,llvm::Lo,llvm::Log2_32(),llvm::APInt::logBase2(),llvm::APInt::lshr(),llvm::APInt::lshrInPlace(),llvm::SelectionDAG::MaskedValueIsZero(),llvm::ISD::MUL,llvm::ISD::NON_EXTLOAD,llvm::ISD::OR,Ptr,RHS,llvm::ISD::SETCC,llvm::ISD::SETCC_INVALID,llvm::ISD::SETEQ,llvm::ISD::SETGE,llvm::ISD::SETGT,llvm::ISD::SETLE,llvm::ISD::SETLT,llvm::ISD::SETNE,llvm::ISD::SETO,llvm::ISD::SETOEQ,llvm::ISD::SETOGE,llvm::ISD::SETOGT,llvm::ISD::SETOLE,llvm::ISD::SETOLT,llvm::ISD::SETONE,llvm::ISD::SETUEQ,llvm::ISD::SETUGE,llvm::ISD::SETUGT,llvm::ISD::SETULE,llvm::ISD::SETULT,llvm::ISD::SETUNE,llvm::ISD::SETUO,llvm::ISD::SEXTLOAD,llvm::ISD::SHL,llvm::TargetLoweringBase::shouldAvoidTransformToShift(),llvm::TargetLoweringBase::shouldReduceLoadWidth(),llvm::ISD::SIGN_EXTEND,llvm::ISD::SIGN_EXTEND_INREG,Signed,simplifySetCCWithCTPOP(),llvm::ISD::SRA,llvm::ISD::SREM,llvm::ISD::SRL,llvm::ISD::SUB,llvm::APInt::trunc(),llvm::ISD::TRUNCATE,llvm::ISD::UREM,llvm::ISD::XOR,llvm::ISD::ZERO_EXTEND,llvm::TargetLoweringBase::ZeroOrOneBooleanContent, andllvm::ISD::ZEXTLOAD.
void TargetLowering::softenSetCCOperands | ( | SelectionDAG & | DAG, |
EVT | VT, | ||
SDValue & | NewLHS, | ||
SDValue & | NewRHS, | ||
ISD::CondCode & | CCCode, | ||
constSDLoc & | dl, | ||
constSDValue | OldLHS, | ||
constSDValue | OldRHS | ||
) | const |
Soften the operands of a comparison.
This code is shared among BR_CC, SELECT_CC, and SETCC handlers.
Definition at line292 of fileTargetLowering.cpp.
void TargetLowering::softenSetCCOperands | ( | SelectionDAG & | DAG, |
EVT | VT, | ||
SDValue & | NewLHS, | ||
SDValue & | NewRHS, | ||
ISD::CondCode & | CCCode, | ||
constSDLoc & | DL, | ||
constSDValue | OldLHS, | ||
constSDValue | OldRHS, | ||
SDValue & | Chain, | ||
bool | IsSignaling =false | ||
) | const |
Definition at line302 of fileTargetLowering.cpp.
Referencesllvm::ISD::AND,assert(),llvm::TargetLoweringBase::getCmpLibcallCC(),llvm::TargetLoweringBase::getCmpLibcallReturnType(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SDValue::getValueType(),llvm::EVT::isInteger(),llvm_unreachable,llvm::ISD::OR,llvm::ISD::SETEQ,llvm::ISD::SETGE,llvm::ISD::SETGT,llvm::ISD::SETLE,llvm::ISD::SETLT,llvm::ISD::SETNE,llvm::ISD::SETO,llvm::ISD::SETOEQ,llvm::ISD::SETOGE,llvm::ISD::SETOGT,llvm::ISD::SETOLE,llvm::ISD::SETOLT,llvm::ISD::SETONE,llvm::TargetLowering::MakeLibCallOptions::setTypeListBeforeSoften(),llvm::ISD::SETUEQ,llvm::ISD::SETUGE,llvm::ISD::SETUGT,llvm::ISD::SETULE,llvm::ISD::SETULT,llvm::ISD::SETUNE,llvm::ISD::SETUO, andllvm::ISD::TokenFactor.
| inlinevirtual |
Target-specific splitting of values into parts that fit a register storing a legal type.
Reimplemented inllvm::PPCTargetLowering,llvm::RISCVTargetLowering, andllvm::SystemZTargetLowering.
Definition at line4474 of fileTargetLowering.h.
Referenced bygetCopyToParts().
| inlinevirtual |
Return true if the target supports kcfi operand bundles.
Reimplemented inllvm::AArch64TargetLowering,llvm::RISCVTargetLowering, andllvm::X86TargetLowering.
Definition at line4401 of fileTargetLowering.h.
Referenced byllvm::SelectionDAGBuilder::LowerCallTo().
| inlinevirtual |
Return true if the target supports ptrauth operand bundles.
Reimplemented inllvm::AArch64TargetLowering.
Definition at line4404 of fileTargetLowering.h.
Referenced byllvm::SelectionDAGBuilder::LowerCallTo().
| inlinevirtual |
Return true if the target supports that a subset of CSRs for the given machine function is handled explicitly via copies.
Reimplemented inllvm::AArch64TargetLowering, andllvm::SITargetLowering.
Definition at line4396 of fileTargetLowering.h.
Referenced byllvm::SelectionDAGISel::runOnMachineFunction().
| inlinevirtual |
Return true if the target supports swifterror attribute.
It optimizes loads and stores to reading and writing a specific register.
Reimplemented inllvm::AArch64TargetLowering,llvm::ARMTargetLowering,llvm::SystemZTargetLowering, andllvm::X86TargetLowering.
Definition at line4390 of fileTargetLowering.h.
Referenced byllvm::SwiftErrorValueTracking::createEntriesInEntryBlock(),llvm::SystemZELFRegisters::getCalleeSavedRegs(),llvm::SystemZELFRegisters::getCallPreservedMask(),LowerCallTo(),llvm::SelectionDAGBuilder::LowerCallTo(),llvm::SwiftErrorValueTracking::preassignVRegs(),llvm::SwiftErrorValueTracking::propagateVRegs(), andllvm::SwiftErrorValueTracking::setFunction().
| inlinevirtual |
Reimplemented inllvm::AArch64TargetLowering,llvm::ARMTargetLowering,llvm::RISCVTargetLowering, andllvm::X86TargetLowering.
Definition at line3992 of fileTargetLowering.h.
Reimplemented inllvm::X86TargetLowering.
Definition at line4273 of fileTargetLowering.h.
ReferencesN.
Referenced bymatchLSNode().
If this function returns true,SelectionDAGBuilder emits a LOAD_STACK_GUARD node when it is lowering Intrinsic::stackprotector.
Reimplemented inllvm::AArch64TargetLowering,llvm::ARMTargetLowering,llvm::PPCTargetLowering,llvm::SparcTargetLowering,llvm::SystemZTargetLowering, andllvm::X86TargetLowering.
Definition at line5593 of fileTargetLowering.h.
Referenced byllvm::AArch64TargetLowering::useLoadStackGuardNode(),llvm::PPCTargetLowering::useLoadStackGuardNode(),llvm::SparcTargetLowering::useLoadStackGuardNode(), andllvm::SelectionDAGBuilder::visitSPDescriptorParent().
bool TargetLowering::verifyReturnAddressArgumentIsConstant | ( | SDValue | Op, |
SelectionDAG & | DAG | ||
) | const |
Definition at line7259 of fileTargetLowering.cpp.
Referencesllvm::LLVMContext::emitError(), andllvm::SelectionDAG::getContext().
Referenced byllvm::HexagonTargetLowering::LowerRETURNADDR(),llvm::MSP430TargetLowering::LowerRETURNADDR(),LowerRETURNADDR(), andlowerRETURNADDR().
Check the givenSDNode. Aborts if it is invalid.
Reimplemented inllvm::AArch64TargetLowering.
Definition at line4935 of fileTargetLowering.h.
Referenced byVerifySDNode().
| inlinevirtual |
Reimplemented inllvm::X86TargetLowering.
Definition at line3909 of fileTargetLowering.h.
Referencesllvm_unreachable.
| inlinevirtual |
Reimplemented inllvm::X86TargetLowering.
Definition at line3916 of fileTargetLowering.h.
Referencesllvm_unreachable.