75 return getValueAPF().bitwiseIsEqual(V);
111 if (i == e)
return false;
124 if (CN->getAPIntValue().countTrailingOnes() < EltSize)
127 if (CFPN->getValueAPF().bitcastToAPInt().countTrailingOnes() < EltSize)
135 for (++i; i != e; ++i)
159 if (i == e)
return false;
165 if (!CN->isNullValue())
168 if (!CFPN->getValueAPF().isPosZero())
175 for (++i; i != e; ++i)
196 for (
unsigned i = 1; i < NumElems; ++i) {
225 unsigned OldL = (Operation >> 2) & 1;
226 unsigned OldG = (Operation >> 1) & 1;
235 unsigned Operation = Op;
277 unsigned Op = Op1 | Op2;
338 const SDValue *Ops,
unsigned NumOps) {
339 for (; NumOps; --NumOps, ++Ops) {
348 const SDUse *Ops,
unsigned NumOps) {
349 for (; NumOps; --NumOps, ++Ops) {
356 unsigned short OpC,
SDVTList VTList,
357 const SDValue *OpList,
unsigned N) {
373 ID.
AddPointer(cast<ConstantSDNode>(N)->getConstantIntValue());
377 ID.
AddPointer(cast<ConstantFPSDNode>(N)->getConstantFPValue());
398 ID.
AddPointer(cast<RegisterMaskSDNode>(N)->getRegMask());
401 ID.
AddPointer(cast<SrcValueSDNode>(N)->getValue());
405 ID.
AddInteger(cast<FrameIndexSDNode>(N)->getIndex());
409 ID.
AddInteger(cast<JumpTableSDNode>(N)->getIndex());
410 ID.
AddInteger(cast<JumpTableSDNode>(N)->getTargetFlags());
489 ID.
AddInteger(cast<MemSDNode>(N)->getPointerInfo().getAddrSpace());
509 static inline unsigned
511 bool isNonTemporal,
bool isInvariant) {
512 assert((ConvType & 3) == ConvType &&
513 "ConvType may not require more than 2 bits!");
514 assert((AM & 7) == AM &&
515 "AM may not require more than 3 bits!");
519 (isNonTemporal << 6) |
540 for (
unsigned i = 1, e = N->
getNumValues(); i != e; ++i)
573 while (!DeadNodes.
empty()) {
577 DUL->NodeDeleted(N, 0);
580 RemoveNodeFromCSEMaps(N);
611 RemoveNodeFromCSEMaps(N);
615 DeleteNodeNotInCSEMaps(N);
618 void SelectionDAG::DeleteNodeNotInCSEMaps(
SDNode *
N) {
619 assert(N != AllNodes.begin() &&
"Cannot delete the entry node!");
620 assert(N->
use_empty() &&
"Cannot delete a node that is not dead!");
628 void SelectionDAG::DeallocateNode(
SDNode *N) {
629 if (N->OperandsNeedDelete)
630 delete[] N->OperandList;
640 for (
unsigned i = 0, e = DbgVals.
size(); i != e; ++i)
641 DbgVals[i]->setIsInvalidated();
648 bool SelectionDAG::RemoveNodeFromCSEMaps(
SDNode *N) {
653 assert(CondCodeNodes[cast<CondCodeSDNode>(N)->
get()] &&
654 "Cond code doesn't exist!");
655 Erased = CondCodeNodes[cast<CondCodeSDNode>(
N)->
get()] != 0;
656 CondCodeNodes[cast<CondCodeSDNode>(
N)->
get()] = 0;
659 Erased = ExternalSymbols.erase(cast<ExternalSymbolSDNode>(N)->getSymbol());
663 Erased = TargetExternalSymbols.erase(
664 std::pair<std::string,unsigned char>(ESN->
getSymbol(),
669 EVT VT = cast<VTSDNode>(
N)->getVT();
671 Erased = ExtendedValueTypeNodes.erase(VT);
682 Erased = CSEMap.RemoveNode(N);
705 SelectionDAG::AddModifiedNodeToCSEMaps(
SDNode *N) {
709 SDNode *Existing = CSEMap.GetOrInsertNode(N);
718 DUL->NodeDeleted(N, Existing);
719 DeleteNodeNotInCSEMaps(N);
742 SDNode *Node = CSEMap.FindNodeOrInsertPos(ID, InsertPos);
760 SDNode *Node = CSEMap.FindNodeOrInsertPos(ID, InsertPos);
770 const SDValue *Ops,
unsigned NumOps,
778 SDNode *Node = CSEMap.FindNodeOrInsertPos(ID, InsertPos);
792 "Wrong return type!");
795 "Mismatched operand types!");
797 "Wrong operand type!");
799 "Wrong return type size");
806 "Wrong number of operands!");
809 assert((
I->getValueType() == EltVT ||
810 (EltVT.isInteger() &&
I->getValueType().isInteger() &&
811 EltVT.bitsLE(
I->getValueType()))) &&
812 "Wrong operand type!");
814 "Operands must all have the same type");
825 assert(!isa<MemSDNode>(N) &&
"Bad MemSDNode!");
826 assert(!isa<ShuffleVectorSDNode>(N) &&
"Bad ShuffleVectorSDNode!");
827 assert(!isa<ConstantSDNode>(N) &&
"Bad ConstantSDNode!");
828 assert(!isa<ConstantFPSDNode>(N) &&
"Bad ConstantFPSDNode!");
829 assert(!isa<GlobalAddressSDNode>(N) &&
"Bad GlobalAddressSDNode!");
830 assert(!isa<FrameIndexSDNode>(N) &&
"Bad FrameIndexSDNode!");
831 assert(!isa<JumpTableSDNode>(N) &&
"Bad JumpTableSDNode!");
832 assert(!isa<ConstantPoolSDNode>(N) &&
"Bad ConstantPoolSDNode!");
833 assert(!isa<BasicBlockSDNode>(N) &&
"Bad BasicBlockSDNode!");
834 assert(!isa<SrcValueSDNode>(N) &&
"Bad SrcValueSDNode!");
835 assert(!isa<MDNodeSDNode>(N) &&
"Bad MDNodeSDNode!");
836 assert(!isa<RegisterSDNode>(N) &&
"Bad RegisterSDNode!");
837 assert(!isa<BlockAddressSDNode>(N) &&
"Bad BlockAddressSDNode!");
838 assert(!isa<EHLabelSDNode>(N) &&
"Bad EHLabelSDNode!");
839 assert(!isa<ExternalSymbolSDNode>(N) &&
"Bad ExternalSymbolSDNode!");
840 assert(!isa<CondCodeSDNode>(N) &&
"Bad CondCodeSDNode!");
841 assert(!isa<CvtRndSatSDNode>(N) &&
"Bad CvtRndSatSDNode!");
842 assert(!isa<VTSDNode>(N) &&
"Bad VTSDNode!");
843 assert(!isa<MachineSDNode>(N) &&
"Bad MachineSDNode!");
862 unsigned SelectionDAG::getEVTAlignment(
EVT VT)
const {
876 AllNodes.push_back(&EntryNode);
889 assert(!UpdateListeners &&
"Dangling registered DAGUpdateListeners");
894 void SelectionDAG::allnodes_clear() {
895 assert(&*AllNodes.begin() == &EntryNode);
896 AllNodes.remove(AllNodes.begin());
897 while (!AllNodes.empty())
898 DeallocateNode(AllNodes.begin());
903 OperandAllocator.
Reset();
906 ExtendedValueTypeNodes.clear();
907 ExternalSymbols.clear();
908 TargetExternalSymbols.clear();
909 std::fill(CondCodeNodes.begin(), CondCodeNodes.end(),
911 std::fill(ValueTypeNodes.begin(), ValueTypeNodes.end(),
914 EntryNode.UseList = 0;
915 AllNodes.push_back(&EntryNode);
940 "getZeroExtendInReg should use the vector element type instead of "
962 (uint64_t)((int64_t)Val >> EltVT.
getSizeInBits()) + 1 < 2) &&
963 "getConstant with a uint64_t value that doesn't fit in the type!");
972 assert(VT.
isInteger() &&
"Cannot create FP integer constant!");
1001 unsigned ViaVecNumElts = VT.
getSizeInBits() / ViaEltSizeInBits;
1012 .
trunc(ViaEltSizeInBits),
1019 std::reverse(EltParts.begin(), EltParts.end());
1030 Ops.
insert(Ops.
end(), EltParts.begin(), EltParts.end());
1034 &Ops[0], Ops.
size()));
1038 assert(Elt->
getBitWidth() == EltVT.getSizeInBits() &&
1039 "APInt size does not match type size!");
1046 if ((N = CSEMap.FindNodeOrInsertPos(ID, IP)))
1052 CSEMap.InsertNode(N, IP);
1053 AllNodes.push_back(N);
1088 if ((N = CSEMap.FindNodeOrInsertPos(ID, IP)))
1094 CSEMap.InsertNode(N, IP);
1095 AllNodes.push_back(N);
1126 EVT VT, int64_t Offset,
1128 unsigned char TargetFlags) {
1129 assert((TargetFlags == 0 || isTargetGA) &&
1130 "Cannot set target flags on target-independent globals");
1141 if (
const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV))
1142 GVar = dyn_cast_or_null<GlobalVariable>(GA->resolveAliasedGlobal(
false));
1158 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1163 Offset, TargetFlags);
1164 CSEMap.InsertNode(N, IP);
1165 AllNodes.push_back(N);
1175 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1179 CSEMap.InsertNode(N, IP);
1180 AllNodes.push_back(N);
1185 unsigned char TargetFlags) {
1186 assert((TargetFlags == 0 || isTarget) &&
1187 "Cannot set target flags on target-independent jump tables");
1194 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1199 CSEMap.InsertNode(N, IP);
1200 AllNodes.push_back(N);
1205 unsigned Alignment,
int Offset,
1207 unsigned char TargetFlags) {
1208 assert((TargetFlags == 0 || isTarget) &&
1209 "Cannot set target flags on target-independent globals");
1221 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1225 Alignment, TargetFlags);
1226 CSEMap.InsertNode(N, IP);
1227 AllNodes.push_back(N);
1233 unsigned Alignment,
int Offset,
1235 unsigned char TargetFlags) {
1236 assert((TargetFlags == 0 || isTarget) &&
1237 "Cannot set target flags on target-independent globals");
1249 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1253 Alignment, TargetFlags);
1254 CSEMap.InsertNode(N, IP);
1255 AllNodes.push_back(N);
1260 unsigned char TargetFlags) {
1267 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1272 CSEMap.InsertNode(N, IP);
1273 AllNodes.push_back(N);
1282 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1286 CSEMap.InsertNode(N, IP);
1287 AllNodes.push_back(N);
1293 ValueTypeNodes.size())
1300 N =
new (NodeAllocator)
VTSDNode(VT);
1301 AllNodes.push_back(N);
1306 SDNode *&N = ExternalSymbols[Sym];
1309 AllNodes.push_back(N);
1314 unsigned char TargetFlags) {
1316 TargetExternalSymbols[std::pair<std::string,unsigned char>(Sym,
1320 AllNodes.push_back(N);
1325 if ((
unsigned)Cond >= CondCodeNodes.size())
1326 CondCodeNodes.resize(Cond+1);
1328 if (CondCodeNodes[Cond] == 0) {
1330 CondCodeNodes[Cond] =
N;
1331 AllNodes.push_back(N);
1334 return SDValue(CondCodeNodes[Cond], 0);
1342 int NElts = M.
size();
1343 for (
int i = 0; i != NElts; ++i) {
1352 SDValue N2,
const int *Mask) {
1354 "Invalid VECTOR_SHUFFLE");
1364 for (
unsigned i = 0; i != NElts; ++i) {
1365 assert(Mask[i] < (
int)(NElts * 2) &&
"Index out of range");
1372 for (
unsigned i = 0; i != NElts; ++i)
1373 if (MaskVec[i] >= (
int)NElts) MaskVec[i] -= NElts;
1382 bool AllLHS =
true, AllRHS =
true;
1384 for (
unsigned i = 0; i != NElts; ++i) {
1385 if (MaskVec[i] >= (
int)NElts) {
1390 }
else if (MaskVec[i] >= 0) {
1394 if (AllLHS && AllRHS)
1396 if (AllLHS && !N2Undef)
1404 bool Identity =
true;
1405 for (
unsigned i = 0; i != NElts; ++i) {
1406 if (MaskVec[i] >= 0 && MaskVec[i] != (
int)i) Identity =
false;
1408 if (Identity && NElts)
1414 for (
unsigned i = 0; i != NElts; ++i)
1418 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1424 int *MaskAlloc = OperandAllocator.
Allocate<
int>(NElts);
1425 memcpy(MaskAlloc, &MaskVec[0], NElts *
sizeof(
int));
1431 CSEMap.InsertNode(N, IP);
1432 AllNodes.push_back(N);
1447 SDValue Ops[] = { Val, DTy, STy, Rnd, Sat };
1450 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1456 CSEMap.InsertNode(N, IP);
1457 AllNodes.push_back(N);
1466 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1470 CSEMap.InsertNode(N, IP);
1471 AllNodes.push_back(N);
1480 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1484 CSEMap.InsertNode(N, IP);
1485 AllNodes.push_back(N);
1495 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1500 CSEMap.InsertNode(N, IP);
1501 AllNodes.push_back(N);
1509 unsigned char TargetFlags) {
1518 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1523 CSEMap.InsertNode(N, IP);
1524 AllNodes.push_back(N);
1530 "SrcValue is not a pointer?");
1537 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1541 CSEMap.InsertNode(N, IP);
1542 AllNodes.push_back(N);
1553 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1557 CSEMap.InsertNode(N, IP);
1558 AllNodes.push_back(N);
1564 unsigned SrcAS,
unsigned DestAS) {
1572 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
1577 VT, Ptr, SrcAS, DestAS);
1578 CSEMap.InsertNode(N, IP);
1579 AllNodes.push_back(N);
1588 if (OpTy == ShTy || OpTy.
isVector())
return Op;
1601 unsigned StackAlign =
1655 const APInt &C2 = N2C->getAPIntValue();
1657 const APInt &C1 = N1C->getAPIntValue();
1725 return getSetCC(dl, VT, N2, N1, SwappedCond);
1748 unsigned Depth)
const {
1749 APInt KnownZero, KnownOne;
1751 assert((KnownZero & KnownOne) == 0 &&
"Bits known to be one AND zero?");
1752 return (KnownZero & Mask) == Mask;
1760 APInt &KnownOne,
unsigned Depth)
const {
1764 KnownZero = KnownOne =
APInt(BitWidth, 0);
1768 APInt KnownZero2, KnownOne2;
1773 KnownOne = cast<ConstantSDNode>(Op)->getAPIntValue();
1774 KnownZero = ~KnownOne;
1780 assert((KnownZero & KnownOne) == 0 &&
"Bits known to be one AND zero?");
1781 assert((KnownZero2 & KnownOne2) == 0 &&
"Bits known to be one AND zero?");
1784 KnownOne &= KnownOne2;
1786 KnownZero |= KnownZero2;
1791 assert((KnownZero & KnownOne) == 0 &&
"Bits known to be one AND zero?");
1792 assert((KnownZero2 & KnownOne2) == 0 &&
"Bits known to be one AND zero?");
1795 KnownZero &= KnownZero2;
1797 KnownOne |= KnownOne2;
1802 assert((KnownZero & KnownOne) == 0 &&
"Bits known to be one AND zero?");
1803 assert((KnownZero2 & KnownOne2) == 0 &&
"Bits known to be one AND zero?");
1806 APInt KnownZeroOut = (KnownZero & KnownZero2) | (KnownOne & KnownOne2);
1808 KnownOne = (KnownZero & KnownOne2) | (KnownOne & KnownZero2);
1809 KnownZero = KnownZeroOut;
1815 assert((KnownZero & KnownOne) == 0 &&
"Bits known to be one AND zero?");
1816 assert((KnownZero2 & KnownOne2) == 0 &&
"Bits known to be one AND zero?");
1822 KnownOne.clearAllBits();
1827 BitWidth) - BitWidth;
1829 TrailZ = std::min(TrailZ, BitWidth);
1830 LeadZ = std::min(LeadZ, BitWidth);
1842 KnownOne2.clearAllBits();
1845 unsigned RHSUnknownLeadingOnes = KnownOne2.countLeadingZeros();
1846 if (RHSUnknownLeadingOnes != BitWidth)
1847 LeadZ = std::min(BitWidth,
1848 LeadZ + BitWidth - RHSUnknownLeadingOnes - 1);
1856 assert((KnownZero & KnownOne) == 0 &&
"Bits known to be one AND zero?");
1857 assert((KnownZero2 & KnownOne2) == 0 &&
"Bits known to be one AND zero?");
1860 KnownOne &= KnownOne2;
1861 KnownZero &= KnownZero2;
1866 assert((KnownZero & KnownOne) == 0 &&
"Bits known to be one AND zero?");
1867 assert((KnownZero2 & KnownOne2) == 0 &&
"Bits known to be one AND zero?");
1870 KnownOne &= KnownOne2;
1871 KnownZero &= KnownZero2;
1891 unsigned ShAmt = SA->getZExtValue();
1894 if (ShAmt >= BitWidth)
1898 assert((KnownZero & KnownOne) == 0 &&
"Bits known to be one AND zero?");
1899 KnownZero <<= ShAmt;
1908 unsigned ShAmt = SA->getZExtValue();
1911 if (ShAmt >= BitWidth)
1915 assert((KnownZero & KnownOne) == 0 &&
"Bits known to be one AND zero?");
1916 KnownZero = KnownZero.
lshr(ShAmt);
1917 KnownOne = KnownOne.
lshr(ShAmt);
1920 KnownZero |= HighBits;
1925 unsigned ShAmt = SA->getZExtValue();
1928 if (ShAmt >= BitWidth)
1936 assert((KnownZero & KnownOne) == 0 &&
"Bits known to be one AND zero?");
1937 KnownZero = KnownZero.
lshr(ShAmt);
1938 KnownOne = KnownOne.
lshr(ShAmt);
1942 SignBit = SignBit.
lshr(ShAmt);
1945 KnownZero |= HighBits;
1946 }
else if (KnownOne.intersects(SignBit)) {
1947 KnownOne |= HighBits;
1964 InSignBit = InSignBit.
zext(BitWidth);
1966 InputDemandedBits |= InSignBit;
1969 KnownOne &= InputDemandedBits;
1970 KnownZero &= InputDemandedBits;
1971 assert((KnownZero & KnownOne) == 0 &&
"Bits known to be one AND zero?");
1976 KnownZero |= NewBits;
1977 KnownOne &= ~NewBits;
1978 }
else if (KnownOne.intersects(InSignBit)) {
1979 KnownOne |= NewBits;
1980 KnownZero &= ~NewBits;
1982 KnownZero &= ~NewBits;
1983 KnownOne &= ~NewBits;
1992 unsigned LowBits =
Log2_32(BitWidth)+1;
1994 KnownOne.clearAllBits();
2013 KnownZero = KnownZero.
trunc(InBits);
2014 KnownOne = KnownOne.
trunc(InBits);
2016 KnownZero = KnownZero.
zext(BitWidth);
2017 KnownOne = KnownOne.
zext(BitWidth);
2018 KnownZero |= NewBits;
2026 KnownZero = KnownZero.
trunc(InBits);
2027 KnownOne = KnownOne.
trunc(InBits);
2031 bool SignBitKnownZero = KnownZero.
isNegative();
2032 bool SignBitKnownOne = KnownOne.isNegative();
2033 assert(!(SignBitKnownZero && SignBitKnownOne) &&
2034 "Sign bit can't be known to be both zero and one!");
2036 KnownZero = KnownZero.
zext(BitWidth);
2037 KnownOne = KnownOne.
zext(BitWidth);
2040 if (SignBitKnownZero)
2041 KnownZero |= NewBits;
2042 else if (SignBitKnownOne)
2043 KnownOne |= NewBits;
2049 KnownZero = KnownZero.
trunc(InBits);
2050 KnownOne = KnownOne.
trunc(InBits);
2052 KnownZero = KnownZero.
zext(BitWidth);
2053 KnownOne = KnownOne.
zext(BitWidth);
2059 KnownZero = KnownZero.
zext(InBits);
2060 KnownOne = KnownOne.
zext(InBits);
2062 assert((KnownZero & KnownOne) == 0 &&
"Bits known to be one AND zero?");
2063 KnownZero = KnownZero.
trunc(BitWidth);
2064 KnownOne = KnownOne.
trunc(BitWidth);
2071 KnownZero |= (~InMask);
2072 KnownOne &= (~KnownZero);
2085 if (CLHS->getAPIntValue().isNonNegative()) {
2094 if ((KnownZero2 & MaskV) == MaskV) {
2095 unsigned NLZ2 = CLHS->getAPIntValue().countLeadingZeros();
2109 assert((KnownZero2 & KnownOne2) == 0 &&
"Bits known to be one AND zero?");
2113 assert((KnownZero2 & KnownOne2) == 0 &&
"Bits known to be one AND zero?");
2114 KnownZeroOut = std::min(KnownZeroOut,
2126 if (KnownZeroOut >= 2)
2132 const APInt &RA = Rem->getAPIntValue().
abs();
2134 APInt LowBits = RA - 1;
2138 KnownZero = KnownZero2 & LowBits;
2139 KnownOne = KnownOne2 & LowBits;
2143 if (KnownZero2[BitWidth-1] || ((KnownZero2 & LowBits) == LowBits))
2144 KnownZero |= ~LowBits;
2148 if (KnownOne2[BitWidth-1] && ((KnownOne2 & LowBits) != 0))
2149 KnownOne |= ~LowBits;
2150 assert((KnownZero & KnownOne) == 0&&
"Bits known to be one AND zero?");
2156 const APInt &RA = Rem->getAPIntValue();
2158 APInt LowBits = (RA - 1);
2159 KnownZero |= ~LowBits;
2161 assert((KnownZero & KnownOne) == 0&&
"Bits known to be one AND zero?");
2173 KnownOne.clearAllBits();
2207 assert(VT.
isInteger() &&
"Invalid VT!");
2210 unsigned FirstAnswer = 1;
2218 Tmp = cast<VTSDNode>(Op.
getOperand(1))->getVT().getSizeInBits();
2219 return VTBits-Tmp+1;
2221 Tmp = cast<VTSDNode>(Op.
getOperand(1))->getVT().getSizeInBits();
2225 const APInt &Val = cast<ConstantSDNode>(Op)->getAPIntValue();
2237 cast<VTSDNode>(Op.
getOperand(1))->getVT().getScalarType().getSizeInBits();
2241 return std::max(Tmp, Tmp2);
2247 Tmp +=
C->getZExtValue();
2248 if (Tmp > VTBits) Tmp = VTBits;
2255 if (
C->getZExtValue() >= VTBits ||
2256 C->getZExtValue() >= Tmp)
break;
2257 return Tmp -
C->getZExtValue();
2267 FirstAnswer = std::min(Tmp, Tmp2);
2276 if (Tmp == 1)
return 1;
2278 return std::min(Tmp, Tmp2);
2298 unsigned RotAmt =
C->getZExtValue() & (VTBits-1);
2302 RotAmt = (VTBits-RotAmt) & (VTBits-1);
2307 if (Tmp > RotAmt+1)
return Tmp-RotAmt;
2314 if (Tmp == 1)
return 1;
2318 if (CRHS->isAllOnesValue()) {
2319 APInt KnownZero, KnownOne;
2324 if ((KnownZero |
APInt(VTBits, 1)).isAllOnesValue())
2334 if (Tmp2 == 1)
return 1;
2335 return std::min(Tmp, Tmp2)-1;
2339 if (Tmp2 == 1)
return 1;
2343 if (CLHS->isNullValue()) {
2344 APInt KnownZero, KnownOne;
2348 if ((KnownZero |
APInt(VTBits, 1)).isAllOnesValue())
2362 if (Tmp == 1)
return 1;
2363 return std::min(Tmp, Tmp2)-1;
2374 unsigned ExtType =
LD->getExtensionType();
2378 Tmp =
LD->getMemoryVT().getScalarType().getSizeInBits();
2379 return VTBits-Tmp+1;
2381 Tmp =
LD->getMemoryVT().getScalarType().getSizeInBits();
2393 if (NumBits > 1) FirstAnswer = std::max(FirstAnswer, NumBits);
2398 APInt KnownZero, KnownOne;
2432 cast<ConstantSDNode>(Op.
getOperand(1))->getAPIntValue()))
2446 return !
C->getValueAPF().isNaN();
2456 return !
C->isZero();
2463 return !
C->isNullValue();
2472 if (A == B)
return true;
2477 if (CA->isZero() && CB->isZero())
return true;
2489 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
2494 CSEMap.InsertNode(N, IP);
2496 AllNodes.push_back(N);
2507 const APInt &Val =
C->getAPIntValue();
2617 "Vector element count mismatch!");
2623 "Invalid SIGN_EXTEND!");
2626 "Invalid sext node, dst < src!");
2630 "Vector element count mismatch!");
2639 "Invalid ZERO_EXTEND!");
2642 "Invalid zext node, dst < src!");
2646 "Vector element count mismatch!");
2656 "Invalid ANY_EXTEND!");
2659 "Invalid anyext node, dst < src!");
2663 "Vector element count mismatch!");
2681 "Invalid TRUNCATE!");
2684 "Invalid truncate node, src < dst!");
2688 "Vector element count mismatch!");
2707 &&
"Cannot BITCAST between types of different sizes!");
2720 "Illegal SCALAR_TO_VECTOR node!");
2725 isa<ConstantSDNode>(Operand.
getOperand(1)) &&
2751 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
2756 CSEMap.InsertNode(N, IP);
2762 AllNodes.push_back(N);
2777 if (Scalar1 && Scalar2) {
2779 Inputs.
push_back(std::make_pair(Scalar1, Scalar2));
2788 assert(BV1->
getNumOperands() == BV2->getNumOperands() &&
"Out of sync!");
2798 if (V1->
getValueType(0) != SVT || V2->getValueType(0) != SVT)
2801 Inputs.
push_back(std::make_pair(V1, V2));
2806 for (
unsigned I = 0, E = Inputs.
size();
I != E; ++
I) {
2807 const APInt &C1 = Inputs[
I].first->getAPIntValue();
2808 const APInt &C2 = Inputs[
I].second->getAPIntValue();
2821 if (!C2.getBoolValue())
2826 if (!C2.getBoolValue())
2831 if (!C2.getBoolValue())
2836 if (!C2.getBoolValue())
2870 if (Scalar1 && Scalar2)
2871 return Outputs.
back();
2890 if (N1 == N2)
return N1;
2909 assert(VT.
isInteger() &&
"This operator does not apply to FP types!");
2911 N1.
getValueType() == VT &&
"Binary operator types must match!");
2914 if (N2C && N2C->isNullValue())
2916 if (N2C && N2C->isAllOnesValue())
2923 assert(VT.
isInteger() &&
"This operator does not apply to FP types!");
2925 N1.
getValueType() == VT &&
"Binary operator types must match!");
2928 if (N2C && N2C->isNullValue())
2938 assert(VT.
isInteger() &&
"This operator does not apply to FP types!");
2940 N1.
getValueType() == VT &&
"Binary operator types must match!");
2951 if (CFP->getValueAPF().isZero())
2955 if (CFP->getValueAPF().isZero())
2960 if (CFP->getValueAPF().isZero())
2982 assert(VT.
isFloatingPoint() &&
"This operator only applies to FP types!");
2984 N1.
getValueType() == VT &&
"Binary operator types must match!");
2990 "Invalid FCOPYSIGN!");
2998 "Shift operators return type must be the same as their first arg");
3000 "Shifts only work on integers");
3002 "Vector shift amounts must be in the same as their first arg");
3009 "Invalid use of small shift amount with oversized value!");
3016 if (N2C && N2C->isNullValue())
3020 EVT EVT = cast<VTSDNode>(N2)->getVT();
3021 assert(VT == N1.
getValueType() &&
"Not an inreg round!");
3023 "Cannot FP_ROUND_INREG integer types");
3025 "FP_ROUND_INREG type should be vector iff the operand "
3029 "Vector element counts must match in FP_ROUND_INREG");
3030 assert(EVT.
bitsLE(VT) &&
"Not rounding down!");
3032 if (cast<VTSDNode>(N2)->getVT() == VT)
return N1;
3039 isa<ConstantSDNode>(N2) &&
"Invalid FP_ROUND!");
3044 EVT EVT = cast<VTSDNode>(N2)->getVT();
3045 assert(VT == N1.
getValueType() &&
"Not an inreg extend!");
3047 "Cannot *_EXTEND_INREG FP types");
3049 "AssertSExt/AssertZExt type should be the vector element type "
3050 "rather than the vector type!");
3051 assert(EVT.
bitsLE(VT) &&
"Not extending!");
3052 if (VT == EVT)
return N1;
3056 EVT EVT = cast<VTSDNode>(N2)->getVT();
3057 assert(VT == N1.
getValueType() &&
"Not an inreg extend!");
3059 "Cannot *_EXTEND_INREG FP types");
3061 "SIGN_EXTEND_INREG type should be vector iff the operand "
3065 "Vector element counts must match in SIGN_EXTEND_INREG");
3066 assert(EVT.
bitsLE(VT) &&
"Not extending!");
3067 if (EVT == VT)
return N1;
3119 if (N1Op2C && N2C) {
3132 assert(N2C && (
unsigned)N2C->getZExtValue() < 2 &&
"Bad EXTRACT_ELEMENT!");
3136 "Wrong types for EXTRACT_ELEMENT!");
3147 unsigned Shift = ElementSize * N2C->getZExtValue();
3148 APInt ShiftedVal =
C->getAPIntValue().lshr(Shift);
3156 "Extract subvector VTs must be a vectors!");
3159 "Extract subvector VTs must have the same element type!");
3161 "Extract subvector must be from larger vector to smaller vector!");
3163 if (isa<ConstantSDNode>(Index.
getNode())) {
3165 cast<ConstantSDNode>(Index.
getNode())->getZExtValue()
3167 &&
"Extract subvector overflow!");
3326 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
3331 CSEMap.InsertNode(N, IP);
3337 AllNodes.push_back(N);
3353 if (N1CFP && N2CFP && N3CFP) {
3355 const APFloat &
V2 = N2CFP->getValueAPF();
3356 const APFloat &V3 = N3CFP->getValueAPF();
3380 if (Simp.
getNode())
return Simp;
3390 if (N2 == N3)
return N2;
3400 "Insert subvector VTs must be a vectors");
3402 "Dest and insert subvector source types must match!");
3404 "Insert subvector must be from smaller vector to larger vector!");
3405 if (isa<ConstantSDNode>(Index.
getNode())) {
3407 cast<ConstantSDNode>(Index.
getNode())->getZExtValue()
3409 &&
"Insert subvector overflow!");
3429 SDValue Ops[] = { N1, N2, N3 };
3433 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
3438 CSEMap.InsertNode(N, IP);
3444 AllNodes.push_back(N);
3454 SDValue Ops[] = { N1, N2, N3, N4 };
3455 return getNode(Opcode, DL, VT, Ops, 4);
3461 SDValue Ops[] = { N1, N2, N3, N4, N5 };
3462 return getNode(Opcode, DL, VT, Ops, 5);
3478 if (
LoadSDNode *L = dyn_cast<LoadSDNode>(*U))
3480 if (FI->getIndex() < 0)
3485 &ArgChains[0], ArgChains.
size());
3496 assert(
C->getAPIntValue().getBitWidth() == 8);
3535 assert(!VT.
isVector() &&
"Can't handle vector type here!");
3537 unsigned NumVTBytes = NumVTBits / 8;
3538 unsigned NumBytes = std::min(NumVTBytes,
unsigned(Str.
size()));
3540 APInt Val(NumVTBits, 0);
3542 for (
unsigned i = 0; i != NumBytes; ++i)
3543 Val |= (uint64_t)(
unsigned char)Str[i] << i*8;
3545 for (
unsigned i = 0; i != NumBytes; ++i)
3546 Val |= (uint64_t)(
unsigned char)Str[i] << (NumVTBytes-i-1)*8;
3569 unsigned SrcDelta = 0;
3572 G = cast<GlobalAddressSDNode>(Src);
3576 G = cast<GlobalAddressSDNode>(Src.
getOperand(0));
3577 SrcDelta = cast<ConstantSDNode>(Src.
getOperand(1))->getZExtValue();
3590 unsigned Limit, uint64_t Size,
3591 unsigned DstAlign,
unsigned SrcAlign,
3598 assert((SrcAlign == 0 || SrcAlign >= DstAlign) &&
3599 "Expecting memcpy / memset source to meet alignment requirement!");
3608 IsMemset, ZeroMemset, MemcpyStrSrc,
3616 switch (DstAlign & 7) {
3633 unsigned NumMemOps = 0;
3636 while (VTSize > Size) {
3670 if (NumMemOps && AllowOverlap &&
3671 VTSize >= 8 && NewVTSize < Size &&
3680 if (++NumMemOps > Limit)
3683 MemOps.push_back(VT);
3693 unsigned Align,
bool isVol,
3706 std::vector<EVT> MemOps;
3707 bool DstAlignCanChange =
false;
3715 DstAlignCanChange =
true;
3717 if (Align > SrcAlign)
3721 bool isZeroStr = CopyFromStr && Str.
empty();
3725 (DstAlignCanChange ? 0 : Align),
3726 (isZeroStr ? 0 : SrcAlign),
3727 false,
false, CopyFromStr,
true, DAG, TLI))
3730 if (DstAlignCanChange) {
3738 while (NewAlign > Align &&
3742 if (NewAlign > Align) {
3751 unsigned NumMemOps = MemOps.
size();
3752 uint64_t SrcOff = 0, DstOff = 0;
3753 for (
unsigned i = 0; i != NumMemOps; ++i) {
3758 if (VTSize > Size) {
3761 assert(i == NumMemOps-1 && i != 0);
3762 SrcOff -= VTSize - Size;
3763 DstOff -= VTSize - Size;
3775 Store = DAG.
getStore(Chain, dl, Value,
3805 &OutChains[0], OutChains.
size());
3811 unsigned Align,
bool isVol,
3822 std::vector<EVT> MemOps;
3823 bool DstAlignCanChange =
false;
3830 DstAlignCanChange =
true;
3832 if (Align > SrcAlign)
3837 (DstAlignCanChange ? 0 : Align), SrcAlign,
3838 false,
false,
false,
false, DAG, TLI))
3841 if (DstAlignCanChange) {
3844 if (NewAlign > Align) {
3852 uint64_t SrcOff = 0, DstOff = 0;
3856 unsigned NumMemOps = MemOps.
size();
3857 for (
unsigned i = 0; i < NumMemOps; i++) {
3862 Value = DAG.
getLoad(VT, dl, Chain,
3865 false,
false, SrcAlign);
3871 &LoadChains[0], LoadChains.
size());
3873 for (
unsigned i = 0; i < NumMemOps; i++) {
3878 Store = DAG.
getStore(Chain, dl, LoadValues[i],
3886 &OutChains[0], OutChains.
size());
3910 unsigned Align,
bool isVol,
3919 std::vector<EVT> MemOps;
3920 bool DstAlignCanChange =
false;
3927 DstAlignCanChange =
true;
3929 isa<ConstantSDNode>(Src) && cast<ConstantSDNode>(Src)->isNullValue();
3931 Size, (DstAlignCanChange ? 0 :
Align), 0,
3932 true, IsZeroVal,
false,
true, DAG, TLI))
3935 if (DstAlignCanChange) {
3938 if (NewAlign > Align) {
3947 uint64_t DstOff = 0;
3948 unsigned NumMemOps = MemOps.
size();
3951 EVT LargestVT = MemOps[0];
3952 for (
unsigned i = 1; i < NumMemOps; i++)
3953 if (MemOps[i].bitsGT(LargestVT))
3954 LargestVT = MemOps[i];
3957 for (
unsigned i = 0; i < NumMemOps; i++) {
3960 if (VTSize > Size) {
3963 assert(i == NumMemOps-1 && i != 0);
3964 DstOff -= VTSize - Size;
3970 if (VT.
bitsLT(LargestVT)) {
3977 assert(Value.
getValueType() == VT &&
"Value with wrong type.");
3981 isVol,
false,
Align);
3988 &OutChains[0], OutChains.
size());
3993 unsigned Align,
bool isVol,
bool AlwaysInline,
3996 assert(Align &&
"The SDAG layer expects explicit alignment and reserves 0");
4008 isVol,
false, DstPtrInfo, SrcPtrInfo);
4017 isVol, AlwaysInline,
4018 DstPtrInfo, SrcPtrInfo);
4025 assert(ConstantSize &&
"AlwaysInline requires a constant size!");
4028 true, DstPtrInfo, SrcPtrInfo);
4043 Entry.
Node = Dst; Args.push_back(Entry);
4044 Entry.
Node = Src; Args.push_back(Entry);
4045 Entry.
Node = Size; Args.push_back(Entry);
4049 false,
false,
false,
false, 0,
4056 std::pair<SDValue,SDValue> CallResult = TLI->
LowerCallTo(CLI);
4058 return CallResult.second;
4063 unsigned Align,
bool isVol,
4066 assert(Align &&
"The SDAG layer expects explicit alignment and reserves 0");
4079 false, DstPtrInfo, SrcPtrInfo);
4088 DstPtrInfo, SrcPtrInfo);
4101 Entry.
Node = Dst; Args.push_back(Entry);
4102 Entry.
Node = Src; Args.push_back(Entry);
4103 Entry.
Node = Size; Args.push_back(Entry);
4107 false,
false,
false,
false, 0,
4114 std::pair<SDValue,SDValue> CallResult = TLI->
LowerCallTo(CLI);
4116 return CallResult.second;
4121 unsigned Align,
bool isVol,
4123 assert(Align &&
"The SDAG layer expects explicit alignment and reserves 0");
4135 Align, isVol, DstPtrInfo);
4154 Entry.
Node = Dst; Entry.
Ty = IntPtrTy;
4155 Args.push_back(Entry);
4164 Args.push_back(Entry);
4166 Entry.
Ty = IntPtrTy;
4168 Args.push_back(Entry);
4172 false,
false,
false,
false, 0,
4179 std::pair<SDValue,SDValue> CallResult = TLI->
LowerCallTo(CLI);
4181 return CallResult.second;
4194 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) {
4195 cast<AtomicSDNode>(E)->refineAlignment(MMO);
4208 Ops, DynOps, NumOps, MMO,
4209 Ordering, SynchScope);
4210 CSEMap.InsertNode(N, IP);
4211 AllNodes.push_back(N);
4222 Alignment = getEVTAlignment(MemVT);
4239 return getAtomic(Opcode, dl, MemVT, Chain, Ptr, Cmp, Swp, MMO,
4240 Ordering, SynchScope);
4255 SDValue Ops[] = {Chain, Ptr, Cmp, Swp};
4256 return getAtomic(Opcode, dl, MemVT, VTs, Ops, 4, MMO, Ordering, SynchScope);
4262 const Value* PtrVal,
4267 Alignment = getEVTAlignment(MemVT);
4286 return getAtomic(Opcode, dl, MemVT, Chain, Ptr, Val, MMO,
4287 Ordering, SynchScope);
4308 "Invalid Atomic Op");
4314 SDValue Ops[] = {Chain, Ptr, Val};
4315 return getAtomic(Opcode, dl, MemVT, VTs, Ops, 3, MMO, Ordering, SynchScope);
4321 const Value* PtrVal,
4326 Alignment = getEVTAlignment(MemVT);
4345 return getAtomic(Opcode, dl, MemVT, VT, Chain, Ptr, MMO,
4346 Ordering, SynchScope);
4359 return getAtomic(Opcode, dl, MemVT, VTs, Ops, 2, MMO, Ordering, SynchScope);
4370 for (
unsigned i = 0; i < NumOps; ++i)
4378 const EVT *VTs,
unsigned NumVTs,
4379 const SDValue *Ops,
unsigned NumOps,
4381 unsigned Align,
bool Vol,
4382 bool ReadMem,
bool WriteMem) {
4384 MemVT, PtrInfo, Align, Vol,
4390 const SDValue *Ops,
unsigned NumOps,
4392 unsigned Align,
bool Vol,
4393 bool ReadMem,
bool WriteMem) {
4395 Align = getEVTAlignment(MemVT);
4413 const SDValue *Ops,
unsigned NumOps,
4420 (Opcode <= INT_MAX &&
4422 "Opcode is not a memory-accessing opcode!");
4431 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) {
4432 cast<MemIntrinsicSDNode>(E)->refineAlignment(MMO);
4438 NumOps, MemVT, MMO);
4439 CSEMap.InsertNode(N, IP);
4443 NumOps, MemVT, MMO);
4445 AllNodes.push_back(N);
4464 int FI = cast<FrameIndexSDNode>(Ptr.
getOperand(0))->getIndex();
4466 cast<ConstantSDNode>(Ptr.
getOperand(1))->getSExtValue());
4475 if (
ConstantSDNode *OffsetNode = dyn_cast<ConstantSDNode>(OffsetOp))
4488 bool isVolatile,
bool isNonTemporal,
bool isInvariant,
4489 unsigned Alignment,
const MDNode *TBAAInfo,
4492 "Invalid chain type");
4494 Alignment = getEVTAlignment(VT);
4513 return getLoad(AM, ExtType, VT, dl, Chain, Ptr, Offset, MemVT, MMO);
4524 assert(VT == MemVT &&
"Non-extending load from different memory type!");
4528 "Should only be an extending load, not truncating!");
4530 "Cannot convert from FP to Int or Int -> FP!");
4532 "Cannot use trunc store to convert to or from a vector!");
4535 "Cannot use trunc store to change the number of vector elements!");
4540 "Unindexed load with an offset!");
4544 SDValue Ops[] = { Chain, Ptr, Offset };
4553 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) {
4554 cast<LoadSDNode>(E)->refineAlignment(MMO);
4560 CSEMap.InsertNode(N, IP);
4561 AllNodes.push_back(N);
4568 bool isVolatile,
bool isNonTemporal,
4569 bool isInvariant,
unsigned Alignment,
4574 PtrInfo, VT, isVolatile, isNonTemporal, isInvariant, Alignment,
4589 bool isVolatile,
bool isNonTemporal,
4590 unsigned Alignment,
const MDNode *TBAAInfo) {
4593 PtrInfo, MemVT, isVolatile, isNonTemporal,
false, Alignment,
4611 "Load is already a indexed load!");
4620 bool isVolatile,
bool isNonTemporal,
4621 unsigned Alignment,
const MDNode *TBAAInfo) {
4623 "Invalid chain type");
4642 return getStore(Chain, dl, Val, Ptr, MMO);
4648 "Invalid chain type");
4652 SDValue Ops[] = { Chain, Val, Ptr, Undef };
4660 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) {
4661 cast<StoreSDNode>(E)->refineAlignment(MMO);
4667 CSEMap.InsertNode(N, IP);
4668 AllNodes.push_back(N);
4674 EVT SVT,
bool isVolatile,
bool isNonTemporal,
4676 const MDNode *TBAAInfo) {
4678 "Invalid chain type");
4680 Alignment = getEVTAlignment(SVT);
4705 "Invalid chain type");
4707 return getStore(Chain, dl, Val, Ptr, MMO);
4710 "Should only be a truncating store, not extending!");
4712 "Can't do FP-INT conversion!");
4714 "Cannot use trunc store to convert to or from a vector!");
4717 "Cannot use trunc store to change the number of vector elements!");
4721 SDValue Ops[] = { Chain, Val, Ptr, Undef };
4729 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) {
4730 cast<StoreSDNode>(E)->refineAlignment(MMO);
4736 CSEMap.InsertNode(N, IP);
4737 AllNodes.push_back(N);
4746 "Store is already a indexed store!");
4755 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
4763 CSEMap.InsertNode(N, IP);
4764 AllNodes.push_back(N);
4777 const SDUse *Ops,
unsigned NumOps) {
4779 case 0:
return getNode(Opcode, DL, VT);
4780 case 1:
return getNode(Opcode, DL, VT, Ops[0]);
4781 case 2:
return getNode(Opcode, DL, VT, Ops[0], Ops[1]);
4782 case 3:
return getNode(Opcode, DL, VT, Ops[0], Ops[1], Ops[2]);
4789 return getNode(Opcode, DL, VT, &NewOps[0], NumOps);
4793 const SDValue *Ops,
unsigned NumOps) {
4795 case 0:
return getNode(Opcode, DL, VT);
4796 case 1:
return getNode(Opcode, DL, VT, Ops[0]);
4797 case 2:
return getNode(Opcode, DL, VT, Ops[0], Ops[1]);
4798 case 3:
return getNode(Opcode, DL, VT, Ops[0], Ops[1], Ops[2]);
4805 assert(NumOps == 5 &&
"SELECT_CC takes 5 operands!");
4807 "LHS and RHS of condition must have same type!");
4809 "True and False arms of SelectCC must have same type!");
4811 "select_cc node must be of same type as true and false value!");
4815 assert(NumOps == 5 &&
"BR_CC takes 5 operands!");
4817 "LHS/RHS of comparison should match types!");
4831 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
4836 CSEMap.InsertNode(N, IP);
4842 AllNodes.push_back(N);
4851 const SDValue *Ops,
unsigned NumOps) {
4857 const EVT *VTs,
unsigned NumVTs,
4858 const SDValue *Ops,
unsigned NumOps) {
4860 return getNode(Opcode, DL, VTs[0], Ops, NumOps);
4865 const SDValue *Ops,
unsigned NumOps) {
4867 return getNode(Opcode, DL, VTList.
VTs[0], Ops, NumOps);
4878 cast<VTSDNode>(N3.getOperand(1))->getVT() !=
MVT::i1)
4879 return getNode(Opcode, DL, VT, N1, N2, N3.getOperand(0));
4880 else if (N3.getOpcode() ==
ISD::AND)
4881 if (
ConstantSDNode *AndRHS = dyn_cast<ConstantSDNode>(N3.getOperand(1))) {
4885 if ((AndRHS->getValue() & (NumBits-1)) == NumBits-1)
4886 return getNode(Opcode, DL, VT, N1, N2, N3.getOperand(0));
4898 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
4904 }
else if (NumOps == 2) {
4908 }
else if (NumOps == 3) {
4914 VTList, Ops, NumOps);
4916 CSEMap.InsertNode(N, IP);
4921 }
else if (NumOps == 2) {
4925 }
else if (NumOps == 3) {
4931 VTList, Ops, NumOps);
4934 AllNodes.push_back(N);
4942 return getNode(Opcode, DL, VTList, 0, 0);
4948 return getNode(Opcode, DL, VTList, Ops, 1);
4954 return getNode(Opcode, DL, VTList, Ops, 2);
4959 SDValue Ops[] = { N1, N2, N3 };
4960 return getNode(Opcode, DL, VTList, Ops, 3);
4966 SDValue Ops[] = { N1, N2, N3, N4 };
4967 return getNode(Opcode, DL, VTList, Ops, 4);
4973 SDValue Ops[] = { N1, N2, N3, N4, N5 };
4974 return getNode(Opcode, DL, VTList, Ops, 5);
4978 return makeVTList(SDNode::getValueTypeList(VT), 1);
4988 SDVTListNode *Result = VTListMap.FindNodeOrInsertPos(ID, IP);
4989 if (Result == NULL) {
4994 VTListMap.InsertNode(Result, IP);
5007 SDVTListNode *Result = VTListMap.FindNodeOrInsertPos(ID, IP);
5008 if (Result == NULL) {
5014 VTListMap.InsertNode(Result, IP);
5028 SDVTListNode *Result = VTListMap.FindNodeOrInsertPos(ID, IP);
5029 if (Result == NULL) {
5036 VTListMap.InsertNode(Result, IP);
5044 for (
unsigned index = 0; index < NumVTs; index++) {
5049 SDVTListNode *Result = VTListMap.FindNodeOrInsertPos(ID, IP);
5050 if (Result == NULL) {
5052 std::copy(VTs, VTs + NumVTs, Array);
5054 VTListMap.InsertNode(Result, IP);
5067 assert(N->
getNumOperands() == 1 &&
"Update with wrong number of operands");
5073 void *InsertPos = 0;
5074 if (
SDNode *Existing = FindModifiedNodeSlot(N, Op, InsertPos))
5079 if (!RemoveNodeFromCSEMaps(N))
5083 N->OperandList[0].set(Op);
5086 if (InsertPos) CSEMap.InsertNode(N, InsertPos);
5091 assert(N->
getNumOperands() == 2 &&
"Update with wrong number of operands");
5098 void *InsertPos = 0;
5099 if (
SDNode *Existing = FindModifiedNodeSlot(N, Op1, Op2, InsertPos))
5104 if (!RemoveNodeFromCSEMaps(N))
5108 if (N->OperandList[0] != Op1)
5109 N->OperandList[0].set(Op1);
5110 if (N->OperandList[1] != Op2)
5111 N->OperandList[1].set(Op2);
5114 if (InsertPos) CSEMap.InsertNode(N, InsertPos);
5120 SDValue Ops[] = { Op1, Op2, Op3 };
5127 SDValue Ops[] = { Op1, Op2, Op3, Op4 };
5134 SDValue Ops[] = { Op1, Op2, Op3, Op4, Op5 };
5141 "Update with wrong number of operands");
5144 bool AnyChange =
false;
5145 for (
unsigned i = 0; i != NumOps; ++i) {
5153 if (!AnyChange)
return N;
5156 void *InsertPos = 0;
5157 if (
SDNode *Existing = FindModifiedNodeSlot(N, Ops, NumOps, InsertPos))
5162 if (!RemoveNodeFromCSEMaps(N))
5166 for (
unsigned i = 0; i != NumOps; ++i)
5167 if (N->OperandList[i] != Ops[i])
5168 N->OperandList[i].set(Ops[i]);
5171 if (InsertPos) CSEMap.InsertNode(N, InsertPos);
5214 SDValue Ops[] = { Op1, Op2, Op3 };
5240 const SDValue *Ops,
unsigned NumOps) {
5247 const SDValue *Ops,
unsigned NumOps) {
5273 SDValue Ops[] = { Op1, Op2, Op3 };
5282 SDValue Ops[] = { Op1, Op2, Op3 };
5289 N =
MorphNodeTo(N, ~MachineOpc, VTs, Ops, NumOps);
5333 if (
SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP))
5334 return UpdadeSDLocOnMergedSDNode(ON,
SDLoc(N));
5337 if (!RemoveNodeFromCSEMaps(N))
5342 N->ValueList = VTs.
VTs;
5343 N->NumValues = VTs.
NumVTs;
5353 DeadNodeSet.
insert(Used);
5358 MN->setMemRefs(0, 0);
5361 if (NumOps > MN->NumOperands || !MN->OperandsNeedDelete) {
5362 if (MN->OperandsNeedDelete)
5363 delete[] MN->OperandList;
5371 MN->InitOperands(MN->LocalOperands, Ops, NumOps);
5372 MN->OperandsNeedDelete =
false;
5374 MN->InitOperands(MN->OperandList, Ops, NumOps);
5378 if (NumOps > N->NumOperands) {
5379 if (N->OperandsNeedDelete)
5380 delete[] N->OperandList;
5382 N->OperandsNeedDelete =
true;
5389 if (!DeadNodeSet.
empty()) {
5392 E = DeadNodeSet.
end();
I != E; ++
I)
5393 if ((*I)->use_empty())
5399 CSEMap.InsertNode(N, IP);
5435 SDValue Ops[] = { Op1, Op2, Op3 };
5473 SDValue Ops[] = { Op1, Op2, Op3 };
5499 SDValue Ops[] = { Op1, Op2, Op3 };
5534 unsigned NumOps = OpsArray.
size();
5540 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) {
5541 return cast<MachineSDNode>(UpdadeSDLocOnMergedSDNode(E, DL));
5558 N->OperandsNeedDelete =
false;
5561 CSEMap.InsertNode(N, IP);
5563 AllNodes.push_back(N);
5577 VT, Operand, SRIdxVal);
5588 VT, Operand, Subreg, SRIdxVal);
5595 const SDValue *Ops,
unsigned NumOps) {
5600 if (
SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
5611 return new (Allocator)
SDDbgValue(MDPtr, N, R, Off, DL, O);
5617 return new (Allocator)
SDDbgValue(MDPtr, C, Off, DL, O);
5623 return new (Allocator)
SDDbgValue(MDPtr, FI, Off, DL, O);
5638 while (UI != UE && N == *UI)
5646 :
SelectionDAG::DAGUpdateListener(d), UI(ui), UE(ue) {}
5659 "Cannot replace with this method!");
5660 assert(From != To.
getNode() &&
"Cannot replace uses of with self");
5670 RAUWUpdateListener Listener(*
this, UI, UE);
5675 RemoveNodeFromCSEMaps(User);
5685 }
while (UI != UE && *UI == User);
5689 AddModifiedNodeToCSEMaps(User);
5705 for (
unsigned i = 0, e = From->
getNumValues(); i != e; ++i)
5708 "Cannot use this version of ReplaceAllUsesWith!");
5718 RAUWUpdateListener Listener(*
this, UI, UE);
5723 RemoveNodeFromCSEMaps(User);
5733 }
while (UI != UE && *UI == User);
5737 AddModifiedNodeToCSEMaps(User);
5757 RAUWUpdateListener Listener(*
this, UI, UE);
5762 RemoveNodeFromCSEMaps(User);
5773 }
while (UI != UE && *UI == User);
5777 AddModifiedNodeToCSEMaps(User);
5790 if (From == To)
return;
5802 RAUWUpdateListener Listener(*
this, UI, UE);
5805 bool UserRemovedFromCSEMaps =
false;
5822 if (!UserRemovedFromCSEMaps) {
5823 RemoveNodeFromCSEMaps(User);
5824 UserRemovedFromCSEMaps =
true;
5829 }
while (UI != UE && *UI == User);
5833 if (!UserRemovedFromCSEMaps)
5838 AddModifiedNodeToCSEMaps(User);
5856 bool operator<(
const UseMemo &L,
const UseMemo &R) {
5876 for (
unsigned i = 0; i != Num; ++i) {
5877 unsigned FromResNo = From[i].
getResNo();
5880 E = FromNode->
use_end(); UI != E; ++UI) {
5883 UseMemo Memo = { *UI, i, &Use };
5890 std::sort(Uses.
begin(), Uses.
end());
5892 for (
unsigned UseIndex = 0, UseIndexEnd = Uses.
size();
5893 UseIndex != UseIndexEnd; ) {
5899 RemoveNodeFromCSEMaps(User);
5906 unsigned i = Uses[UseIndex].Index;
5911 }
while (UseIndex != UseIndexEnd && Uses[UseIndex].User == User);
5915 AddModifiedNodeToCSEMaps(User);
5924 unsigned DAGSize = 0;
5947 SortedPos = AllNodes.insert(SortedPos, AllNodes.remove(Q));
5948 assert(SortedPos != AllNodes.end() &&
"Overran node list");
5967 assert(Degree != 0 &&
"Invalid node degree");
5973 SortedPos = AllNodes.insert(SortedPos, AllNodes.remove(P));
5974 assert(SortedPos != AllNodes.end() &&
"Overran node list");
5981 if (
I == SortedPos) {
5984 dbgs() <<
"Overran sorted position:\n";
5991 assert(SortedPos == AllNodes.end() &&
5992 "Topological sort incomplete!");
5994 "First node in topological sort is not the entry token!");
5995 assert(AllNodes.front().getNodeId() == 0 &&
5996 "First node in topological sort has non-zero id!");
5997 assert(AllNodes.front().getNumOperands() == 0 &&
5998 "First node in topological sort has operands!");
5999 assert(AllNodes.back().getNodeId() == (int)DAGSize-1 &&
6000 "Last node in topologic sort has unexpected id!");
6001 assert(AllNodes.back().use_empty() &&
6002 "Last node in topologic sort has users!");
6003 assert(DAGSize ==
allnodes_size() &&
"Node count mismatch!");
6010 DbgInfo->
add(DB, SD, isParameter);
6034 E = ClonedDVs.
end();
I != E; ++
I)
6046 GlobalAddressSDNode::GlobalAddressSDNode(
unsigned Opc,
unsigned Order,
6048 EVT VT, int64_t o,
unsigned char TF)
6049 :
SDNode(Opc, Order, DL, getSDVTList(VT)), Offset(o), TargetFlags(TF) {
6057 SrcAddrSpace(SrcAS), DestAddrSpace(DestAS) {}
6061 :
SDNode(Opc, Order, dl, VTs), MemoryVT(memvt), MMO(mmo) {
6066 "Non-temporal encoding error!");
6071 const SDValue *Ops,
unsigned NumOps,
EVT memvt,
6073 :
SDNode(Opc, Order, dl, VTs, Ops, NumOps),
6074 MemoryVT(memvt), MMO(mmo) {
6089 std::vector<EVT> VTs;
6105 const EVT *SDNode::getValueTypeList(
EVT VT) {
6108 return &(*
EVTs->insert(VT).first);
6111 "Value type out of range!");
6124 if (UI.getUse().getResNo() == Value) {
6142 if (UI.getUse().getResNo() == Value)
6174 for (
unsigned i = 0, e = N->NumOperands; i != e; ++i)
6175 if (
this == N->OperandList[i].
getNode())
6186 unsigned Depth)
const {
6187 if (*
this == Dest)
return true;
6191 if (Depth == 0)
return false;
6203 if (
LoadSDNode *Ld = dyn_cast<LoadSDNode>(*
this)) {
6204 if (!Ld->isVolatile())
6205 return Ld->getChain().reachesChainWithoutSideEffects(Dest, Depth-1);
6224 if (Visited.
empty()) {
6229 if (Visited.
count(N))
6234 while (!Worklist.
empty()) {
6249 assert(Num < NumOperands &&
"Invalid child # of SDNode!");
6250 return cast<ConstantSDNode>(OperandList[Num])->getZExtValue();
6255 "Can't unroll a vector with multiple results!");
6258 unsigned NE = VT.getVectorNumElements();
6268 else if (NE > ResNE)
6272 for (i= 0; i !=
NE; ++i) {
6286 Operands[j] = Operand;
6293 &Operands[0], Operands.size()));
6297 &Operands[0], Operands.size()));
6318 for (; i < ResNE; ++i)
6323 &Scalars[0], Scalars.
size());
6331 unsigned Bytes,
int Dist)
const {
6344 int FI = cast<FrameIndexSDNode>(Loc)->getIndex();
6345 int BFI = cast<FrameIndexSDNode>(BaseLoc)->getIndex();
6348 if (FS != BFS || FS != (
int)Bytes)
return false;
6354 cast<ConstantSDNode>(Loc.
getOperand(1))->getSExtValue() == Dist*Bytes)
6359 int64_t Offset1 = 0;
6360 int64_t Offset2 = 0;
6364 if (isGA1 && isGA2 && GV1 == GV2)
6365 return Offset1 == (Offset2 + Dist*Bytes);
6375 int64_t GVOffset = 0;
6379 APInt KnownZero(PtrWidth, 0), KnownOne(PtrWidth, 0);
6382 unsigned AlignBits = KnownZero.countTrailingOnes();
6383 unsigned Align = AlignBits ? 1 << std::min(31U, AlignBits) : 0;
6390 int FrameIdx = 1 << 31;
6391 int64_t FrameOffset = 0;
6393 FrameIdx = FI->getIndex();
6397 FrameIdx = cast<FrameIndexSDNode>(Ptr.
getOperand(0))->getIndex();
6401 if (FrameIdx != (1 << 31)) {
6420 assert(!(NumElements & 1) &&
"Splitting vector, but not in half!");
6424 return std::make_pair(LoVT, HiVT);
6429 std::pair<SDValue, SDValue>
6434 "More vector elements requested than available!");
6440 return std::make_pair(Lo, Hi);
6451 return Val.MachineCPVal->getType();
6452 return Val.ConstVal->getType();
6457 unsigned &SplatBitSize,
6459 unsigned MinSplatBits,
6462 assert(VT.
isVector() &&
"Expected a vector type");
6464 if (MinSplatBits > sz)
6467 SplatValue =
APInt(sz, 0);
6468 SplatUndef =
APInt(sz, 0);
6475 assert(nOps > 0 &&
"isConstantSplat has 0-size build vector");
6478 for (
unsigned j = 0; j < nOps; ++j) {
6479 unsigned i = isBigEndian ? nOps-1-j : j;
6481 unsigned BitPos = j * EltBitSize;
6486 SplatValue |= CN->getAPIntValue().
zextOrTrunc(EltBitSize).
6487 zextOrTrunc(sz) << BitPos;
6489 SplatValue |= CN->getValueAPF().bitcastToAPInt().
zextOrTrunc(sz) <<BitPos;
6497 HasAnyUndefs = (SplatUndef != 0);
6500 unsigned HalfSize = sz / 2;
6507 if ((HighValue & ~LowUndef) != (LowValue & ~HighUndef) ||
6508 MinSplatBits > HalfSize)
6511 SplatValue = HighValue | LowValue;
6512 SplatUndef = HighUndef & LowUndef;
6527 assert(i != e &&
"VECTOR_SHUFFLE node with all undef indices!");
6531 for (
int Idx = Mask[i]; i != e; ++i)
6532 if (Mask[i] >= 0 && Mask[i] != Idx)
6538 static void checkForCyclesHelper(
const SDNode *N,
6542 if (Checked.
count(N))
6547 if (!Visited.
insert(N)) {
6548 dbgs() <<
"Offending node:\n";
6550 errs() <<
"Detected cycle in SelectionDAG\n";
6564 assert(N &&
"Checking nonexistent SDNode");
6567 checkForCyclesHelper(N, visited, checked);
void clearAllBits()
Set every bit to 0.
MVT getSimpleValueType() const
Return the simple ValueType of the referenced return value.
APInt LLVM_ATTRIBUTE_UNUSED_RESULT ashr(unsigned shiftAmt) const
Arithmetic right-shift function.
void AddPointer(const void *Ptr)
opStatus divide(const APFloat &, roundingMode)
void push_back(const T &Elt)
unsigned Log2_32_Ceil(uint32_t Value)
The memory access reads data.
SDValue getConstant(uint64_t Val, EVT VT, bool isTarget=false)
CallingConv::ID getLibcallCallingConv(RTLIB::Libcall Call) const
Get the CallingConv that should be used for the specified libcall.
SDValue getValue(unsigned R) const
virtual const TargetLowering * getTargetLowering() const
virtual SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, SDLoc dl, SDValue Chain, SDValue Op1, SDValue Op2, SDValue Op3, unsigned Align, bool isVolatile, MachinePointerInfo DstPtrInfo) const
static APInt getSignBit(unsigned BitWidth)
Get the SignBit for a specific bit width.
APInt LLVM_ATTRIBUTE_UNUSED_RESULT byteSwap() const
The memory access writes data.
const char * getSymbol() const
APInt LLVM_ATTRIBUTE_UNUSED_RESULT abs() const
Get the absolute value;.
bool isExactlyValue(double V) const
static SDValue getMemmoveLoadsAndStores(SelectionDAG &DAG, SDLoc dl, SDValue Chain, SDValue Dst, SDValue Src, uint64_t Size, unsigned Align, bool isVol, bool AlwaysInline, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
LLVMContext & getContext() const
static APInt getAllOnesValue(unsigned numBits)
Get the all-ones value.
LLVMContext * getContext() const
SDValue getTargetIndex(int Index, EVT VT, int64_t Offset=0, unsigned char TargetFlags=0)
unsigned getPointerPrefAlignment(unsigned AS=0) const
uint64_t getZExtValue() const
Get zero extended value.
SDValue UnrollVectorOp(SDNode *N, unsigned ResNE=0)
static SDValue getMemcpyLoadsAndStores(SelectionDAG &DAG, SDLoc dl, SDValue Chain, SDValue Dst, SDValue Src, uint64_t Size, unsigned Align, bool isVol, bool AlwaysInline, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
SDValue getIndexedLoad(SDValue OrigLoad, SDLoc dl, SDValue Base, SDValue Offset, ISD::MemIndexedMode AM)
void dump() const
dump - Dump this node, for debugging.
unsigned getMaxStoresPerMemcpy(bool OptSize) const
Get maximum # of store operations permitted for llvm.memcpy.
size_t size() const
size - Get the string size.
LegalizeTypeAction getTypeAction(LLVMContext &Context, EVT VT) const
bool isKnownNeverNaN(SDValue Op) const
isKnownNeverNan - Test whether the given SDValue is known to never be NaN.
static const fltSemantics IEEEdouble
bool hasNUsesOfValue(unsigned NUses, unsigned Value) const
SDVTList getVTList() const
SDValue getVAArg(EVT VT, SDLoc dl, SDValue Chain, SDValue Ptr, SDValue SV, unsigned Align)
enable_if_c<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
unsigned getBitWidth() const
getBitWidth - Return the bitwidth of this constant.
const TargetMachine & getTarget() const
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, unsigned f, uint64_t s, unsigned base_alignment, const MDNode *TBAAInfo=0, const MDNode *Ranges=0)
unsigned getPrefTypeAlignment(Type *Ty) const
static void commuteShuffle(SDValue &N1, SDValue &N2, SmallVectorImpl< int > &M)
friend struct DAGUpdateListener
DAGUpdateListener is a friend so it can manipulate the listener stack.
unsigned InferPtrAlignment(SDValue Ptr) const
std::pair< EVT, EVT > GetSplitDestVTs(const EVT &VT) const
CondCode getSetCCAndOperation(CondCode Op1, CondCode Op2, bool isInteger)
static APInt getLowBitsSet(unsigned numBits, unsigned loBitsSet)
Get a value with low bits set.
const GlobalValue * getGlobal() const
virtual void addSelectionDAGCSEId(FoldingSetNodeID &ID)=0
static PointerType * get(Type *ElementType, unsigned AddressSpace)
SDValue getBasicBlock(MachineBasicBlock *MBB)
Completely target-dependent object reference.
unsigned getOpcode() const
const TargetSelectionDAGInfo & getSelectionDAGInfo() const
bool getHasDebugValue() const
getHasDebugValue - get this bit.
StringRef substr(size_t Start, size_t N=npos) const
bool NewNodesMustHaveLegalTypes
void operator<(const Optional< T > &X, const Optional< U > &Y)
Poison comparison between two Optional objects. Clients needs to explicitly compare the underlying va...
Type * getTypeForEVT(LLVMContext &Context) const
iterator insert(iterator I, const T &Elt)
SDValue getZeroExtendInReg(SDValue Op, SDLoc DL, EVT SrcTy)
unsigned getRawSubclassData() const
static const fltSemantics & EVTToAPFloatSemantics(EVT VT)
unsigned getNumOperands() const
unsigned getNumOperands() const
unsigned getValueSizeInBits() const
void Deallocate(SubClass *E)
int64_t getOffset() const
MDNode - a tuple of other values.
const SDValue & getOperand(unsigned Num) const
const Function * getFunction() const
unsigned getPointerTypeSizeInBits(Type *Ty) const
unsigned getAddressSpace() const
Return the address space of the Pointer type.
static void AddNodeIDOperands(FoldingSetNodeID &ID, const SDValue *Ops, unsigned NumOps)
void setNodeId(int Id)
setNodeId - Set unique node id.
static bool isCommutativeBinOp(unsigned Opcode)
SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned char TargetFlags=0)
void ComputeMaskedBits(SDValue Op, APInt &KnownZero, APInt &KnownOne, unsigned Depth=0) const
const MachinePointerInfo & getPointerInfo() const
const SDValue & setRoot(SDValue N)
virtual unsigned ComputeNumSignBitsForTargetNode(SDValue Op, unsigned Depth=0) const
unsigned getNumSignBits() const
const SDValue & getValue() const
void DeleteNode(SDNode *N)
SDValue getConstantPool(const Constant *C, EVT VT, unsigned Align=0, int Offs=0, bool isT=false, unsigned char TargetFlags=0)
APInt LLVM_ATTRIBUTE_UNUSED_RESULT zextOrTrunc(unsigned width) const
Zero extend or truncate to width.
EntryToken - This is the marker used to indicate the start of a region.
virtual SDValue EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDLoc dl, SDValue Chain, SDValue Op1, SDValue Op2, SDValue Op3, unsigned Align, bool isVolatile, bool AlwaysInline, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const
void AddDbgValue(SDDbgValue *DB, SDNode *SD, bool isParameter)
unsigned getResNo() const
get the index which selects a specific result in the SDNode
void ReplaceAllUsesOfValuesWith(const SDValue *From, const SDValue *To, unsigned Num)
bool bitsLT(EVT VT) const
bitsLT - Return true if this has less bits than VT.
virtual void NodeUpdated(SDNode *N)
NodeUpdated - The node N that was updated.
void init(MachineFunction &mf, const TargetTransformInfo *TTI, const TargetLowering *TLI)
SDValue getExternalSymbol(const char *Sym, EVT VT)
static MachinePointerInfo getFixedStack(int FI, int64_t offset=0)
bool isKnownNeverZero(SDValue Op) const
bool isNegative() const
Determine sign of this APInt.
const DebugLoc getDebugLoc() const
getDebugLoc - Return the source location info.
SDValue getLoad(EVT VT, SDLoc dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, bool isVolatile, bool isNonTemporal, bool isInvariant, unsigned Alignment, const MDNode *TBAAInfo=0, const MDNode *Ranges=0)
APInt LLVM_ATTRIBUTE_UNUSED_RESULT rotl(unsigned rotateAmt) const
Rotate left by rotateAmt.
bool isVector() const
isVector - Return true if this is a vector value type.
EVT getShiftAmountTy(EVT LHSTy) const
void checkForCycles(const SDNode *N)
APInt LLVM_ATTRIBUTE_UNUSED_RESULT urem(const APInt &RHS) const
Unsigned remainder operation.
bool isUnknown() const
isUnknown - Return true if this is an unknown location.
bool isLittleEndian() const
SDValue getStore(SDValue Chain, SDLoc dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, bool isVolatile, bool isNonTemporal, unsigned Alignment, const MDNode *TBAAInfo=0)
SDNode * MorphNodeTo(SDNode *N, unsigned Opc, SDVTList VTs, const SDValue *Ops, unsigned NumOps)
int64_t getOffset() const
const APInt & getValue() const
Return the constant's value.
bool isThreadLocal() const
If the value is "Thread Local", its value isn't shared by the threads.
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val()
opStatus convertToInteger(integerPart *, unsigned int, bool, roundingMode, bool *) const
#define llvm_unreachable(msg)
bool isBuildVectorAllZeros(const SDNode *N)
EVT getValueType(unsigned ResNo) const
MachineFunction & getMachineFunction() const
bool isConsecutiveLoad(LoadSDNode *LD, LoadSDNode *Base, unsigned Bytes, int Dist) const
APInt LLVM_ATTRIBUTE_UNUSED_RESULT lshr(unsigned shiftAmt) const
Logical right-shift function.
bool isZEXTLoad(const SDNode *N)
void assign(unsigned NumElts, const T &Elt)
unsigned getAddressSpace() const
MachinePointerInfo getWithOffset(int64_t O) const
void AddInteger(signed I)
EVT getScalarType() const
Abstract Stack Frame Information.
bool isFixedObjectIndex(int ObjectIdx) const
allnodes_const_iterator allnodes_end() const
bool bitsGE(EVT VT) const
bitsGE - Return true if this has no less bits than VT.
SDNode * getNodeIfExists(unsigned Opcode, SDVTList VTs, const SDValue *Ops, unsigned NumOps)
int getMaskElt(unsigned Idx) const
SDVTList getVTList(EVT VT)
virtual MVT getPointerTy(uint32_t=0) const
enable_if_c< std::numeric_limits< T >::is_integer &&!std::numeric_limits< T >::is_signed, std::size_t >::type countLeadingZeros(T Val, ZeroBehavior ZB=ZB_Width)
Count number of 0's from the most significant bit to the least stopping at the first 1...
The memory access is volatile.
ID
LLVM Calling Convention Representation.
void copySign(const APFloat &)
bool isInteger() const
isInteger - Return true if this is an integer, or a vector integer type.
SDDbgValue * getDbgValue(MDNode *MDPtr, SDNode *N, unsigned R, uint64_t Off, DebugLoc DL, unsigned O)
bool getBoolValue() const
Convert APInt to a boolean value.
SDValue getConstantFP(double Val, EVT VT, bool isTarget=false)
EVT getVectorElementType() const
unsigned AssignTopologicalOrder()
static void VerifySDNode(SDNode *N)
VerifySDNode - Sanity check the given SDNode. Aborts if it is invalid.
void computeMaskedBitsLoad(const MDNode &Ranges, APInt &KnownZero)
SDValue getAtomic(unsigned Opcode, SDLoc dl, EVT MemVT, SDValue Chain, SDValue Ptr, SDValue Cmp, SDValue Swp, MachinePointerInfo PtrInfo, unsigned Alignment, AtomicOrdering Ordering, SynchronizationScope SynchScope)
unsigned getIROrder() const
bool count(PtrType Ptr) const
count - Return true if the specified pointer is in the set.
std::pair< SDValue, SDValue > LowerCallTo(CallLoweringInfo &CLI) const
size_t array_lengthof(T(&)[N])
Find the length of an array.
unsigned getNumValues() const
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
SDValue getRegisterMask(const uint32_t *RegMask)
DAGUpdateListener *const Next
Simple integer binary arithmetic operators.
SDValue getVectorShuffle(EVT VT, SDLoc dl, SDValue N1, SDValue N2, const int *MaskElts)
bool sgt(const APInt &RHS) const
Signed greather than comparison.
MachineConstantPoolValue * getMachineCPVal() const
SDValue getUNDEF(EVT VT)
getUNDEF - Return an UNDEF node. UNDEF does not have a useful SDLoc.
const APInt & getAPIntValue() const
EVT getMemoryVT() const
getMemoryVT - Return the type of the in-memory value.
SDValue getAnyExtOrTrunc(SDValue Op, SDLoc DL, EVT VT)
void setIROrder(unsigned Order)
static unsigned encodeMemSDNodeFlags(int ConvType, ISD::MemIndexedMode AM, bool isVolatile, bool isNonTemporal, bool isInvariant)
size_t size() const
size - Get the array size.
virtual MVT getVectorIdxTy() const
bool bitsLE(EVT VT) const
bitsLE - Return true if this has no more bits than VT.
unsigned char getTargetFlags() const
void ComputeMaskedBits(Value *V, APInt &KnownZero, APInt &KnownOne, const DataLayout *TD=0, unsigned Depth=0)
bool ult(const APInt &RHS) const
Unsigned less than comparison.
UNDEF - An undefined node.
SDValue getAddrSpaceCast(SDLoc dl, EVT VT, SDValue Ptr, unsigned SrcAS, unsigned DestAS)
getAddrSpaceCast - Return an AddrSpaceCastSDNode.
static void AddNodeIDValueTypes(FoldingSetNodeID &ID, SDVTList VTList)
opStatus mod(const APFloat &, roundingMode)
C fmod, or llvm frem.
opStatus convertFromAPInt(const APInt &, bool, roundingMode)
The memory access is non-temporal.
bool isConstantSplat(APInt &SplatValue, APInt &SplatUndef, unsigned &SplatBitSize, bool &HasAnyUndefs, unsigned MinSplatBits=0, bool isBigEndian=false)
static APInt getHighBitsSet(unsigned numBits, unsigned hiBitsSet)
Get a value with high bits set.
SDNode * getNode() const
get the SDNode which holds the desired result
A self-contained host- and target-independent arbitrary-precision floating-point software implementat...
bool hasPredecessor(const SDNode *N) const
unsigned getStoreSize() const
SDValue getMDNode(const MDNode *MD)
getMDNode - Return an MDNodeSDNode which holds an MDNode.
void dumprFull(const SelectionDAG *G=0) const
bool isTypeLegal(EVT VT) const
unsigned getStoreSizeInBits() const
bool isInteger() const
isInteger - Return true if this is an integer, or a vector integer type.
bool isZero() const
isZero - Return true if the value is positive or negative zero.
bool intersects(const APInt &RHS) const
AddrSpaceCastSDNode(unsigned Order, DebugLoc dl, EVT VT, SDValue X, unsigned SrcAS, unsigned DestAS)
APInt LLVM_ATTRIBUTE_UNUSED_RESULT trunc(unsigned width) const
Truncate to new width.
bool isMachineConstantPoolEntry() const
virtual bool needsStackRealignment(const MachineFunction &MF) const
const SDValue & getOperand(unsigned i) const
void setDebugLoc(const DebugLoc dl)
Simple binary floating point operators.
bool isNonTemporal() const
static SDValue getMemsetStores(SelectionDAG &DAG, SDLoc dl, SDValue Chain, SDValue Dst, SDValue Src, uint64_t Size, unsigned Align, bool isVol, MachinePointerInfo DstPtrInfo)
Lower the call to 'memset' intrinsic function into a series of store operations.
bool isOperationLegalOrCustom(unsigned Op, EVT VT) const
static bool doNotCSE(SDNode *N)
doNotCSE - Return true if CSE should not be performed for this node.
bool sge(const APInt &RHS) const
Signed greather or equal comparison.
virtual EVT getOptimalMemOpType(uint64_t, unsigned, unsigned, bool, bool, bool, MachineFunction &) const
LLVM Constant Representation.
static ManagedStatic< sys::SmartRWMutex< true > > Lock
const Constant * getConstVal() const
virtual bool isSafeMemOpType(MVT) const
const unsigned int integerPartWidth
opStatus fusedMultiplyAdd(const APFloat &, const APFloat &, roundingMode)
unsigned getMaxStoresPerMemmove(bool OptSize) const
Get maximum # of store operations permitted for llvm.memmove.
static SDValue getMemsetStringVal(EVT VT, SDLoc dl, SelectionDAG &DAG, const TargetLowering &TLI, StringRef Str)
bool sle(const APInt &RHS) const
Signed less or equal comparison.
virtual bool isTruncateFree(Type *, Type *) const
static Type * getVoidTy(LLVMContext &C)
SDValue getSExtOrTrunc(SDValue Op, SDLoc DL, EVT VT)
const DataLayout * getDataLayout() const
ArrayRef< SDDbgValue * > GetDbgValues(const SDNode *SD)
GetDbgValues - Get the debug values which reference the given SDNode.
static ManagedStatic< std::set< EVT, EVT::compareRawBits > > EVTs
unsigned getBitWidth() const
Return the number of bits in the APInt.
opStatus convert(const fltSemantics &, roundingMode, bool *)
bool uge(const APInt &RHS) const
Unsigned greater or equal comparison.
unsigned getOpcode() const
void InitOperands(SDUse *Ops, const SDValue &Op0)
InitOperands - Initialize the operands list of this with 1 operand.
APInt LLVM_ATTRIBUTE_UNUSED_RESULT sdiv(const APInt &RHS) const
Signed division function for APInt.
virtual void computeMaskedBitsForTargetNode(const SDValue Op, APInt &KnownZero, APInt &KnownOne, const SelectionDAG &DAG, unsigned Depth=0) const
unsigned char getTargetFlags() const
void RemoveDeadNode(SDNode *N)
CondCode getSetCCSwappedOperands(CondCode Operation)
unsigned countPopulation() const
Count the number of bits set.
ilist< SDNode >::size_type allnodes_size() const
use_iterator use_begin() const
MemSDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs, EVT MemoryVT, MachineMemOperand *MMO)
const SDValue & getValue() const
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
static bool isValueValidForType(EVT VT, const APFloat &Val)
Bit counting operators with an undefined result for zero inputs.
bool MaskedValueIsZero(SDValue Op, const APInt &Mask, unsigned Depth=0) const
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
static ManagedStatic< sys::SmartMutex< true > > VTMutex
void append(in_iter in_start, in_iter in_end)
ArrayRef< SDDbgValue * > getSDDbgValues(const SDNode *Node)
std::vector< ArgListEntry > ArgListTy
const APFloat & getValueAPF() const
SDValue getGlobalAddress(const GlobalValue *GV, SDLoc DL, EVT VT, int64_t offset=0, bool isTargetGA=false, unsigned char TargetFlags=0)
bool isEqualTo(SDValue A, SDValue B) const
static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements)
uint64_t getConstantOperandVal(unsigned Num) const
bool isPowerOf2() const
Check if this APInt's value is a power of two greater than zero.
HANDLENODE node - Used as a handle for various purposes.
APInt LLVM_ATTRIBUTE_UNUSED_RESULT rotr(unsigned rotateAmt) const
Rotate right by rotateAmt.
const SDValue & getRoot() const
const BlockAddress * getBlockAddress() const
SDValue CreateStackTemporary(EVT VT, unsigned minAlign=1)
The memory access is invariant.
APInt LLVM_ATTRIBUTE_UNUSED_RESULT srem(const APInt &RHS) const
Function for signed remainder operation.
const MachinePointerInfo & getPointerInfo() const
int64_t getObjectOffset(int ObjectIdx) const
MachineMemOperand * MMO
MMO - Memory reference information.
SDValue getMemcpy(SDValue Chain, SDLoc dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool AlwaysInline, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
const MDNode * getRanges() const
Returns the Ranges that describes the dereference.
static const char *const Magic
const SDValue & getOffset() const
bool bitsGT(EVT VT) const
bitsGT - Return true if this has more bits than VT.
bool ugt(const APInt &RHS) const
Unsigned greather than comparison.
SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet.
unsigned countTrailingZeros() const
Count the number of trailing zero bits.
IntegerType * getIntPtrType(LLVMContext &C, unsigned AddressSpace=0) const
unsigned getABITypeAlignment(Type *Ty) const
bool isBuildVectorAllOnes(const SDNode *N)
Node predicates.
SDValue getConvertRndSat(EVT VT, SDLoc dl, SDValue Val, SDValue DTy, SDValue STy, SDValue Rnd, SDValue Sat, ISD::CvtCode Code)
SDValue getNOT(SDLoc DL, SDValue Val, EVT VT)
getNOT - Create a bitwise NOT operation as (XOR Val, -1).
static bool isMemSrcFromString(SDValue Src, StringRef &Str)
Class for constant integers.
int64_t SignExtend64(uint64_t x)
allnodes_const_iterator allnodes_begin() const
virtual void NodeDeleted(SDNode *N, SDNode *E)
bool slt(const APInt &RHS) const
Signed less than comparison.
bool isBaseWithConstantOffset(SDValue Op) const
const char * getLibcallName(RTLIB::Libcall Call) const
Get the libcall routine name for the specified libcall.
opStatus add(const APFloat &, roundingMode)
std::pair< SDValue, SDValue > SplitVector(const SDValue &N, const SDLoc &DL, const EVT &LoVT, const EVT &HiVT)
BooleanContent getBooleanContents(bool isVec) const
SDNode * UpdateNodeOperands(SDNode *N, SDValue Op)
const TargetTransformInfo * getTargetTransformInfo() const
SDValue getTargetInsertSubreg(int SRIdx, SDLoc DL, EVT VT, SDValue Operand, SDValue Subreg)
SDNode * SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT)
unsigned getObjectAlignment(int ObjectIdx) const
getObjectAlignment - Return the alignment of the specified stack object.
SDValue getExtLoad(ISD::LoadExtType ExtType, SDLoc dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, bool isVolatile, bool isNonTemporal, unsigned Alignment, const MDNode *TBAAInfo=0)
static void VerifyNodeCommon(SDNode *N)
VerifyNodeCommon - Sanity check the given node. Aborts if it is invalid.
bool allOperandsUndef(const SDNode *N)
opStatus multiply(const APFloat &, roundingMode)
SDValue getIntPtrConstant(uint64_t Val, bool isTarget=false)
const SDValue & getChain() const
Byte Swap and Counting operators.
SDValue getMemmove(SDValue Chain, SDLoc dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
MachineMemOperand * getMemOperand() const
Abstact virtual class for operations for memory operations.
unsigned char getTargetFlags() const
bool isOperandOf(SDNode *N) const
unsigned getAddrSpace() const
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
virtual bool isGAPlusOffset(SDNode *N, const GlobalValue *&GA, int64_t &Offset) const
static const int FIRST_TARGET_MEMORY_OPCODE
MachineFrameInfo * getFrameInfo()
static Constant * get(Type *Ty, double V)
CondCode getSetCCInverse(CondCode Operation, bool isInteger)
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
unsigned Log2_32(uint32_t Value)
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
AttributeSet getAttributes() const
Return the attribute list for this Function.
static APInt getSplat(unsigned NewLen, const APInt &V)
Return a value containing V broadcasted over NewLen bits.
ISD::LoadExtType getExtensionType() const
Class for arbitrary precision integers.
SDValue getMemIntrinsicNode(unsigned Opcode, SDLoc dl, const EVT *VTs, unsigned NumVTs, const SDValue *Ops, unsigned NumOps, EVT MemVT, MachinePointerInfo PtrInfo, unsigned Align=0, bool Vol=false, bool ReadMem=true, bool WriteMem=true)
void * Allocate(size_t Size, size_t Alignment)
bool exceedsNaturalStackAlignment(unsigned Align) const
Returns true if the given alignment exceeds the natural stack alignment.
op_iterator op_begin() const
static use_iterator use_end()
ZERO_EXTEND - Used for integer types, zeroing the new bits.
APInt bitcastToAPInt() const
SDValue getNode(unsigned Opcode, SDLoc DL, EVT VT)
ANY_EXTEND - Used for integer types. The high bits are undefined.
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(DefaultAlign), cl::values(clEnumValN(DefaultAlign,"arm-default-align","Generate unaligned accesses only on hardware/OS ""combinations that are known to support them"), clEnumValN(StrictAlign,"arm-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"arm-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
CondCode getSetCCOrOperation(CondCode Op1, CondCode Op2, bool isInteger)
static bool FindOptimalMemOpLowering(std::vector< EVT > &MemOps, unsigned Limit, uint64_t Size, unsigned DstAlign, unsigned SrcAlign, bool IsMemset, bool ZeroMemset, bool MemcpyStrSrc, bool AllowOverlap, SelectionDAG &DAG, const TargetLowering &TLI)
SDValue getShiftAmountOperand(EVT LHSTy, SDValue Op)
SDValue getBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, bool isTarget=false, unsigned char TargetFlags=0)
static APInt getBitsSet(unsigned numBits, unsigned loBit, unsigned hiBit)
Get a value with a block of bits set.
bool isNonTemporal() const
int64_t getOffset() const
unsigned char getTargetFlags() const
static SDValue getMemBasePlusOffset(SDValue Base, unsigned Offset, SDLoc dl, SelectionDAG &DAG)
uint64_t MinAlign(uint64_t A, uint64_t B)
static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG, SDLoc dl)
unsigned countLeadingOnes() const
Count the number of leading one bits.
int CreateStackObject(uint64_t Size, unsigned Alignment, bool isSS, bool MayNeedSP=false, const AllocaInst *Alloca=0)
SDValue getStackArgumentTokenFactor(SDValue Chain)
bool isScalarToVector(const SDNode *N)
PointerType * getType() const
getType - Global values are always pointers.
uint64_t getConstantOperandVal(unsigned i) const
static const fltSemantics IEEEsingle
Bitwise operators - logical and, logical or, logical xor.
bool hasAnyUseOfValue(unsigned Value) const
pointer data()
data - Return a pointer to the vector's buffer, even if empty().
APInt LLVM_ATTRIBUTE_UNUSED_RESULT udiv(const APInt &RHS) const
Unsigned division operation.
static IntegerType * getInt32Ty(LLVMContext &C)
static MachinePointerInfo InferPointerInfo(SDValue Ptr, int64_t Offset=0)
opStatus roundToIntegral(roundingMode)
SDValue FoldConstantArithmetic(unsigned Opcode, EVT VT, SDNode *Cst1, SDNode *Cst2)
FoldConstantArithmetic -.
unsigned getMaxStoresPerMemset(bool OptSize) const
Get maximum # of store operations permitted for llvm.memset.
unsigned getSizeInBits() const
getSizeInBits - Return the size of the specified value type in bits.
void ReplaceAllUsesWith(SDValue From, SDValue Op)
SDValue getIndexedStore(SDValue OrigStoe, SDLoc dl, SDValue Base, SDValue Offset, ISD::MemIndexedMode AM)
void Profile(FoldingSetNodeID &ID) const
static void AddNodeIDNode(FoldingSetNodeID &ID, unsigned short OpC, SDVTList VTList, const SDValue *OpList, unsigned N)
SDValue getTruncStore(SDValue Chain, SDLoc dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, EVT TVT, bool isNonTemporal, bool isVolatile, unsigned Alignment, const MDNode *TBAAInfo=0)
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
op_iterator op_end() const
const TargetMachine & getTarget() const
const SDValue & getOffset() const
unsigned countTrailingOnes() const
Count the number of trailing one bits.
intptr_t getRawBits() const
MachineSDNode * getMachineNode(unsigned Opcode, SDLoc dl, EVT VT)
virtual const TargetRegisterInfo * getRegisterInfo() const
bool reachesChainWithoutSideEffects(SDValue Dest, unsigned Depth=2) const
SDValue getMemset(SDValue Chain, SDLoc dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, MachinePointerInfo DstPtrInfo)
SDValue FoldSetCC(EVT VT, SDValue N1, SDValue N2, ISD::CondCode Cond, SDLoc dl)
FoldSetCC - Constant fold a setcc to true or false.
static int isSignedOp(ISD::CondCode Opcode)
SDValue getCondCode(ISD::CondCode Cond)
SDNode * getNode() const
getNode - Convenience function for get().getNode().
bool getConstantStringInfo(const Value *V, StringRef &Str, uint64_t Offset=0, bool TrimAtNul=true)
bool isFloatingPoint() const
isFloatingPoint - Return true if this is a FP, or a vector FP type.
bool hasPredecessorHelper(const SDNode *N, SmallPtrSet< const SDNode *, 32 > &Visited, SmallVectorImpl< const SDNode * > &Worklist) const
SDValue getJumpTable(int JTI, EVT VT, bool isTarget=false, unsigned char TargetFlags=0)
SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
unsigned getAlignment() const
virtual bool allowsUnalignedMemoryAccesses(EVT, bool *=0) const
Determine if the target supports unaligned memory accesses.
SDValue getTargetExtractSubreg(int SRIdx, SDLoc DL, EVT VT, SDValue Operand)
SDValue getZExtOrTrunc(SDValue Op, SDLoc DL, EVT VT)
EVT getTypeToTransformTo(LLVMContext &Context, EVT VT) const
LLVM Value Representation.
SDValue getRegister(unsigned Reg, EVT VT)
APInt LLVM_ATTRIBUTE_UNUSED_RESULT sextOrTrunc(unsigned width) const
Sign extend or truncate to width.
SDValue getEHLabel(SDLoc dl, SDValue Root, MCSymbol *Label)
bool isTruncatingStore() const
SDValue getValueType(EVT)
void setHasDebugValue(bool b)
setHasDebugValue - set this bit.
unsigned ComputeNumSignBits(SDValue Op, unsigned Depth=0) const
uint64_t getSize() const
getSize - Return the size in bytes of the memory reference.
const TargetLowering & getTargetLoweringInfo() const
void ReplaceAllUsesOfValueWith(SDValue From, SDValue To)
unsigned countLeadingZeros() const
The APInt version of the countLeadingZeros functions in MathExtras.h.
void add(SDDbgValue *V, const SDNode *Node, bool isParameter)
FoldingSetNodeIDRef Intern(BumpPtrAllocator &Allocator) const
SDValue getSrcValue(const Value *v)
getSrcValue - Construct a node to track a Value* through the backend.
APInt LLVM_ATTRIBUTE_UNUSED_RESULT zext(unsigned width) const
Zero extend to a new width.
SDValue getMergeValues(const SDValue *Ops, unsigned NumOps, SDLoc dl)
getMergeValues - Create a MERGE_VALUES node from the given operands.
SDValue getTargetConstant(uint64_t Val, EVT VT)
SDValue getSetCC(SDLoc DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond)
static void VerifyMachineNode(SDNode *N)
BooleanContent
Enum that describes how the target represents true/false values.
static void AddNodeIDOpcode(FoldingSetNodeID &ID, unsigned OpC)
static APInt getNullValue(unsigned numBits)
Get the '0' value.
static ManagedStatic< EVTArray > SimpleVTArray
SDValue getEntryNode() const
bool SignBitIsZero(SDValue Op, unsigned Depth=0) const
cmpResult
IEEE-754R 5.11: Floating Point Comparison Relations.
TRUNCATE - Completely drop the high bits.
bool isTargetMemoryOpcode() const
unsigned getAlignment() const
void TransferDbgValues(SDValue From, SDValue To)
TransferDbgValues - Transfer SDDbgValues.
virtual SDValue EmitTargetCodeForMemmove(SelectionDAG &DAG, SDLoc dl, SDValue Chain, SDValue Op1, SDValue Op2, SDValue Op3, unsigned Align, bool isVolatile, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const
bool isCondCodeLegal(ISD::CondCode CC, MVT VT) const
Return true if the specified condition code is legal on this target.
void setObjectAlignment(int ObjectIdx, unsigned Align)
setObjectAlignment - Change the alignment of the specified stack object.
bool ule(const APInt &RHS) const
Unsigned less or equal comparison.
static void AddNodeIDCustom(FoldingSetNodeID &ID, const SDNode *N)
static IntegerType * getInt8Ty(LLVMContext &C)
opStatus subtract(const APFloat &, roundingMode)
static RegisterPass< NVPTXAllocaHoisting > X("alloca-hoisting","Hoisting alloca instructions in non-entry ""blocks to the entry block")
bool isOperandOf(SDNode *N) const
int64_t getObjectSize(int ObjectIdx) const
static bool isSplatMask(const int *Mask, EVT VT)
bool isOnlyUserOf(SDNode *N) const
INITIALIZE_PASS(GlobalMerge,"global-merge","Global Merge", false, false) bool GlobalMerge const DataLayout * TD
unsigned getResNo() const
getResNo - Convenience function for get().getResNo().
bool isMachineOpcode() const
unsigned char getTargetFlags() const
bool empty() const
empty - Check if the string is empty.
uint64_t getZExtValue() const
static SDVTList makeVTList(const EVT *VTs, unsigned NumVTs)
unsigned getVectorNumElements() const