43 void Constant::anchor() { }
47 if (
const ConstantFP *CFP = dyn_cast<ConstantFP>(
this))
48 return CFP->isZero() && CFP->isNegative();
52 if (
ConstantFP *SplatCFP = dyn_cast_or_null<ConstantFP>(CV->getSplatValue()))
53 if (SplatCFP && SplatCFP->isZero() && SplatCFP->isNegative())
68 if (
const ConstantFP *CFP = dyn_cast<ConstantFP>(
this))
77 if (
const ConstantInt *CI = dyn_cast<ConstantInt>(
this))
81 if (
const ConstantFP *CFP = dyn_cast<ConstantFP>(
this))
82 return CFP->isZero() && !CFP->isNegative();
85 return isa<ConstantAggregateZero>(
this) || isa<ConstantPointerNull>(
this);
90 if (
const ConstantInt *CI = dyn_cast<ConstantInt>(
this))
91 return CI->isMinusOne();
94 if (
const ConstantFP *CFP = dyn_cast<ConstantFP>(
this))
95 return CFP->getValueAPF().bitcastToAPInt().isAllOnesValue();
100 return Splat->isAllOnesValue();
105 return Splat->isAllOnesValue();
153 if (
PointerType *PTy = dyn_cast<PointerType>(ScalarTy))
157 if (
VectorType *VTy = dyn_cast<VectorType>(Ty))
185 return Elt < CS->getNumOperands() ? CS->getOperand(Elt) : 0;
188 return Elt < CA->getNumOperands() ? CA->getOperand(Elt) : 0;
191 return Elt < CV->getNumOperands() ? CV->getOperand(Elt) : 0;
194 return CAZ->getElementValue(Elt);
196 if (
const UndefValue *UV = dyn_cast<UndefValue>(
this))
197 return UV->getElementValue(Elt);
200 return Elt < CDS->getNumElements() ? CDS->getElementAsConstant(Elt) : 0;
205 assert(isa<IntegerType>(Elt->
getType()) &&
"Index must be an integer");
222 #ifndef NDEBUG // Only in -g mode...
223 if (!isa<Constant>(V)) {
224 dbgs() <<
"While deleting: " << *
this
225 <<
"\n\nUse still stuck around after Def is destroyed: "
229 assert(isa<Constant>(V) &&
"References remain to Constant being destroyed");
250 if (
ConstantExpr *Op = dyn_cast<ConstantExpr>(CE->getOperand(i))) {
257 switch (CE->getOpcode()) {
260 case Instruction::UDiv:
261 case Instruction::SDiv:
262 case Instruction::FDiv:
263 case Instruction::URem:
264 case Instruction::SRem:
265 case Instruction::FRem:
267 if (!isa<ConstantInt>(CE->getOperand(1)) ||CE->getOperand(1)->isNullValue())
287 while (!WorkList.
empty()) {
291 if (GV->isThreadLocal())
312 if (UC == 0 || isa<GlobalValue>(UC))
338 if (
const GlobalValue *GV = dyn_cast<GlobalValue>(
this)) {
339 if (GV->hasLocalLinkage() || GV->hasHiddenVisibility())
344 if (
const BlockAddress *BA = dyn_cast<BlockAddress>(
this))
345 return BA->getFunction()->getRelocationInfo();
351 if (
const ConstantExpr *CE = dyn_cast<ConstantExpr>(
this))
352 if (CE->getOpcode() == Instruction::Sub) {
356 LHS->
getOpcode() == Instruction::PtrToInt &&
357 RHS->getOpcode() == Instruction::PtrToInt &&
359 isa<BlockAddress>(RHS->getOperand(0)) &&
360 cast<BlockAddress>(LHS->
getOperand(0))->getFunction() ==
361 cast<BlockAddress>(RHS->getOperand(0))->getFunction())
367 Result = std::max(Result,
377 if (isa<GlobalValue>(C))
return false;
381 if (!User)
return false;
386 const_cast<Constant*
>(
C)->destroyConstant();
415 if (LastNonDeadUser == E) {
431 void ConstantInt::anchor() { }
434 :
Constant(Ty, ConstantIntVal, 0, 0), Val(V) {
455 assert(Ty->
isIntegerTy(1) &&
"True must be i1 or vector of i1.");
459 "True must be vector of i1 or i1.");
467 assert(Ty->
isIntegerTy(1) &&
"False must be i1 or vector of i1.");
471 "False must be vector of i1 or i1.");
496 if (
VectorType *VTy = dyn_cast<VectorType>(Ty))
508 return get(Ty, V,
true);
512 return get(Ty, V,
true);
518 "ConstantInt type doesn't match the type implied by its value!");
521 if (
VectorType *VTy = dyn_cast<VectorType>(Ty))
552 void ConstantFP::anchor() { }
567 if (
VectorType *VTy = dyn_cast<VectorType>(Ty))
581 if (
VectorType *VTy = dyn_cast<VectorType>(Ty))
592 return get(Context, apf);
600 if (
VectorType *VTy = dyn_cast<VectorType>(Ty))
629 "Unknown FP format");
645 :
Constant(Ty, ConstantFPVal, 0, 0), Val(V) {
673 if (isa<SequentialType>(
getType()))
681 if (isa<SequentialType>(
getType()))
706 if (isa<SequentialType>(
getType()))
714 if (isa<SequentialType>(
getType()))
725 template <
typename ItTy,
typename EltTy>
727 for (; Start != End; ++Start)
738 "Invalid initializer vector for constant array");
739 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
741 "Initializer for array element doesn't match array element type!");
750 for (
unsigned i = 0, e = V.
size(); i != e; ++i) {
752 "Wrong type in array element initializer");
773 if (CI->getType()->isIntegerTy(8)) {
775 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
782 }
else if (CI->getType()->isIntegerTy(16)) {
784 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
791 }
else if (CI->getType()->isIntegerTy(32)) {
793 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
800 }
else if (CI->getType()->isIntegerTy(64)) {
802 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
812 if (
ConstantFP *CFP = dyn_cast<ConstantFP>(C)) {
813 if (CFP->getType()->isFloatTy()) {
815 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
816 if (
ConstantFP *CFP = dyn_cast<ConstantFP>(V[i]))
817 Elts.
push_back(CFP->getValueAPF().convertToFloat());
822 }
else if (CFP->getType()->isDoubleTy()) {
824 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
825 if (
ConstantFP *CFP = dyn_cast<ConstantFP>(V[i]))
826 Elts.
push_back(CFP->getValueAPF().convertToDouble());
844 unsigned VecSize = V.
size();
846 for (
unsigned i = 0; i != VecSize; ++i)
856 "ConstantStruct::getTypeForElements cannot be called on empty list");
866 "Invalid initializer vector for constant structure");
867 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
869 "Initializer for struct element doesn't match struct element type!");
876 "Incorrect # elements specified to ConstantStruct::get");
880 bool isUndef =
false;
883 isUndef = isa<UndefValue>(V[0]);
884 isZero = V[0]->isNullValue();
885 if (isUndef || isZero) {
886 for (
unsigned i = 0, e = V.
size(); i != e; ++i) {
889 if (!isa<UndefValue>(V[i]))
909 return get(
T, Values);
916 for (
size_t i = 0, e = V.
size(); i != e; i++)
918 "Initializer for vector element doesn't match vector element type!");
924 assert(!V.
empty() &&
"Vectors can't be empty");
932 bool isUndef = isa<UndefValue>(
C);
934 if (isZero || isUndef) {
935 for (
unsigned i = 1, e = V.
size(); i != e; ++i)
937 isZero = isUndef =
false;
954 if (CI->getType()->isIntegerTy(8)) {
956 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
963 }
else if (CI->getType()->isIntegerTy(16)) {
965 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
972 }
else if (CI->getType()->isIntegerTy(32)) {
974 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
981 }
else if (CI->getType()->isIntegerTy(64)) {
983 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
993 if (
ConstantFP *CFP = dyn_cast<ConstantFP>(C)) {
994 if (CFP->getType()->isFloatTy()) {
996 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
997 if (
ConstantFP *CFP = dyn_cast<ConstantFP>(V[i]))
998 Elts.
push_back(CFP->getValueAPF().convertToFloat());
1003 }
else if (CFP->getType()->isDoubleTy()) {
1005 for (
unsigned i = 0, e = V.
size(); i != e; ++i)
1006 if (
ConstantFP *CFP = dyn_cast<ConstantFP>(V[i]))
1007 Elts.
push_back(CFP->getValueAPF().convertToDouble());
1018 return pImpl->VectorConstants.getOrCreate(T, V);
1024 if ((isa<ConstantFP>(V) || isa<ConstantInt>(V)) &&
1045 if (
getOpcode() != Instruction::GetElementPtr)
return false;
1056 for (; GEPI != E; ++GEPI, ++OI) {
1058 if (!CI)
return false;
1059 if (
ArrayType *ATy = dyn_cast<ArrayType>(*GEPI))
1070 return getOpcode() == Instruction::ExtractValue ||
1071 getOpcode() == Instruction::InsertValue;
1076 dyn_cast<ExtractValueConstantExpr>(
this))
1077 return EVCE->Indices;
1079 return cast<InsertValueConstantExpr>(
this)->Indices;
1092 "Replacing operand with value of different type!");
1094 return const_cast<ConstantExpr*>(
this);
1109 bool AnyChange = Ty !=
getType();
1110 for (
unsigned i = 0; i != Ops.
size(); ++i)
1117 case Instruction::Trunc:
1118 case Instruction::ZExt:
1119 case Instruction::SExt:
1120 case Instruction::FPTrunc:
1121 case Instruction::FPExt:
1122 case Instruction::UIToFP:
1123 case Instruction::SIToFP:
1124 case Instruction::FPToUI:
1125 case Instruction::FPToSI:
1126 case Instruction::PtrToInt:
1127 case Instruction::IntToPtr:
1128 case Instruction::BitCast:
1129 case Instruction::AddrSpaceCast:
1133 case Instruction::InsertElement:
1137 case Instruction::InsertValue:
1139 case Instruction::ExtractValue:
1141 case Instruction::ShuffleVector:
1143 case Instruction::GetElementPtr:
1145 cast<GEPOperator>(
this)->isInBounds());
1146 case Instruction::ICmp:
1147 case Instruction::FCmp:
1162 return Val == 0 || Val == 1;
1165 uint64_t Max = (1ll << NumBits) - 1;
1172 return Val == 0 || Val == 1 || Val == -1;
1175 int64_t Min = -(1ll << (NumBits-1));
1176 int64_t Max = (1ll << (NumBits-1)) - 1;
1177 return (Val >= Min && Val <= Max);
1233 "Cannot create an aggregate zero of non-aggregate type!");
1277 assert(this->
getType()->isVectorTy() &&
"Only valid for vectors!");
1278 if (isa<ConstantAggregateZero>(
this))
1281 return CV->getSplatValue();
1283 return CV->getSplatValue();
1302 if (
const ConstantInt *CI = dyn_cast<ConstantInt>(
this))
1303 return CI->getValue();
1304 assert(this->
getSplatValue() &&
"Doesn't contain a unique integer!");
1306 assert(C && isa<ConstantInt>(C) &&
"Not a vector of numbers!");
1307 return cast<ConstantInt>(
C)->getValue();
1354 assert(BB->
getParent() != 0 &&
"Block must have a parent");
1364 assert(BA->
getFunction() == F &&
"Basic block moved between functions");
1373 BB->AdjustBlockAddressRefCount(1);
1395 NewBB = cast<BasicBlock>(To);
1416 assert(NewBA !=
this &&
"I didn't contain From!");
1447 assert(C && Ty &&
"Null arguments to getCast");
1453 case Instruction::Trunc:
return getTrunc(C, Ty);
1454 case Instruction::ZExt:
return getZExt(C, Ty);
1455 case Instruction::SExt:
return getSExt(C, Ty);
1456 case Instruction::FPTrunc:
return getFPTrunc(C, Ty);
1457 case Instruction::FPExt:
return getFPExtend(C, Ty);
1458 case Instruction::UIToFP:
return getUIToFP(C, Ty);
1459 case Instruction::SIToFP:
return getSIToFP(C, Ty);
1460 case Instruction::FPToUI:
return getFPToUI(C, Ty);
1461 case Instruction::FPToSI:
return getFPToSI(C, Ty);
1462 case Instruction::PtrToInt:
return getPtrToInt(C, Ty);
1463 case Instruction::IntToPtr:
return getIntToPtr(C, Ty);
1464 case Instruction::BitCast:
return getBitCast(C, Ty);
1509 (SrcBits == DstBits ? Instruction::BitCast :
1510 (SrcBits > DstBits ? Instruction::Trunc :
1511 (isSigned ? Instruction::SExt : Instruction::ZExt)));
1512 return getCast(opcode, C, Ty);
1520 if (SrcBits == DstBits)
1523 (SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt);
1524 return getCast(opcode, C, Ty);
1532 assert((fromVec == toVec) &&
"Cannot convert from scalar to/from vector");
1536 "SrcTy must be larger than DestTy for Trunc!");
1546 assert((fromVec == toVec) &&
"Cannot convert from scalar to/from vector");
1550 "SrcTy must be smaller than DestTy for SExt!");
1560 assert((fromVec == toVec) &&
"Cannot convert from scalar to/from vector");
1564 "SrcTy must be smaller than DestTy for ZExt!");
1574 assert((fromVec == toVec) &&
"Cannot convert from scalar to/from vector");
1577 "This is an illegal floating point truncation!");
1586 assert((fromVec == toVec) &&
"Cannot convert from scalar to/from vector");
1589 "This is an illegal floating point extension!");
1598 assert((fromVec == toVec) &&
"Cannot convert from scalar to/from vector");
1600 "This is an illegal uint to floating point cast!");
1609 assert((fromVec == toVec) &&
"Cannot convert from scalar to/from vector");
1611 "This is an illegal sint to floating point cast!");
1620 assert((fromVec == toVec) &&
"Cannot convert from scalar to/from vector");
1622 "This is an illegal floating point to uint cast!");
1631 assert((fromVec == toVec) &&
"Cannot convert from scalar to/from vector");
1633 "This is an illegal floating point to sint cast!");
1639 "PtrToInt source must be pointer or pointer vector");
1641 "PtrToInt destination must be integer or integer vector");
1642 assert(isa<VectorType>(C->
getType()) == isa<VectorType>(DstTy));
1643 if (isa<VectorType>(C->
getType()))
1645 "Invalid cast between a different number of vector elements");
1651 "IntToPtr source must be integer or integer vector");
1653 "IntToPtr destination must be a pointer or pointer vector");
1654 assert(isa<VectorType>(C->
getType()) == isa<VectorType>(DstTy));
1655 if (isa<VectorType>(C->
getType()))
1657 "Invalid cast between a different number of vector elements");
1663 "Invalid constantexpr bitcast!");
1667 if (C->
getType() == DstTy)
return C;
1674 "Invalid constantexpr addrspacecast!");
1682 assert(Opcode >= Instruction::BinaryOpsBegin &&
1683 Opcode < Instruction::BinaryOpsEnd &&
1684 "Invalid opcode in binary constant expression");
1686 "Operand types in binary constant expression should match");
1690 case Instruction::Add:
1691 case Instruction::Sub:
1692 case Instruction::Mul:
1693 assert(C1->
getType() == C2->
getType() &&
"Op types should be identical!");
1695 "Tried to create an integer operation on a non-integer type!");
1697 case Instruction::FAdd:
1698 case Instruction::FSub:
1699 case Instruction::FMul:
1700 assert(C1->
getType() == C2->
getType() &&
"Op types should be identical!");
1702 "Tried to create a floating-point operation on a "
1703 "non-floating-point type!");
1705 case Instruction::UDiv:
1706 case Instruction::SDiv:
1707 assert(C1->
getType() == C2->
getType() &&
"Op types should be identical!");
1709 "Tried to create an arithmetic operation on a non-arithmetic type!");
1711 case Instruction::FDiv:
1712 assert(C1->
getType() == C2->
getType() &&
"Op types should be identical!");
1714 "Tried to create an arithmetic operation on a non-arithmetic type!");
1716 case Instruction::URem:
1717 case Instruction::SRem:
1718 assert(C1->
getType() == C2->
getType() &&
"Op types should be identical!");
1720 "Tried to create an arithmetic operation on a non-arithmetic type!");
1722 case Instruction::FRem:
1723 assert(C1->
getType() == C2->
getType() &&
"Op types should be identical!");
1725 "Tried to create an arithmetic operation on a non-arithmetic type!");
1730 assert(C1->
getType() == C2->
getType() &&
"Op types should be identical!");
1732 "Tried to create a logical operation on a non-integral type!");
1734 case Instruction::Shl:
1735 case Instruction::LShr:
1736 case Instruction::AShr:
1737 assert(C1->
getType() == C2->
getType() &&
"Op types should be identical!");
1739 "Tried to create a shift operation on a non-integer type!");
1774 Constant *Indices[2] = { Zero, One };
1800 assert(C1->
getType() == C2->
getType() &&
"Op types should be identical!");
1802 switch (Predicate) {
1810 return getFCmp(Predicate, C1, C2);
1816 return getICmp(Predicate, C1, C2);
1836 "Non-pointer type for constant GetElementPtr expression");
1843 assert(Ty &&
"GEP indices invalid!");
1850 std::vector<Constant*> ArgVec;
1851 ArgVec.reserve(1 + Idxs.
size());
1852 ArgVec.push_back(C);
1853 for (
unsigned i = 0, e = Idxs.
size(); i != e; ++i) {
1855 "getelementptr index type missmatch");
1856 assert((!Idxs[i]->
getType()->isVectorTy() ||
1858 Idxs[i]->getType()->getVectorNumElements()) &&
1859 "getelementptr index type missmatch");
1860 ArgVec.push_back(cast<Constant>(Idxs[i]));
1863 InBounds ? GEPOperator::IsInBounds : 0);
1914 "Tried to create extractelement operation on non-vector type!");
1916 "Extractelement index must be i32 type!");
1933 "Tried to create insertelement operation on non-vector type!");
1935 "Insertelement types must match!");
1937 "Insertelement index must be i32 type!");
1942 Constant *ArgVec[] = { Val, Elt, Idx };
1952 "Invalid shuffle vector constant expr operands!");
1972 "Non-first-class type for constant insertvalue expression");
1976 "insertvalue indices invalid!");
1983 const ExprMapKeyType Key(Instruction::InsertValue, ArgVec, 0, 0, Idxs);
1992 "Tried to create extractelement operation on non-first-class type!");
1996 assert(ReqTy &&
"extractvalue indices invalid!");
1999 "Non-first-class type for constant extractvalue expression");
2004 const ExprMapKeyType Key(Instruction::ExtractValue, ArgVec, 0, 0, Idxs);
2012 "Cannot NEG a nonintegral value!");
2019 "Cannot FNEG a non-floating-point value!");
2025 "Cannot NOT a nonintegral value!");
2030 bool HasNUW,
bool HasNSW) {
2033 return get(Instruction::Add, C1, C2,
Flags);
2037 return get(Instruction::FAdd, C1, C2);
2041 bool HasNUW,
bool HasNSW) {
2044 return get(Instruction::Sub, C1, C2,
Flags);
2048 return get(Instruction::FSub, C1, C2);
2052 bool HasNUW,
bool HasNSW) {
2055 return get(Instruction::Mul, C1, C2,
Flags);
2059 return get(Instruction::FMul, C1, C2);
2063 return get(Instruction::UDiv, C1, C2,
2068 return get(Instruction::SDiv, C1, C2,
2073 return get(Instruction::FDiv, C1, C2);
2077 return get(Instruction::URem, C1, C2);
2081 return get(Instruction::SRem, C1, C2);
2085 return get(Instruction::FRem, C1, C2);
2101 bool HasNUW,
bool HasNSW) {
2104 return get(Instruction::Shl, C1, C2,
Flags);
2108 return get(Instruction::LShr, C1, C2,
2113 return get(Instruction::AShr, C1, C2,
2126 case Instruction::Add:
2131 case Instruction::Mul:
2153 case Instruction::Mul:
2171 GetElementPtrConstantExpr::
2176 - (IdxList.size()+1), IdxList.size()+1) {
2178 for (
unsigned i = 0, E = IdxList.
size(); i != E; ++i)
2185 void ConstantDataArray::anchor() {}
2186 void ConstantDataVector::anchor() {}
2204 switch (
IT->getBitWidth()) {
2219 return AT->getNumElements();
2230 const char *ConstantDataSequential::getElementPointer(
unsigned Elt)
const {
2265 Entry = &Node->Next, Node = *Entry)
2266 if (Node->getType() == Ty)
2271 if (isa<ArrayType>(Ty))
2274 assert(isa<VectorType>(Ty));
2286 assert(Slot != CDSConstants.
end() &&
"CDS not found in uniquing table");
2291 if ((*Entry)->Next == 0) {
2294 assert((*Entry) ==
this &&
"Hash mismatch in ConstantDataSequential");
2300 Entry = &Node->Next, Node = *Entry) {
2301 assert(Node &&
"Didn't find entry in its uniquing hash table!");
2304 *Entry = Node->Next;
2323 const char *Data =
reinterpret_cast<const char *
>(Elts.
data());
2328 const char *Data =
reinterpret_cast<const char *
>(Elts.
data());
2333 const char *Data =
reinterpret_cast<const char *
>(Elts.
data());
2338 const char *Data =
reinterpret_cast<const char *
>(Elts.
data());
2343 const char *Data =
reinterpret_cast<const char *
>(Elts.
data());
2348 const char *Data =
reinterpret_cast<const char *
>(Elts.
data());
2360 const uint8_t *Data =
reinterpret_cast<const uint8_t *
>(Str.
data());
2368 return get(Context, ElementVals);
2376 const char *Data =
reinterpret_cast<const char *
>(Elts.
data());
2381 const char *Data =
reinterpret_cast<const char *
>(Elts.
data());
2386 const char *Data =
reinterpret_cast<const char *
>(Elts.
data());
2391 const char *Data =
reinterpret_cast<const char *
>(Elts.
data());
2396 const char *Data =
reinterpret_cast<const char *
>(Elts.
data());
2401 const char *Data =
reinterpret_cast<const char *
>(Elts.
data());
2407 "Element type not compatible with ConstantData");
2409 if (CI->getType()->isIntegerTy(8)) {
2413 if (CI->getType()->isIntegerTy(16)) {
2417 if (CI->getType()->isIntegerTy(32)) {
2421 assert(CI->getType()->isIntegerTy(64) &&
"Unsupported ConstantData type");
2426 if (
ConstantFP *CFP = dyn_cast<ConstantFP>(V)) {
2427 if (CFP->getType()->isFloatTy()) {
2431 if (CFP->getType()->isDoubleTy()) {
2433 CFP->getValueAPF().convertToDouble());
2445 "Accessor can only be used when element is an integer");
2446 const char *EltPtr = getElementPointer(Elt);
2453 return *
const_cast<uint8_t *
>(
reinterpret_cast<const uint8_t *
>(EltPtr));
2455 return *
const_cast<uint16_t *
>(
reinterpret_cast<const uint16_t *
>(EltPtr));
2457 return *
const_cast<uint32_t *
>(
reinterpret_cast<const uint32_t *
>(EltPtr));
2459 return *
const_cast<uint64_t *
>(
reinterpret_cast<const uint64_t *
>(EltPtr));
2466 const char *EltPtr = getElementPointer(Elt);
2470 llvm_unreachable(
"Accessor can only be used when element is float/double!");
2472 const float *FloatPrt =
reinterpret_cast<const float *
>(EltPtr);
2473 return APFloat(*const_cast<float *>(FloatPrt));
2476 const double *DoublePtr =
reinterpret_cast<const double *
>(EltPtr);
2477 return APFloat(*const_cast<double *>(DoublePtr));
2486 "Accessor can only be used when element is a 'float'");
2487 const float *EltPtr =
reinterpret_cast<const float *
>(getElementPointer(Elt));
2488 return *
const_cast<float *
>(EltPtr);
2495 "Accessor can only be used when element is a 'float'");
2496 const double *EltPtr =
2497 reinterpret_cast<const double *
>(getElementPointer(Elt));
2498 return *
const_cast<double *
>(EltPtr);
2525 if (Str.
back() != 0)
return false;
2539 if (
memcmp(Base, Base+i*EltSize, EltSize))
2562 assert(isa<Constant>(To) &&
"Cannot make Constant refer to non-constant!");
2563 Constant *ToC = cast<Constant>(To);
2569 Lookup.first = cast<ArrayType>(
getType());
2574 unsigned NumUpdated = 0;
2577 bool AllSame =
true;
2579 Constant *Val = cast<Constant>(O->get());
2585 AllSame &= Val == ToC;
2591 }
else if (AllSame && isa<UndefValue>(ToC)) {
2597 pImpl->ArrayConstants.find(Lookup);
2599 if (I != pImpl->ArrayConstants.map_end()) {
2600 Replacement = I->first;
2606 pImpl->ArrayConstants.remove(
this);
2610 if (NumUpdated == 1) {
2612 assert(
getOperand(OperandToUpdate) == From &&
2613 "ReplaceAllUsesWith broken!");
2620 pImpl->ArrayConstants.insert(
this);
2626 assert(Replacement !=
this &&
"I didn't contain From!");
2637 assert(isa<Constant>(To) &&
"Cannot make Constant refer to non-constant!");
2638 Constant *ToC = cast<Constant>(To);
2641 assert(
getOperand(OperandToUpdate) == From &&
"ReplaceAllUsesWith broken!");
2645 Lookup.first = cast<StructType>(
getType());
2651 bool isAllUndef =
false;
2655 Constant *Val = cast<Constant>(O->get());
2659 }
else if (isa<UndefValue>(ToC)) {
2662 Constant *Val = cast<Constant>(O->get());
2664 if (isAllUndef) isAllUndef = isa<UndefValue>(Val);
2668 Values.
push_back(cast<Constant>(O->get()));
2670 Values[OperandToUpdate] = ToC;
2677 }
else if (isAllUndef) {
2686 Replacement = I->first;
2701 assert(Replacement !=
this &&
"I didn't contain From!");
2712 assert(isa<Constant>(To) &&
"Cannot make Constant refer to non-constant!");
2718 if (Val == From) Val = cast<Constant>(To);
2722 Constant *Replacement =
get(Values);
2723 assert(Replacement !=
this &&
"I didn't contain From!");
2734 assert(isa<Constant>(ToV) &&
"Cannot make Constant refer to non-constant!");
2735 Constant *To = cast<Constant>(ToV);
2740 NewOps.push_back(Op == From ? To : Op);
2744 assert(Replacement !=
this &&
"I didn't contain From!");
2761 case Instruction::Trunc:
2762 case Instruction::ZExt:
2763 case Instruction::SExt:
2764 case Instruction::FPTrunc:
2765 case Instruction::FPExt:
2766 case Instruction::UIToFP:
2767 case Instruction::SIToFP:
2768 case Instruction::FPToUI:
2769 case Instruction::FPToSI:
2770 case Instruction::PtrToInt:
2771 case Instruction::IntToPtr:
2772 case Instruction::BitCast:
2777 case Instruction::InsertElement:
2781 case Instruction::InsertValue:
2783 case Instruction::ExtractValue:
2785 case Instruction::ShuffleVector:
2788 case Instruction::GetElementPtr:
2789 if (cast<GEPOperator>(
this)->isInBounds())
2794 case Instruction::ICmp:
2795 case Instruction::FCmp:
2804 if (isa<OverflowingBinaryOperator>(BO)) {
2810 if (isa<PossiblyExactOperator>(BO))
void destroyConstantImpl()
static bool isValueValidForType(Type *Ty, uint64_t V)
Determine if the value is in range for the given type.
void push_back(const T &Elt)
static ConstantInt * getFalse(LLVMContext &Context)
IntegerType * getType() const
void setHasNoSignedWrap(bool b=true)
static Constant * getString(LLVMContext &Context, StringRef Initializer, bool AddNull=true)
static Constant * getSIToFP(Constant *C, Type *Ty)
static bool rangeOnlyContains(ItTy Start, ItTy End, EltTy Elt)
const ValueTy & getValue() const
static Type * getDoubleTy(LLVMContext &C)
static IntegerType * getInt1Ty(LLVMContext &C)
static Constant * getFAdd(Constant *C1, Constant *C2)
static Constant * getShuffleVector(Constant *V1, Constant *V2, Constant *Mask)
LLVMContext & getContext() const
APFloat getElementAsAPFloat(unsigned i) const
static APInt getAllOnesValue(unsigned numBits)
Get the all-ones value.
Type * getSequentialElementType() const
size_t size() const
size - Get the string size.
static Constant * getFoldedCast(Instruction::CastOps opc, Constant *C, Type *Ty)
unsigned getScalarSizeInBits()
static const fltSemantics IEEEdouble
2: 32-bit floating point type
Constant * getSplatValue() const
static Constant * getSelect(Constant *C, Constant *V1, Constant *V2)
const T & front() const
front - Get the first element.
static SelectInst * Create(Value *C, Value *S1, Value *S2, const Twine &NameStr="", Instruction *InsertBefore=0)
enable_if_c<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
unsigned getNumOperands() const
size_t find(char C, size_t From=0) const
static ConstantAggregateZero * get(Type *Ty)
static Constant * getFPToUI(Constant *C, Type *Ty)
static Constant * getGetElementPtr(Constant *C, ArrayRef< Constant * > IdxList, bool InBounds=false)
Constant * ConstantFoldExtractElementInstruction(Constant *Val, Constant *Idx)
Constant * getElementAsConstant(unsigned i) const
static Constant * getBinOpIdentity(unsigned Opcode, Type *Ty)
Constant * getSplatValue() const
gep_type_iterator gep_type_end(const User *GEP)
MapTy::iterator map_end()
Constant * ConstantFoldCastInstruction(unsigned opcode, Constant *V, Type *DestTy)
static Constant * getExtractElement(Constant *Vec, Constant *Idx)
0 1 0 0 True if ordered and less than
std::pair< ArrayType *, Operands > LookupKey
iterator find(StringRef Key)
bool isDoubleTy() const
isDoubleTy - Return true if this is 'double', a 64-bit IEEE fp type.
ConstantInt * TheFalseVal
1 1 1 0 True if unordered or not equal
bool isPtrOrPtrVectorTy() const
const Function * getParent() const
Return the enclosing method, or null if none.
static Constant * getUIToFP(Constant *C, Type *Ty)
virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U)
4: 80-bit floating point type (X87)
const APInt & getUniqueInteger() const
static APFloat getZero(const fltSemantics &Sem, bool Negative=false)
1: 16-bit floating point type
unsigned getBitWidth() const
Get the number of bits in this IntegerType.
static IntegerType * getInt64Ty(LLVMContext &C)
static Constant * getFCmp(unsigned short pred, Constant *LHS, Constant *RHS)
static Constant * getSub(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
StringRef drop_back(size_t N=1) const
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
static IntegerType * getInt16Ty(LLVMContext &C)
unsigned getOpcode() const
getOpcode - Return the opcode at the root of this constant expression
virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U)
static Type * getX86_FP80Ty(LLVMContext &C)
bool bitwiseIsEqual(const APFloat &) const
Bitwise comparison for equality (QNaNs compare equal, 0!=-0).
static Constant * getNullValue(Type *Ty)
static Constant * getAdd(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
static Constant * getFMul(Constant *C1, Constant *C2)
bool isNegativeZeroValue() const
1 0 0 1 True if unordered or equal
static const fltSemantics x87DoubleExtended
1 0 0 0 True if unordered: isnan(X) | isnan(Y)
static Constant * getIntegerCast(Constant *C, Type *Ty, bool isSigned)
Create a ZExt, Bitcast or Trunc for integer -> integer casts.
static bool castIsValid(Instruction::CastOps op, Value *S, Type *DstTy)
Determine if a cast is valid without creating one.
static cl::opt< ITMode > IT(cl::desc("IT block support"), cl::Hidden, cl::init(DefaultIT), cl::ZeroOrMore, cl::values(clEnumValN(DefaultIT,"arm-default-it","Generate IT block based on arch"), clEnumValN(RestrictedIT,"arm-restrict-it","Disallow deprecated IT based on ARMv8"), clEnumValN(NoRestrictedIT,"arm-no-restrict-it","Allow IT blocks based on ARMv7"), clEnumValEnd))
static Constant * get(unsigned Opcode, Constant *C1, Constant *C2, unsigned Flags=0)
static Type * getFloatTy(LLVMContext &C)
const APInt & getValue() const
Return the constant's value.
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Constant * getSequentialElement() const
static Constant * get(LLVMContext &Context, ArrayRef< uint8_t > Elts)
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val()
#define llvm_unreachable(msg)
static Constant * getLShr(Constant *C1, Constant *C2, bool isExact=false)
void setHasNoUnsignedWrap(bool b=true)
static Constant * get(ArrayRef< Constant * > V)
0 1 0 1 True if ordered and less than or equal
double getElementAsDouble(unsigned i) const
static Constant * getExtractValue(Constant *Agg, ArrayRef< unsigned > Idxs)
static const fltSemantics IEEEquad
Instruction * getAsInstruction()
static ConstantInt * ExtractElement(Constant *V, Constant *Idx)
Type * getVectorElementType() const
virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U)
static Type * getPPC_FP128Ty(LLVMContext &C)
uint64_t getZExtValue() const
Return the zero extended value.
virtual void destroyConstant()
static bool isValidOperands(const Value *V1, const Value *V2, const Value *Mask)
static Constant * getSizeOf(Type *Ty)
static StructType * getTypeForElements(ArrayRef< Constant * > V, bool Packed=false)
UndefValue * getElementValue(Constant *C) const
LLVMContext & getContext() const
getContext - Return the LLVMContext in which this type was uniqued.
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
static Constant * getFPCast(Constant *C, Type *Ty)
Create a FPExt, Bitcast or FPTrunc for fp -> fp casts.
const char * data() const
bool isHalfTy() const
isHalfTy - Return true if this is 'half', a 16-bit IEEE fp type.
ArrayRef< T > slice(unsigned N) const
slice(n) - Chop off the first N elements of the array.
static Constant * getAShr(Constant *C1, Constant *C2, bool isExact=false)
bool isConstantUsed() const
static Constant * getICmp(unsigned short pred, Constant *LHS, Constant *RHS)
UndefValue * getStructElement(unsigned Elt) const
static Constant * getAddrSpaceCast(Constant *C, Type *Ty)
bool isFirstClassType() const
static Constant * getPtrToInt(Constant *C, Type *Ty)
unsigned getActiveBits() const
Compute the number of active bits in the value.
bool isFloatingPointTy() const
ArrayConstantsTy ArrayConstants
DenseMap< PointerType *, ConstantPointerNull * > CPNConstants
SequentialType * getType() const
Constant * ConstantFoldInsertValueInstruction(Constant *Agg, Constant *Val, ArrayRef< unsigned > Idxs)
void replaceAllUsesWith(Value *V)
static Constant * getUDiv(Constant *C1, Constant *C2, bool isExact=false)
unsigned getNumElements() const
Return the number of elements in the Vector type.
Constant * getWithOperandReplaced(unsigned OpNo, Constant *Op) const
static Constant * getIntToPtr(Constant *C, Type *Ty)
const char * getOpcodeName() const
bool isPPC_FP128Ty() const
isPPC_FP128Ty - Return true if this is powerpc long double.
Type * getElementType() const
size_t size() const
size - Get the array size.
static Constant * getFDiv(Constant *C1, Constant *C2)
static APFloat getInf(const fltSemantics &Sem, bool Negative=false)
static CastInst * Create(Instruction::CastOps, Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=0)
Construct any of the CastInst subclasses.
virtual void destroyConstant()
10: Arbitrary bit width integers
static bool removeDeadUsersOfConstant(const Constant *C)
DenseMap< Type *, ConstantAggregateZero * > CAZConstants
A self-contained host- and target-independent arbitrary-precision floating-point software implementat...
int memcmp(const void *s1, const void *s2, size_t n);
bool isIntOrIntVectorTy() const
Constant * ConstantFoldShuffleVectorInstruction(Constant *V1, Constant *V2, Constant *Mask)
static Constant * getFNeg(Constant *C)
static Constant * getFRem(Constant *C1, Constant *C2)
static Constant * getImpl(StringRef Bytes, Type *Ty)
static ConstantPointerNull * get(PointerType *T)
get() - Static factory methods - Return objects of the specified value
static InsertElementInst * Create(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr="", Instruction *InsertBefore=0)
LLVM Basic Block Representation.
static BlockAddress * get(Function *F, BasicBlock *BB)
get - Return a BlockAddress for the specified function and basic block.
Type * getElementType(unsigned N) const
LLVM Constant Representation.
uint64_t getElementByteSize() const
getElementByteSize - Return the size in bytes of the elements in the data.
bool hasIndices() const
Return true if this is an insertvalue or extractvalue expression, and the getIndices() method may be ...
StringRef getAsString() const
char back() const
back - Get the last character in the string.
StringRef getRawDataValues() const
bool isFloatTy() const
isFloatTy - Return true if this is 'float', a 32-bit IEEE fp type.
static Constant * getAnd(Constant *C1, Constant *C2)
APInt Or(const APInt &LHS, const APInt &RHS)
Bitwise OR function for APInt.
static Constant * get(ArrayType *T, ArrayRef< Constant * > V)
APInt Xor(const APInt &LHS, const APInt &RHS)
Bitwise XOR function for APInt.
bool isZeroValue() const
Return true if the value is negative zero or null value.
static Constant * getSExtOrBitCast(Constant *C, Type *Ty)
static int Lookup(const TableEntry *Table, unsigned N, unsigned Opcode)
ItTy next(ItTy it, Dist n)
UndefValue * getSequentialElement() const
uint64_t getNumElements() const
unsigned getBitWidth() const
Return the number of bits in the APInt.
opStatus convert(const fltSemantics &, roundingMode, bool *)
6: 128-bit floating point type (two 64-bits, PowerPC)
Value * getOperand(unsigned i) const
0 1 1 1 True if ordered (no nans)
static bool isValueValidForType(Type *Ty, const APFloat &V)
isValueValidForType - return true if Ty is big enough to represent V.
Integer representation type.
static Constant * getFPTrunc(Constant *C, Type *Ty)
static Constant * get(StructType *T, ArrayRef< Constant * > V)
static Constant * getSplat(unsigned NumElts, Constant *Elt)
bool empty() const
empty - Check if the array is empty.
static Constant * getNot(Constant *C)
Constant * getAggregateElement(unsigned Elt) const
static Constant * getAllOnesValue(Type *Ty)
Get the all ones value.
unsigned getPredicate() const
1 1 1 1 Always true (always folded)
ArrayRef< unsigned > getIndices() const
uint64_t getElementAsInteger(unsigned i) const
void append(in_iter in_start, in_iter in_end)
static const fltSemantics * TypeToFloatSemantics(Type *Ty)
virtual void destroyConstant()
bool isFP128Ty() const
isFP128Ty - Return true if this is 'fp128'.
static UndefValue * get(Type *T)
static Constant * getFPExtend(Constant *C, Type *Ty)
LLVMContext & getContext() const
All values hold a context through their type.
bool isFPOrFPVectorTy() const
PointerType * getPointerTo(unsigned AddrSpace=0)
Constant * ConstantFoldBinaryInstruction(unsigned Opcode, Constant *V1, Constant *V2)
1 1 0 1 True if unordered, less than, or equal
static const fltSemantics IEEEhalf
ConstantUniqueMap< ExprMapKeyType, const ExprMapKeyType &, Type, ConstantExpr > ExprConstants
VectorConstantsTy VectorConstants
unsigned char SubclassOptionalData
LLVMContextImpl *const pImpl
static Type * getFP128Ty(LLVMContext &C)
Constant * ConstantFoldGetElementPtr(Constant *C, bool inBounds, ArrayRef< Constant * > Idxs)
static Constant * getIntegerValue(Type *Ty, const APInt &V)
void setIsExact(bool b=true)
virtual void destroyConstant()
bool isCompare() const
Return true if this is a compare constant expression.
static bool isZero(Value *V, DataLayout *DL)
0 0 1 0 True if ordered and greater than
static Constant * getPointerCast(Constant *C, Type *Ty)
Create a BitCast or a PtrToInt cast constant expression.
virtual void destroyConstant()
static Type * getHalfTy(LLVMContext &C)
static Constant * getSplat(unsigned NumElts, Constant *Elt)
static IntegerType * get(LLVMContext &C, unsigned NumBits)
Get or create an IntegerType instance.
static bool isAllZeros(StringRef Arr)
isAllZeros - return true if the array is empty or all zeros.
static Constant * getBitCast(Constant *C, Type *Ty)
PossibleRelocationsTy getRelocationInfo() const
static const fltSemantics PPCDoubleDouble
ArrayType * getType() const
unsigned getIntegerBitWidth() const
static PointerType * getUnqual(Type *ElementType)
Class for constant integers.
15: SIMD 'packed' format, or other vector type
unsigned getVectorNumElements() const
static StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
static Constant * getSDiv(Constant *C1, Constant *C2, bool isExact=false)
1 1 0 0 True if unordered or less than
const char * getOpcodeName() const
getOpcodeName - Return a string representation for an opcode.
static APFloat getAllOnesValue(unsigned BitWidth, bool isIEEE=false)
BasicBlock * getBasicBlock() const
Value * stripPointerCasts()
Strips off any unneeded pointer casts, all-zero GEPs and aliases from the specified value...
const char * getKeyData() const
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
static ConstantInt * getSigned(IntegerType *Ty, int64_t V)
Get a ConstantInt for a specific signed value.
static GetElementPtrInst * Create(Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=0)
static Constant * getTrunc(Constant *C, Type *Ty)
static Constant * get(Type *Ty, double V)
static ConstantInt * getTrue(LLVMContext &Context)
static Constant * getFPToSI(Constant *C, Type *Ty)
void setOperand(unsigned i, Value *Val)
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
bool isAllOnesValue() const
ConstantClass * getOrCreate(TypeClass *Ty, Operands V)
Class for arbitrary precision integers.
bool isCast() const
Return true if this is a convert constant expression.
static ConstantFP * getNegativeZero(Type *Ty)
virtual void destroyConstant()
static bool canTrapImpl(const Constant *C, SmallPtrSet< const ConstantExpr *, 4 > &NonTrappingOps)
StructType * getType() const
static char getTypeID(Type *Ty)
static bool isElementTypeCompatible(const Type *Ty)
DenseMap< Type *, UndefValue * > UVConstants
static Constant * getZExtOrBitCast(Constant *C, Type *Ty)
APInt And(const APInt &LHS, const APInt &RHS)
Bitwise AND function for APInt.
static Constant * getFSub(Constant *C1, Constant *C2)
bool isGEPWithNoNotionalOverIndexing() const
Return true if this is a getelementptr expression and all the index operands are compile-time known i...
static Constant * getTruncOrBitCast(Constant *C, Type *Ty)
DenseMapIterator< KeyT, ValueT, KeyInfoT > iterator
static InsertValueInst * Create(Value *Agg, Value *Val, ArrayRef< unsigned > Idxs, const Twine &NameStr="", Instruction *InsertBefore=0)
static Constant * getNeg(Constant *C, bool HasNUW=false, bool HasNSW=false)
Constant * ConstantFoldCompareInstruction(unsigned short predicate, Constant *C1, Constant *C2)
static CmpInst * Create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2, const Twine &Name="", Instruction *InsertBefore=0)
Create a CmpInst.
virtual void destroyConstant()
Constant * getElementValue(Constant *C) const
PointerType * getType() const
getType - Global values are always pointers.
static const fltSemantics IEEEsingle
Constant * ConstantFoldSelectInstruction(Constant *Cond, Constant *V1, Constant *V2)
bool isX86_FP80Ty() const
isX86_FP80Ty - Return true if this is x86 long double.
static Constant * getSExt(Constant *C, Type *Ty)
static IntegerType * getInt32Ty(LLVMContext &C)
static Constant * getZExt(Constant *C, Type *Ty)
float getElementAsFloat(unsigned i) const
static Constant * getOffsetOf(StructType *STy, unsigned FieldNo)
unsigned greater or equal
static Constant * getOr(Constant *C1, Constant *C2)
static Constant * getZeroValueForNegation(Type *Ty)
unsigned getNumElements() const
getNumElements - Return the number of elements in the array or vector.
Constant * ConstantFoldInsertElementInstruction(Constant *Val, Constant *Elt, Constant *Idx)
0 1 1 0 True if ordered and operands are unequal
static ArrayType * get(Type *ElementType, uint64_t NumElements)
MapTy::iterator find(LookupKey Lookup)
Find the constant by lookup key.
bool isString() const
isString - This method returns true if this is an array of i8.
static Constant * getShl(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
const Type * getScalarType() const
PointerType * getType() const
static BinaryOperator * Create(BinaryOps Op, Value *S1, Value *S2, const Twine &Name=Twine(), Instruction *InsertBefore=0)
unsigned getPrimitiveSizeInBits() const
static Constant * getInsertValue(Constant *Agg, Constant *Val, ArrayRef< unsigned > Idxs)
1 0 1 0 True if unordered or greater than
virtual void destroyConstant()
void insert(ConstantClass *CP)
Insert the constant into its proper slot.
virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U)
const APFloat & getValueAPF() const
VectorType * getType() const
DenseMap< std::pair< Function *, BasicBlock * >, BlockAddress * > BlockAddresses
bool isExactlyValue(const APFloat &V) const
Type * getElementType() const
getElementType - Return the element type of the array/vector.
virtual void destroyConstant()
3: 64-bit floating point type
static Type * getIndexedType(Type *Ptr, ArrayRef< Value * > IdxList)
Function * getFunction() const
static Constant * getSRem(Constant *C1, Constant *C2)
void removeDeadConstantUsers() const
0 0 0 1 True if ordered and equal
StructConstantsTy StructConstants
LLVM Value Representation.
1 0 1 1 True if unordered, greater than, or equal
static Constant * getURem(Constant *C1, Constant *C2)
static VectorType * get(Type *ElementType, unsigned NumElements)
Constant * getStructElement(unsigned Elt) const
Constant * ConstantFoldExtractValueInstruction(Constant *Agg, ArrayRef< unsigned > Idxs)
static Constant * getCompare(unsigned short pred, Constant *C1, Constant *C2)
Return an ICmp or FCmp comparison operator constant expression.
static GetElementPtrInst * CreateInBounds(Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=0)
static APInt getNullValue(unsigned numBits)
Get the '0' value.
static Constant * getAlignOf(Type *Ty)
static Constant * getMul(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
static Constant * get(LLVMContext &Context, ArrayRef< uint8_t > Elts)
unsigned getNumElements() const
Random access to the elements.
0 0 1 1 True if ordered and greater than or equal
static Constant * getCast(unsigned ops, Constant *C, Type *Ty)
StringMap< ConstantDataSequential * > CDSConstants
virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U)
bool isThreadDependent() const
isThreadDependent - Return true if the value can vary between threads.
Constant * getWithOperands(ArrayRef< Constant * > Ops) const
static Constant * getBinOpAbsorber(unsigned Opcode, Type *Ty)
static IntegerType * getInt8Ty(LLVMContext &C)
const fltSemantics & getSemantics() const
virtual void destroyConstant()
static Constant * getInsertElement(Constant *Vec, Constant *Elt, Constant *Idx)
Constant * getSplatValue() const
void remove(ConstantClass *CP)
Remove this constant from the map.
static ConstantFP * getInfinity(Type *Ty, bool Negative=false)
0 0 0 0 Always false (always folded)
static Constant * getXor(Constant *C1, Constant *C2)
5: 128-bit floating point type (112-bit mantissa)
gep_type_iterator gep_type_begin(const User *GEP)
static const char * areInvalidOperands(Value *Cond, Value *True, Value *False)