52 #define DEBUG_TYPE "legalizevectorops" 56 class VectorLegalizer {
68 LegalizedNodes.
insert(std::make_pair(From, To));
71 LegalizedNodes.
insert(std::make_pair(To, To));
137 std::pair<SDValue, SDValue> ExpandLoad(
SDNode *N);
178 bool VectorLegalizer::Run() {
180 bool HasVectors =
false;
182 E = std::prev(DAG.allnodes_end());
I != std::next(
E); ++
I) {
187 HasVectors |= J->isVector();
204 DAG.AssignTopologicalOrder();
206 E = std::prev(DAG.allnodes_end());
I != std::next(
E); ++
I)
210 SDValue OldRoot = DAG.getRoot();
211 assert(LegalizedNodes.count(OldRoot) &&
"Root didn't get legalized?");
212 DAG.setRoot(LegalizedNodes[OldRoot]);
214 LegalizedNodes.clear();
217 DAG.RemoveDeadNodes();
224 "Unexpected number of results");
232 VectorLegalizer::RecursivelyLegalizeResults(
SDValue Op,
235 "Unexpected number of results");
237 for (
unsigned i = 0,
e = Results.
size(); i !=
e; ++i) {
238 Results[i] = LegalizeOp(Results[i]);
239 AddLegalizedOperand(Op.
getValue(i), Results[i]);
249 if (I != LegalizedNodes.
end())
return I->second;
254 Ops.push_back(LegalizeOp(Oper));
268 return TranslateLegalizeResults(Op, Node);
271 if (LowerOperationWrapper(Node, ResultVals)) {
272 if (ResultVals.
empty())
273 return TranslateLegalizeResults(Op, Node);
276 return RecursivelyLegalizeResults(Op, ResultVals);
282 std::pair<SDValue, SDValue> Tmp = ExpandLoad(Node);
283 AddLegalizedOperand(Op.
getValue(0), Tmp.first);
284 AddLegalizedOperand(Op.
getValue(1), Tmp.second);
285 return Op.
getResNo() ? Tmp.first : Tmp.second;
296 switch (TLI.getTruncStoreAction(ValVT, StVT)) {
299 return TranslateLegalizeResults(Op, Node);
302 if (LowerOperationWrapper(Node, ResultVals)) {
303 if (ResultVals.
empty())
304 return TranslateLegalizeResults(Op, Node);
307 return RecursivelyLegalizeResults(Op, ResultVals);
313 SDValue Chain = ExpandStore(Node);
314 AddLegalizedOperand(Op, Chain);
321 bool HasVectorValueOrOp =
false;
323 HasVectorValueOrOp |= J->isVector();
325 HasVectorValueOrOp |= Oper.getValueType().isVector();
327 if (!HasVectorValueOrOp)
328 return TranslateLegalizeResults(Op, Node);
334 return TranslateLegalizeResults(Op, Node);
342 #define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN) \ 343 case ISD::STRICT_##DAGN: 344 #include "llvm/IR/ConstrainedOps.def" 349 Action = TLI.getOperationAction(Node->
getOpcode(), ValVT);
356 TLI.getStrictFPOperationAction(Node->
getOpcode(), ValVT) ==
359 if (TLI.getOperationAction(Node->
getOpcode(), EltVT)
361 TLI.getStrictFPOperationAction(Node->
getOpcode(), EltVT)
468 Action = TLI.getFixedPointOperationAction(Node->
getOpcode(),
487 Action = TLI.getOperationAction(Node->
getOpcode(),
499 Promote(Node, ResultVals);
500 assert(!ResultVals.empty() &&
"No results for promotion?");
507 if (LowerOperationWrapper(Node, ResultVals))
513 Expand(Node, ResultVals);
517 if (ResultVals.empty())
518 return TranslateLegalizeResults(Op, Node);
521 return RecursivelyLegalizeResults(Op, ResultVals);
526 bool VectorLegalizer::LowerOperationWrapper(
SDNode *Node,
546 "Lowering returned the wrong number of results!");
564 PromoteINT_TO_FP(Node, Results);
571 PromoteFP_TO_INT(Node, Results);
586 "Can't promote a vector with multiple results!");
588 MVT NVT = TLI.getTypeToPromoteTo(Node->
getOpcode(), VT);
609 if ((VT.isFloatingPoint() && NVT.isFloatingPoint()) ||
610 (VT.isVector() && VT.getVectorElementType().isFloatingPoint() &&
611 NVT.isVector() && NVT.getVectorElementType().isFloatingPoint()))
619 void VectorLegalizer::PromoteINT_TO_FP(
SDNode *Node,
625 MVT NVT = TLI.getTypeToPromoteTo(Node->
getOpcode(), VT);
627 "Vectors have different number of elements!");
660 void VectorLegalizer::PromoteFP_TO_INT(
SDNode *Node,
663 MVT NVT = TLI.getTypeToPromoteTo(Node->
getOpcode(), VT);
666 "Vectors have different number of elements!");
697 Promoted = DAG.
getNode(NewOpc, dl, NVT, Promoted,
705 std::pair<SDValue, SDValue> VectorLegalizer::ExpandLoad(
SDNode *
N) {
714 if (SrcVT.getVectorNumElements() > 1 && !SrcEltVT.
isByteSized()) {
730 EVT WideVT = TLI.getPointerTy(DAG.getDataLayout());
733 "Could not handle the sophisticated case when the widest integer is" 736 "Type is not legalized?");
740 unsigned RemainingBytes = SrcVT.getStoreSize();
742 while (RemainingBytes > 0) {
744 unsigned LoadBytes = WideBytes;
746 if (RemainingBytes >= LoadBytes) {
748 DAG.getLoad(WideVT, dl, Chain, BasePTR,
754 while (RemainingBytes < LoadBytes) {
759 DAG.getExtLoad(
ISD::EXTLOAD, dl, WideVT, Chain, BasePTR,
765 RemainingBytes -= LoadBytes;
768 BasePTR = DAG.getObjectPtrOffset(dl, BasePTR, LoadBytes);
774 unsigned BitOffset = 0;
775 unsigned WideIdx = 0;
780 SDValue SrcEltBitMask = DAG.getConstant(
783 for (
unsigned Idx = 0; Idx != NumElem; ++Idx) {
784 assert(BitOffset < WideBits &&
"Unexpected offset!");
786 SDValue ShAmt = DAG.getConstant(
787 BitOffset, dl, TLI.getShiftAmountTy(WideVT, DAG.getDataLayout()));
790 BitOffset += SrcEltBits;
791 if (BitOffset >= WideBits) {
793 BitOffset -= WideBits;
795 ShAmt = DAG.getConstant(
796 SrcEltBits - BitOffset, dl,
797 TLI.getShiftAmountTy(WideVT, DAG.getDataLayout()));
799 DAG.getNode(
ISD::SHL, dl, WideVT, LoadVals[WideIdx], ShAmt);
809 Lo = DAG.getAnyExtOrTrunc(Lo, dl, DstEltVT);
812 Lo = DAG.getZExtOrTrunc(Lo, dl, DstEltVT);
816 DAG.getConstant(WideBits - SrcEltBits, dl,
817 TLI.getShiftAmountTy(WideVT, DAG.getDataLayout()));
820 Lo = DAG.getSExtOrTrunc(Lo, dl, DstEltVT);
827 Value = DAG.getBuildVector(N->
getValueType(0), dl, Vals);
829 std::tie(Value, NewChain) = TLI.scalarizeVectorLoad(LD, DAG);
832 return std::make_pair(Value, NewChain);
837 SDValue TF = TLI.scalarizeVectorStore(ST, DAG);
849 Results.
push_back(ExpandSEXTINREG(Node));
852 Results.
push_back(ExpandANY_EXTEND_VECTOR_INREG(Node));
855 Results.
push_back(ExpandSIGN_EXTEND_VECTOR_INREG(Node));
858 Results.
push_back(ExpandZERO_EXTEND_VECTOR_INREG(Node));
870 ExpandFP_TO_UINT(Node, Results);
873 ExpandUINT_TO_FLOAT(Node, Results);
879 ExpandFSUB(Node, Results);
885 if (TLI.expandABS(Node, Tmp, DAG)) {
891 ExpandBITREVERSE(Node, Results);
894 if (TLI.expandCTPOP(Node, Tmp, DAG)) {
901 if (TLI.expandCTLZ(Node, Tmp, DAG)) {
908 if (TLI.expandCTTZ(Node, Tmp, DAG)) {
915 if (TLI.expandFunnelShift(Node, Tmp, DAG)) {
922 if (TLI.expandROT(Node, Tmp, DAG)) {
929 if (
SDValue Expanded = TLI.expandFMINNUM_FMAXNUM(Node, DAG)) {
936 ExpandUADDSUBO(Node, Results);
940 ExpandSADDSUBO(Node, Results);
944 ExpandMULO(Node, Results);
950 if (
SDValue Expanded = TLI.expandAddSubSat(Node, DAG)) {
957 if (
SDValue Expanded = TLI.expandFixedPointMul(Node, DAG)) {
971 Results.
push_back(ExpandFixedPointDiv(Node));
973 #define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN) \ 974 case ISD::STRICT_##DAGN: 975 #include "llvm/IR/ConstrainedOps.def" 976 ExpandStrictFPOp(Node, Results);
991 Results.
push_back(TLI.expandVecReduce(Node, DAG));
995 Results.
push_back(DAG.UnrollVectorOp(Node));
1021 return DAG.UnrollVectorOp(Node);
1029 Mask = DAG.getSelect(DL, BitTy, Mask,
1032 DAG.getConstant(0, DL, BitTy));
1035 Mask = DAG.getSplatBuildVector(MaskTy, DL, Mask);
1043 SDValue AllOnes = DAG.getConstant(
1059 return DAG.UnrollVectorOp(Node);
1066 SDValue ShiftSz = DAG.getConstant(BW - OrigBW, DL, VT);
1069 return DAG.getNode(
ISD::SRA, DL, VT, Op, ShiftSz);
1074 SDValue VectorLegalizer::ExpandANY_EXTEND_VECTOR_INREG(
SDNode *Node) {
1086 "ANY_EXTEND_VECTOR_INREG vector size mismatch");
1092 DAG.getConstant(0, DL, TLI.getVectorIdxTy(DAG.getDataLayout())));
1097 ShuffleMask.
resize(NumSrcElements, -1);
1100 int ExtLaneScale = NumSrcElements / NumElements;
1101 int EndianOffset = DAG.getDataLayout().isBigEndian() ? ExtLaneScale - 1 : 0;
1102 for (
int i = 0; i < NumElements; ++i)
1103 ShuffleMask[i * ExtLaneScale + EndianOffset] = i;
1107 DAG.getVectorShuffle(SrcVT, DL, Src, DAG.getUNDEF(SrcVT), ShuffleMask));
1110 SDValue VectorLegalizer::ExpandSIGN_EXTEND_VECTOR_INREG(
SDNode *Node) {
1125 SDValue ShiftAmount = DAG.getConstant(EltWidth - SrcEltWidth, DL, VT);
1127 DAG.getNode(
ISD::SHL, DL, VT, Op, ShiftAmount),
1134 SDValue VectorLegalizer::ExpandZERO_EXTEND_VECTOR_INREG(
SDNode *Node) {
1146 "ZERO_EXTEND_VECTOR_INREG vector size mismatch");
1152 DAG.getConstant(0, DL, TLI.getVectorIdxTy(DAG.getDataLayout())));
1156 SDValue Zero = DAG.getConstant(0, DL, SrcVT);
1161 ShuffleMask.
reserve(NumSrcElements);
1162 for (
int i = 0; i < NumSrcElements; ++i)
1165 int ExtLaneScale = NumSrcElements / NumElements;
1166 int EndianOffset = DAG.getDataLayout().isBigEndian() ? ExtLaneScale - 1 : 0;
1167 for (
int i = 0; i < NumElements; ++i)
1168 ShuffleMask[i * ExtLaneScale + EndianOffset] = NumSrcElements + i;
1171 DAG.getVectorShuffle(SrcVT, DL, Zero, Src, ShuffleMask));
1177 for (
int J = ScalarSizeInBytes - 1; J >= 0; --J)
1178 ShuffleMask.
push_back((
I * ScalarSizeInBytes) + J);
1190 if (!TLI.isShuffleMaskLegal(ShuffleMask, ByteVT))
1191 return DAG.UnrollVectorOp(Node);
1195 Op = DAG.getVectorShuffle(ByteVT, DL, Op, DAG.getUNDEF(ByteVT), ShuffleMask);
1199 void VectorLegalizer::ExpandBITREVERSE(
SDNode *Node,
1205 SDValue Tmp = DAG.UnrollVectorOp(Node);
1214 if (ScalarSizeInBits > 8 && (ScalarSizeInBits % 8) == 0) {
1219 if (TLI.isShuffleMaskLegal(BSWAPMask, ByteVT) &&
1221 (TLI.isOperationLegalOrCustom(
ISD::SHL, ByteVT) &&
1222 TLI.isOperationLegalOrCustom(
ISD::SRL, ByteVT) &&
1223 TLI.isOperationLegalOrCustomOrPromote(
ISD::AND, ByteVT) &&
1224 TLI.isOperationLegalOrCustomOrPromote(
ISD::OR, ByteVT)))) {
1227 Op = DAG.getVectorShuffle(ByteVT, DL, Op, DAG.getUNDEF(ByteVT),
1238 if (TLI.isOperationLegalOrCustom(
ISD::SHL, VT) &&
1239 TLI.isOperationLegalOrCustom(
ISD::SRL, VT) &&
1240 TLI.isOperationLegalOrCustomOrPromote(
ISD::AND, VT) &&
1241 TLI.isOperationLegalOrCustomOrPromote(
ISD::OR, VT))
1246 SDValue Tmp = DAG.UnrollVectorOp(Node);
1273 return DAG.UnrollVectorOp(Node);
1279 return DAG.UnrollVectorOp(Node);
1287 SDValue AllOnes = DAG.getConstant(
1297 void VectorLegalizer::ExpandFP_TO_UINT(
SDNode *Node,
1301 if (TLI.expandFP_TO_UINT(Node, Result, Chain, DAG)) {
1310 UnrollStrictFPOp(Node, Results);
1314 Results.
push_back(DAG.UnrollVectorOp(Node));
1317 void VectorLegalizer::ExpandUINT_TO_FLOAT(
SDNode *Node,
1320 unsigned OpNo = IsStrict ? 1 : 0;
1328 if (TLI.expandUINT_TO_FP(Node, Result, Chain, DAG)) {
1342 UnrollStrictFPOp(Node, Results);
1346 Results.
push_back(DAG.UnrollVectorOp(Node));
1351 assert((BW == 64 || BW == 32) &&
1352 "Elements in vector-UINT_TO_FP must be 32 or 64 bits wide");
1354 SDValue HalfWord = DAG.getConstant(BW / 2, DL, VT);
1359 uint64_t HWMask = (BW == 64) ? 0x00000000FFFFFFFF : 0x0000FFFF;
1360 SDValue HalfWordMask = DAG.getConstant(HWMask, DL, VT);
1364 DAG.getConstantFP(1ULL << (BW / 2), DL, Node->
getValueType(0));
1416 return DAG.UnrollVectorOp(Node);
1419 void VectorLegalizer::ExpandFSUB(
SDNode *Node,
1425 if (TLI.isOperationLegalOrCustom(
ISD::FNEG, VT) &&
1426 TLI.isOperationLegalOrCustom(
ISD::FADD, VT))
1429 SDValue Tmp = DAG.UnrollVectorOp(Node);
1433 void VectorLegalizer::ExpandUADDSUBO(
SDNode *Node,
1436 TLI.expandUADDSUBO(Node, Result, Overflow, DAG);
1441 void VectorLegalizer::ExpandSADDSUBO(
SDNode *Node,
1444 TLI.expandSADDSUBO(Node, Result, Overflow, DAG);
1449 void VectorLegalizer::ExpandMULO(
SDNode *Node,
1452 if (!TLI.expandMULO(Node, Result, Overflow, DAG))
1453 std::tie(Result, Overflow) = DAG.UnrollVectorOverflowOp(Node);
1459 SDValue VectorLegalizer::ExpandFixedPointDiv(
SDNode *Node) {
1464 return DAG.UnrollVectorOp(N);
1467 void VectorLegalizer::ExpandStrictFPOp(
SDNode *Node,
1470 ExpandUINT_TO_FLOAT(Node, Results);
1474 ExpandFP_TO_UINT(Node, Results);
1478 UnrollStrictFPOp(Node, Results);
1481 void VectorLegalizer::UnrollStrictFPOp(
SDNode *Node,
1489 EVT TmpEltVT = EltVT;
1493 *DAG.getContext(), TmpEltVT);
1501 for (
unsigned i = 0; i < NumElems; ++i) {
1503 SDValue Idx = DAG.getConstant(i, dl,
1510 for (
unsigned j = 1; j < NumOpers; ++j) {
1527 ScalarResult = DAG.getSelect(dl, EltVT, ScalarResult,
1530 DAG.getConstant(0, dl, EltVT));
1536 SDValue Result = DAG.getBuildVector(VT, dl, OpValues);
1553 for (
unsigned i = 0; i < NumElems; ++i) {
1556 DAG.getConstant(i, dl, TLI.getVectorIdxTy(DAG.getDataLayout())));
1559 DAG.getConstant(i, dl, TLI.getVectorIdxTy(DAG.getDataLayout())));
1561 TLI.getSetCCResultType(DAG.getDataLayout(),
1562 *DAG.getContext(), TmpEltVT),
1563 LHSElem, RHSElem, CC);
1564 Ops[i] = DAG.getSelect(dl, EltVT, Ops[i],
1567 DAG.getConstant(0, dl, EltVT));
1569 return DAG.getBuildVector(VT, dl, Ops);
1573 return VectorLegalizer(*this).Run();
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
virtual MVT getVectorIdxTy(const DataLayout &DL) const
Returns the type to be used for the index operand of: ISD::INSERT_VECTOR_ELT, ISD::EXTRACT_VECTOR_ELT...
EVT getValueType() const
Return the ValueType of the referenced return value.
static APInt getAllOnesValue(unsigned numBits)
Get the all-ones value.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
This class represents lattice values for constants.
value_iterator value_end() const
FMINIMUM/FMAXIMUM - NaN-propagating minimum/maximum that also treat -0.0 as less than 0...
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
Same as the corresponding unsaturated fixed point instructions, but the result is clamped between the...
ZERO_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register zero-extension of the low ...
bool isVector() const
Return true if this is a vector value type.
const SDValue & getBasePtr() const
void push_back(const T &Elt)
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
const SDValue & getValue() const
bool LegalizeVectors()
This transforms the SelectionDAG into a SelectionDAG that only uses vector math operations supported ...
static APInt getLowBitsSet(unsigned numBits, unsigned loBitsSet)
Get a value with low bits set.
AAMDNodes getAAInfo() const
Returns the AA info that describes the dereference.
RESULT, BOOL = [SU]ADDO(LHS, RHS) - Overflow-aware nodes for addition.
unsigned getVectorNumElements() const
const SDValue & getChain() const
Function Alias Analysis Results
unsigned getAlignment() const
Constrained versions of the binary floating point operators.
MVT getSimpleValueType(unsigned ResNo) const
Return the type of a specified result as a simple type.
SIGN_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register sign-extension of the low ...
[US]{MIN/MAX} - Binary minimum or maximum or signed or unsigned integers.
const SDNodeFlags getFlags() const
SDNode * getNode() const
get the SDNode which holds the desired result
void reserve(size_type N)
bool isByteSized() const
Return true if the bit size is a multiple of 8.
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector with VECTOR2 inserted into VECTOR1 at the ...
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
bool isTruncatingStore() const
Return true if the op does a truncation before store.
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
Shift and rotation operations.
ABS - Determine the unsigned absolute value of a signed integer value of the same bitwidth...
RESULT = [US]MULFIX(LHS, RHS, SCALE) - Perform fixed point multiplication on 2 integers with the same...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
TypeSize getValueSizeInBits() const
Returns the size of the value in bits.
mir Rename Register Operands
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
This file implements a class to represent arbitrary precision integral constant values and operations...
STRICT_FSETCC/STRICT_FSETCCS - Constrained versions of SETCC, used for floating-point operands only...
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
Simple integer binary arithmetic operators.
STRICT_[US]INT_TO_FP - Convert a signed or unsigned integer to a floating point value.
ANY_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register any-extension of the low la...
MVT getVectorElementType() const
This class is used to represent ISD::STORE nodes.
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
MVT getSimpleValueType() const
Return the simple ValueType of the referenced return value.
constexpr uint64_t MinAlign(uint64_t A, uint64_t B)
A and B are either alignments or offsets.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
bool bitsGE(EVT VT) const
Return true if this has no less bits than VT.
These reductions are non-strict, and have a single vector operand.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Simple binary floating point operators.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
size_t size() const
size - Get the array size.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
iterator_range< value_op_iterator > op_values() const
bool isRound() const
Return true if the size is a power-of-two number of bytes.
const SDValue & getOperand(unsigned Num) const
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
TypeSize getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
Bit counting operators with an undefined result for zero inputs.
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
unsigned getNumOperands() const
Return the number of values used by this operation.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LegalizeAction
This enum indicates whether operations are valid for a target, and if not, what action should be used...
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
RESULT = [US]ADDSAT(LHS, RHS) - Perform saturation addition on 2 integers with the same bit width (W)...
TokenFactor - This node takes multiple tokens as input and produces a single token result...
void dump() const
Dump this node, for debugging.
const TargetLowering & getTargetLoweringInfo() const
Iterator for intrusive lists based on ilist_node.
BlockVerifier::State From
Returns platform specific canonical encoding of a floating point number.
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
EVT getVectorElementType() const
Given a vector type, return the type of each element.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
value_iterator value_begin() const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
EVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
FMINNUM_IEEE/FMAXNUM_IEEE - Perform floating-point minimum or maximum on two values, following the IEEE-754 2008 definition.
Byte Swap and Counting operators.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
MVT getScalarType() const
If this is a vector, return the element type, otherwise return this.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
MachinePointerInfo getWithOffset(int64_t O) const
static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements, bool IsScalable=false)
Returns the EVT that represents a vector NumElements in length, where each element is of type VT...
EVT getMemoryVT() const
Return the type of the in-memory value.
Select(COND, TRUEVAL, FALSEVAL).
ZERO_EXTEND - Used for integer types, zeroing the new bits.
ANY_EXTEND - Used for integer types. The high bits are undefined.
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
bool isVector() const
Return true if this is a vector value type.
Bitwise operators - logical and, logical or, logical xor.
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
LLVM_NODISCARD bool empty() const
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
virtual EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const
Return the ValueType of the result of SETCC operations.
Flags getFlags() const
Return the raw flags of the source value,.
RESULT = [US]SUBSAT(LHS, RHS) - Perform saturation subtraction on 2 integers with the same bit width ...
unsigned getOpcode() const
SDValue getValue(unsigned R) const
const MachinePointerInfo & getPointerInfo() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
TypeSize getScalarSizeInBits() const
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
FMA - Perform a * b + c with no intermediate rounding step.
Integer reductions may have a result type larger than the vector element type.
unsigned getResNo() const
get the index which selects a specific result in the SDNode
FMIN/FMAX nodes can have flags, for NaN/NoNaN variants.
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
SetCC operator - This evaluates to a true value iff the condition is true.
MERGE_VALUES - This node takes multiple discrete operands and returns them all as its individual resu...
bool isStrictFPOpcode()
Test if this node is a strict floating point pseudo-op.
TRUNCATE - Completely drop the high bits.
for(unsigned i=Desc.getNumOperands(), e=OldMI.getNumOperands();i !=e;++i)
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
RESULT = [US]DIVFIX(LHS, RHS, SCALE) - Perform fixed point division on 2 integers with the same width...
Perform various unary floating-point operations inspired by libm.
static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth)
Returns the EVT that represents an integer with the given number of bits.
static void createBSWAPShuffleMask(EVT VT, SmallVectorImpl< int > &ShuffleMask)
STRICT_FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
This file describes how to lower LLVM code to machine code.
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
This class is used to represent ISD::LOAD nodes.