36 ? cast<CallInst>(II)->op_end() - 1
37 : cast<InvokeInst>(II)->op_end() - 3;
64 return "both values to select must have same type";
69 return "vector select condition element type must be i1";
72 return "selected values for vector select must be vectors";
74 return "vector select requires selected vectors to have "
75 "the same vector length as select condition";
77 return "select condition must be i1 or <n x i1>";
87 PHINode::PHINode(
const PHINode &PN)
89 ReservedSpace(PN.getNumOperands()) {
110 Op<-1>().set(
nullptr);
126 void PHINode::growOperands() {
128 unsigned NumOps = e + e / 2;
129 if (NumOps < 2) NumOps = 2;
131 ReservedSpace = NumOps;
142 if (ConstantValue !=
this)
147 if (ConstantValue ==
this)
149 return ConstantValue;
156 LandingPadInst::LandingPadInst(
Type *RetTy,
unsigned NumReservedValues,
159 init(NumReservedValues, NameStr);
162 LandingPadInst::LandingPadInst(
Type *RetTy,
unsigned NumReservedValues,
165 init(NumReservedValues, NameStr);
170 LP.getNumOperands()),
171 ReservedSpace(LP.getNumOperands()) {
175 for (
unsigned I = 0, E = ReservedSpace;
I != E; ++
I)
182 const Twine &NameStr,
184 return new LandingPadInst(RetTy, NumReservedClauses, NameStr, InsertBefore);
188 const Twine &NameStr,
190 return new LandingPadInst(RetTy, NumReservedClauses, NameStr, InsertAtEnd);
193 void LandingPadInst::init(
unsigned NumReservedValues,
const Twine &NameStr) {
194 ReservedSpace = NumReservedValues;
203 void LandingPadInst::growOperands(
unsigned Size) {
205 if (ReservedSpace >= e + Size)
return;
206 ReservedSpace = (std::max(e, 1U) + Size / 2) * 2;
213 assert(OpNo < ReservedSpace &&
"Growing didn't work!");
226 const Twine &NameStr) {
234 "Calling a function with bad signature!");
236 for (
unsigned i = 0; i != Args.
size(); ++i)
239 "Calling a function with a bad signature!");
246 void CallInst::init(
Value *Func,
const Twine &NameStr) {
248 cast<FunctionType>(cast<PointerType>(Func->
getType())->getElementType());
252 assert(FTy->
getNumParams() == 0 &&
"Calling a function with bad signature");
260 ->getElementType())->getReturnType(),
270 ->getElementType())->getReturnType(),
277 CallInst::CallInst(
const CallInst &CI)
280 CI.getNumOperands()),
281 AttributeList(CI.AttributeList), FTy(CI.FTy) {
306 AttributeSet::get(Context, i, B));
326 return F->getAttributes().hasAttribute(i, A);
332 assert(val &&
"IsConstantOne does not work with nullptr val");
334 return CVal && CVal->
isOne();
342 assert(((!InsertBefore && InsertAtEnd) || (InsertBefore && !InsertAtEnd)) &&
343 "createMalloc needs either InsertBefore or InsertAtEnd");
351 else if (ArraySize->
getType() != IntPtrTy) {
362 AllocSize = ArraySize;
363 }
else if (
Constant *CO = dyn_cast<Constant>(ArraySize)) {
372 "mallocsize", InsertBefore);
375 "mallocsize", InsertAtEnd);
379 assert(AllocSize->
getType() == IntPtrTy &&
"malloc arg is wrong size");
382 Module* M = BB->getParent()->getParent();
384 Value *MallocFunc = MallocF;
392 MCall =
CallInst::Create(MallocFunc, AllocSize,
"malloccall", InsertBefore);
394 if (Result->
getType() != AllocPtrType)
396 Result =
new BitCastInst(MCall, AllocPtrType, Name, InsertBefore);
400 if (Result->
getType() != AllocPtrType) {
403 Result =
new BitCastInst(MCall, AllocPtrType, Name);
407 if (
Function *
F = dyn_cast<Function>(MallocFunc)) {
409 if (!
F->doesNotAlias(0))
F->setDoesNotAlias(0);
411 assert(!MCall->
getType()->
isVoidTy() &&
"Malloc has void return type");
427 return createMalloc(InsertBefore,
nullptr, IntPtrTy, AllocTy, AllocSize,
428 ArraySize, MallocF, Name);
443 return createMalloc(
nullptr, InsertAtEnd, IntPtrTy, AllocTy, AllocSize,
444 ArraySize, MallocF, Name);
449 assert(((!InsertBefore && InsertAtEnd) || (InsertBefore && !InsertAtEnd)) &&
450 "createFree needs either InsertBefore or InsertAtEnd");
452 "Can not free something of nonpointer type!");
455 Module* M = BB->getParent()->getParent();
464 if (Source->
getType() != IntPtrTy)
465 PtrCast =
new BitCastInst(Source, IntPtrTy,
"", InsertBefore);
468 if (Source->
getType() != IntPtrTy)
469 PtrCast =
new BitCastInst(Source, IntPtrTy,
"", InsertAtEnd);
473 if (
Function *
F = dyn_cast<Function>(FreeFunc))
481 return createFree(Source, InsertBefore,
nullptr);
489 assert(FreeCall &&
"CreateFree did not create a CallInst");
499 const Twine &NameStr) {
505 Op<-1>() = IfException;
510 "Invoking a function with bad signature");
512 for (
unsigned i = 0, e = Args.
size(); i != e; i++)
515 "Invoking a function with a bad signature!");
526 II.getNumOperands()),
527 AttributeList(II.AttributeList), FTy(II.FTy) {
533 BasicBlock *InvokeInst::getSuccessorV(
unsigned idx)
const {
536 unsigned InvokeInst::getNumSuccessorsV()
const {
539 void InvokeInst::setSuccessorV(
unsigned idx,
BasicBlock *B) {
555 return F->getAttributes().hasAttribute(i, A);
597 RI.getNumOperands()) {
599 Op<0>() = RI.
Op<0>();
622 unsigned ReturnInst::getNumSuccessorsV()
const {
628 void ReturnInst::setSuccessorV(
unsigned idx,
BasicBlock *NewSucc) {
632 BasicBlock *ReturnInst::getSuccessorV(
unsigned idx)
const {
646 Op<0>() = RI.
Op<0>();
661 unsigned ResumeInst::getNumSuccessorsV()
const {
665 void ResumeInst::setSuccessorV(
unsigned idx,
BasicBlock *NewSucc) {
669 BasicBlock *ResumeInst::getSuccessorV(
unsigned idx)
const {
680 nullptr, 0, InsertBefore) {
684 nullptr, 0, InsertAtEnd) {
687 unsigned UnreachableInst::getNumSuccessorsV()
const {
691 void UnreachableInst::setSuccessorV(
unsigned idx,
BasicBlock *NewSucc) {
695 BasicBlock *UnreachableInst::getSuccessorV(
unsigned idx)
const {
703 void BranchInst::AssertOK() {
706 "May only branch on boolean predicates!");
713 assert(IfTrue &&
"Branch destination may not be null!");
733 assert(IfTrue &&
"Branch destination may not be null!");
751 BranchInst::BranchInst(
const BranchInst &BI) :
754 BI.getNumOperands()) {
755 Op<-1>() = BI.
Op<-1>();
757 assert(BI.
getNumOperands() == 3 &&
"BR can have 1 or 3 operands!");
758 Op<-3>() = BI.
Op<-3>();
759 Op<-2>() = BI.
Op<-2>();
766 "Cannot swap successors of an unconditional branch");
772 if (!ProfileData || ProfileData->getNumOperands() != 3)
776 Metadata *Ops[] = {ProfileData->getOperand(0), ProfileData->getOperand(2),
777 ProfileData->getOperand(1)};
782 BasicBlock *BranchInst::getSuccessorV(
unsigned idx)
const {
785 unsigned BranchInst::getNumSuccessorsV()
const {
788 void BranchInst::setSuccessorV(
unsigned idx,
BasicBlock *B) {
801 assert(!isa<BasicBlock>(Amt) &&
802 "Passed basic block into allocation size parameter! Use other ctor");
804 "Allocation array size is not an integer!");
810 :
AllocaInst(Ty, nullptr, Name, InsertBefore) {}
813 :
AllocaInst(Ty, nullptr, Name, InsertAtEnd) {}
817 :
AllocaInst(Ty, ArraySize, 0, Name, InsertBefore) {}
821 :
AllocaInst(Ty, ArraySize, 0, Name, InsertAtEnd) {}
826 getAISize(Ty->getContext(), ArraySize), InsertBefore),
829 assert(!Ty->
isVoidTy() &&
"Cannot allocate void!");
836 getAISize(Ty->getContext(), ArraySize), InsertAtEnd),
839 assert(!Ty->
isVoidTy() &&
"Cannot allocate void!");
848 assert((Align & (Align-1)) == 0 &&
"Alignment is not a power of 2!");
850 "Alignment is greater than MaximumAlignment!");
853 assert(
getAlignment() == Align &&
"Alignment representation error!");
878 void LoadInst::AssertOK() {
880 "Ptr must have pointer type.");
882 "Alignment required for atomic load");
893 :
LoadInst(Ty, Ptr, Name, isVolatile, 0, InsertBef) {}
897 :
LoadInst(Ptr, Name, isVolatile, 0, InsertAE) {}
913 assert(Ty == cast<PointerType>(Ptr->
getType())->getElementType());
926 Load, Ptr, InsertAE) {
936 Load, Ptr, InsertBef) {
941 if (Name && Name[0])
setName(Name);
946 Load, Ptr, InsertAE) {
951 if (Name && Name[0])
setName(Name);
957 assert(Ty == cast<PointerType>(Ptr->
getType())->getElementType());
962 if (Name && Name[0])
setName(Name);
968 Load, Ptr, InsertAE) {
973 if (Name && Name[0])
setName(Name);
977 assert((Align & (Align-1)) == 0 &&
"Alignment is not a power of 2!");
979 "Alignment is greater than MaximumAlignment!");
982 assert(
getAlignment() == Align &&
"Alignment representation error!");
989 void StoreInst::AssertOK() {
992 "Ptr must have pointer type!");
995 &&
"Ptr must be a pointer to Val type!");
997 "Alignment required for atomic store");
1008 :
StoreInst(val, addr, isVolatile, 0, InsertBefore) {}
1012 :
StoreInst(val, addr, isVolatile, 0, InsertAtEnd) {}
1057 assert((Align & (Align-1)) == 0 &&
"Alignment is not a power of 2!");
1059 "Alignment is greater than MaximumAlignment!");
1062 assert(
getAlignment() == Align &&
"Alignment representation error!");
1081 "All operands must be non-null!");
1083 "Ptr must have pointer type!");
1086 &&
"Ptr must be a pointer to Cmp type!");
1089 &&
"Ptr must be a pointer to NewVal type!");
1091 "AtomicCmpXchg instructions must be atomic!");
1093 "AtomicCmpXchg instructions must be atomic!");
1094 assert(SuccessOrdering >= FailureOrdering &&
1095 "AtomicCmpXchg success ordering must be at least as strong as fail");
1097 "AtomicCmpXchg failure ordering cannot include release semantics");
1110 Init(Ptr, Cmp, NewVal, SuccessOrdering, FailureOrdering, SynchScope);
1123 Init(Ptr, Cmp, NewVal, SuccessOrdering, FailureOrdering, SynchScope);
1130 void AtomicRMWInst::Init(BinOp Operation,
Value *Ptr,
Value *Val,
1140 "All operands must be non-null!");
1142 "Ptr must have pointer type!");
1145 &&
"Ptr must be a pointer to Val type!");
1147 "AtomicRMW instructions must be atomic!");
1158 Init(Operation, Ptr, Val, Ordering, SynchScope);
1169 Init(Operation, Ptr, Val, Ordering, SynchScope);
1199 "NumOperands not initialized?");
1208 GEPI.getNumOperands(),
1209 GEPI.getNumOperands()),
1210 SourceElementType(GEPI.SourceElementType),
1211 ResultElementType(GEPI.ResultElementType) {
1225 template <
typename IndexTy>
1228 if (IdxList.
empty())
1236 unsigned CurIdx = 1;
1237 for (; CurIdx != IdxList.
size(); ++CurIdx) {
1240 IndexTy Index = IdxList[CurIdx];
1244 return CurIdx == IdxList.
size() ? Agg :
nullptr;
1266 if (!CI->isZero())
return false;
1290 return cast<GEPOperator>(
this)->
isInBounds();
1294 APInt &Offset)
const {
1303 ExtractElementInst::ExtractElementInst(
Value *Val,
Value *Index,
1310 assert(isValidOperands(Val, Index) &&
1311 "Invalid extractelement instruction operands!");
1317 ExtractElementInst::ExtractElementInst(
Value *Val,
Value *Index,
1324 assert(isValidOperands(Val, Index) &&
1325 "Invalid extractelement instruction operands!");
1344 InsertElementInst::InsertElementInst(
Value *Vec,
Value *Elt,
Value *Index,
1351 "Invalid insertelement instruction operands!");
1358 InsertElementInst::InsertElementInst(
Value *Vec,
Value *Elt,
Value *Index,
1365 "Invalid insertelement instruction operands!");
1374 const Value *Index) {
1378 if (Elt->
getType() != cast<VectorType>(Vec->
getType())->getElementType())
1401 "Invalid shuffle vector instruction operands!");
1418 "Invalid shuffle vector instruction operands!");
1427 const Value *Mask) {
1438 if (isa<UndefValue>(Mask) || isa<ConstantAggregateZero>(Mask))
1442 unsigned V1Size = cast<VectorType>(V1->
getType())->getNumElements();
1443 for (
Value *
Op : MV->operands()) {
1445 if (CI->uge(V1Size*2))
1447 }
else if (!isa<UndefValue>(
Op)) {
1455 dyn_cast<ConstantDataSequential>(Mask)) {
1456 unsigned V1Size = cast<VectorType>(V1->
getType())->getNumElements();
1458 if (CDS->getElementAsInteger(i) >= V1Size*2)
1467 if (
const ConstantExpr *CE = dyn_cast<ConstantExpr>(Mask))
1468 if (CE->getOpcode() == Instruction::UserOp1)
1478 assert(i < Mask->
getType()->getVectorNumElements() &&
"Index out of range");
1480 return CDS->getElementAsInteger(i);
1482 if (isa<UndefValue>(C))
1484 return cast<ConstantInt>(
C)->getZExtValue();
1494 for (
unsigned i = 0; i != NumElts; ++i)
1495 Result.
push_back(CDS->getElementAsInteger(i));
1498 for (
unsigned i = 0; i != NumElts; ++i) {
1500 Result.
push_back(isa<UndefValue>(C) ? -1 :
1501 cast<ConstantInt>(C)->getZExtValue());
1511 const Twine &Name) {
1518 assert(Idxs.
size() > 0 &&
"InsertValueInst must have at least one index");
1521 Val->
getType() &&
"Inserted value must match indexed type!");
1532 Indices(IVI.Indices) {
1547 assert(Idxs.
size() > 0 &&
"ExtractValueInst must have at least one index");
1555 Indices(EVI.Indices) {
1567 for (
unsigned Index : Idxs) {
1574 if (
ArrayType *AT = dyn_cast<ArrayType>(Agg)) {
1575 if (Index >= AT->getNumElements())
1577 }
else if (
StructType *
ST = dyn_cast<StructType>(Agg)) {
1578 if (Index >=
ST->getNumElements())
1585 Agg = cast<CompositeType>(Agg)->getTypeAtIndex(Index);
1587 return const_cast<Type*
>(Agg);
1623 (void)LHS; (void)RHS;
1624 assert(LHS->
getType() == RHS->getType() &&
1625 "Binary operator operand types must match!");
1631 "Arithmetic operation should return same type as operands!");
1632 assert(
getType()->isIntOrIntVectorTy() &&
1633 "Tried to create an integer operation on a non-integer type!");
1635 case FAdd:
case FSub:
1638 "Arithmetic operation should return same type as operands!");
1639 assert(
getType()->isFPOrFPVectorTy() &&
1640 "Tried to create a floating-point operation on a "
1641 "non-floating-point type!");
1646 "Arithmetic operation should return same type as operands!");
1648 cast<VectorType>(
getType())->getElementType()->isIntegerTy())) &&
1649 "Incorrect operand type (not integer) for S/UDIV");
1653 "Arithmetic operation should return same type as operands!");
1654 assert(
getType()->isFPOrFPVectorTy() &&
1655 "Incorrect operand type (not floating point) for FDIV");
1660 "Arithmetic operation should return same type as operands!");
1662 cast<VectorType>(
getType())->getElementType()->isIntegerTy())) &&
1663 "Incorrect operand type (not integer) for S/UREM");
1667 "Arithmetic operation should return same type as operands!");
1668 assert(
getType()->isFPOrFPVectorTy() &&
1669 "Incorrect operand type (not floating point) for FREM");
1675 "Shift operation should return same type as operands!");
1676 assert((
getType()->isIntegerTy() ||
1678 cast<VectorType>(
getType())->getElementType()->isIntegerTy())) &&
1679 "Tried to create a shift operation on a non-integral type!");
1684 "Logical operation should return same type as operands!");
1685 assert((
getType()->isIntegerTy() ||
1687 cast<VectorType>(
getType())->getElementType()->isIntegerTy())) &&
1688 "Tried to create a logical operation on a non-integral type!");
1700 "Cannot create binary operator with two operands of differing type!");
1731 return BinaryOperator::CreateNSWSub(zero, Op, Name, InsertBefore);
1737 return BinaryOperator::CreateNSWSub(zero, Op, Name, InsertAtEnd);
1743 return BinaryOperator::CreateNUWSub(zero, Op, Name, InsertBefore);
1749 return BinaryOperator::CreateNUWSub(zero, Op, Name, InsertAtEnd);
1783 if (
const Constant *C = dyn_cast<Constant>(V))
1784 return C->isAllOnesValue();
1790 if (Bop->getOpcode() == Instruction::Sub)
1791 if (
Constant* C = dyn_cast<Constant>(Bop->getOperand(0)))
1792 return C->isNegativeZeroValue();
1798 if (Bop->getOpcode() == Instruction::FSub)
1799 if (
Constant* C = dyn_cast<Constant>(Bop->getOperand(0))) {
1800 if (!IgnoreZeroSign)
1802 return !IgnoreZeroSign ? C->isNegativeZeroValue() : C->isZeroValue();
1816 return cast<BinaryOperator>(BinOp)->
getOperand(1);
1824 return cast<BinaryOperator>(BinOp)->
getOperand(1);
1832 assert(
isNot(BinOp) &&
"getNotArgument on non-'not' instruction!");
1855 Op<0>().
swap(Op<1>());
1868 cast<PossiblyExactOperator>(
this)->
setIsExact(b);
1880 return cast<PossiblyExactOperator>(
this)->
isExact();
1885 if (
auto *
OB = dyn_cast<OverflowingBinaryOperator>(V)) {
1891 if (
auto *PE = dyn_cast<PossiblyExactOperator>(V))
1895 if (
auto *FP = dyn_cast<FPMathOperator>(V))
1900 if (
auto *
OB = dyn_cast<OverflowingBinaryOperator>(V)) {
1905 if (
auto *PE = dyn_cast<PossiblyExactOperator>(V))
1908 if (
auto *FP = dyn_cast<FPMathOperator>(V)) {
1910 FM &= FP->getFastMathFlags();
1937 void CastInst::anchor() {}
1942 default:
return false;
1943 case Instruction::ZExt:
1944 case Instruction::SExt:
1945 case Instruction::Trunc:
1947 case Instruction::BitCast:
1955 if (
getOpcode() != Instruction::BitCast)
1984 case Instruction::Trunc:
1985 case Instruction::ZExt:
1986 case Instruction::SExt:
1987 case Instruction::FPTrunc:
1988 case Instruction::FPExt:
1989 case Instruction::UIToFP:
1990 case Instruction::SIToFP:
1991 case Instruction::FPToUI:
1992 case Instruction::FPToSI:
1993 case Instruction::AddrSpaceCast:
1996 case Instruction::BitCast:
1998 case Instruction::PtrToInt:
2001 case Instruction::IntToPtr:
2013 Type *PtrOpTy =
nullptr;
2014 if (
getOpcode() == Instruction::PtrToInt)
2016 else if (
getOpcode() == Instruction::IntToPtr)
2036 Type *DstIntPtrTy) {
2067 const unsigned numCastOps =
2068 Instruction::CastOpsEnd - Instruction::CastOpsBegin;
2069 static const uint8_t CastResults[numCastOps][numCastOps] = {
2075 { 1, 0, 0,99,99, 0, 0,99,99,99, 0, 3, 0},
2076 { 8, 1, 9,99,99, 2,17,99,99,99, 2, 3, 0},
2077 { 8, 0, 1,99,99, 0, 2,99,99,99, 0, 3, 0},
2078 { 0, 0, 0,99,99, 0, 0,99,99,99, 0, 3, 0},
2079 { 0, 0, 0,99,99, 0, 0,99,99,99, 0, 3, 0},
2080 { 99,99,99, 0, 0,99,99, 0, 0,99,99, 4, 0},
2081 { 99,99,99, 0, 0,99,99, 0, 0,99,99, 4, 0},
2082 { 99,99,99, 0, 0,99,99, 0, 0,99,99, 4, 0},
2083 { 99,99,99, 2, 2,99,99,10, 2,99,99, 4, 0},
2084 { 1, 0, 0,99,99, 0, 0,99,99,99, 7, 3, 0},
2085 { 99,99,99,99,99,99,99,99,99,11,99,15, 0},
2086 { 5, 5, 5, 6, 6, 5, 5, 6, 6,16, 5, 1,14},
2087 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,13,12},
2092 bool isFirstBitcast = (firstOp == Instruction::BitCast);
2093 bool isSecondBitcast = (secondOp == Instruction::BitCast);
2094 bool chainedBitcast = (SrcTy == DstTy && isFirstBitcast && isSecondBitcast);
2097 if ((isFirstBitcast && isa<VectorType>(SrcTy) != isa<VectorType>(MidTy)) ||
2098 (isSecondBitcast && isa<VectorType>(MidTy) != isa<VectorType>(DstTy)))
2100 if (!chainedBitcast)
return 0;
2102 int ElimCase = CastResults[firstOp-Instruction::CastOpsBegin]
2103 [secondOp-Instruction::CastOpsBegin];
2150 return Instruction::BitCast;
2153 if (!SrcIntPtrTy || DstIntPtrTy != SrcIntPtrTy)
2156 if (MidSize >= PtrSize)
2157 return Instruction::BitCast;
2166 if (SrcSize == DstSize)
2167 return Instruction::BitCast;
2168 else if (SrcSize < DstSize)
2174 return Instruction::ZExt;
2179 return Instruction::BitCast;
2188 if (SrcSize <= PtrSize && SrcSize == DstSize)
2189 return Instruction::BitCast;
2196 return Instruction::AddrSpaceCast;
2197 return Instruction::BitCast;
2209 "Illegal addrspacecast, bitcast sequence!");
2216 return Instruction::AddrSpaceCast;
2228 "Illegal inttoptr, bitcast sequence!");
2240 "Illegal bitcast, ptrtoint sequence!");
2245 return Instruction::UIToFP;
2257 assert(
castIsValid(op, S, Ty) &&
"Invalid cast!");
2260 case Trunc:
return new TruncInst (S, Ty, Name, InsertBefore);
2261 case ZExt:
return new ZExtInst (S, Ty, Name, InsertBefore);
2262 case SExt:
return new SExtInst (S, Ty, Name, InsertBefore);
2263 case FPTrunc:
return new FPTruncInst (S, Ty, Name, InsertBefore);
2264 case FPExt:
return new FPExtInst (S, Ty, Name, InsertBefore);
2265 case UIToFP:
return new UIToFPInst (S, Ty, Name, InsertBefore);
2266 case SIToFP:
return new SIToFPInst (S, Ty, Name, InsertBefore);
2267 case FPToUI:
return new FPToUIInst (S, Ty, Name, InsertBefore);
2268 case FPToSI:
return new FPToSIInst (S, Ty, Name, InsertBefore);
2269 case PtrToInt:
return new PtrToIntInst (S, Ty, Name, InsertBefore);
2270 case IntToPtr:
return new IntToPtrInst (S, Ty, Name, InsertBefore);
2271 case BitCast:
return new BitCastInst (S, Ty, Name, InsertBefore);
2279 assert(
castIsValid(op, S, Ty) &&
"Invalid cast!");
2282 case Trunc:
return new TruncInst (S, Ty, Name, InsertAtEnd);
2283 case ZExt:
return new ZExtInst (S, Ty, Name, InsertAtEnd);
2284 case SExt:
return new SExtInst (S, Ty, Name, InsertAtEnd);
2285 case FPTrunc:
return new FPTruncInst (S, Ty, Name, InsertAtEnd);
2286 case FPExt:
return new FPExtInst (S, Ty, Name, InsertAtEnd);
2287 case UIToFP:
return new UIToFPInst (S, Ty, Name, InsertAtEnd);
2288 case SIToFP:
return new SIToFPInst (S, Ty, Name, InsertAtEnd);
2289 case FPToUI:
return new FPToUIInst (S, Ty, Name, InsertAtEnd);
2290 case FPToSI:
return new FPToSIInst (S, Ty, Name, InsertAtEnd);
2291 case PtrToInt:
return new PtrToIntInst (S, Ty, Name, InsertAtEnd);
2292 case IntToPtr:
return new IntToPtrInst (S, Ty, Name, InsertAtEnd);
2293 case BitCast:
return new BitCastInst (S, Ty, Name, InsertAtEnd);
2303 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2304 return Create(Instruction::ZExt, S, Ty, Name, InsertBefore);
2311 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2312 return Create(Instruction::ZExt, S, Ty, Name, InsertAtEnd);
2319 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2320 return Create(Instruction::SExt, S, Ty, Name, InsertBefore);
2327 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2328 return Create(Instruction::SExt, S, Ty, Name, InsertAtEnd);
2335 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2336 return Create(Instruction::Trunc, S, Ty, Name, InsertBefore);
2343 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2344 return Create(Instruction::Trunc, S, Ty, Name, InsertAtEnd);
2359 return Create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd);
2377 return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore);
2390 return Create(Instruction::AddrSpaceCast, S, Ty, Name, InsertAtEnd);
2392 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2403 return Create(Instruction::AddrSpaceCast, S, Ty, Name, InsertBefore);
2405 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2412 return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore);
2414 return Create(Instruction::IntToPtr, S, Ty, Name, InsertBefore);
2416 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2420 bool isSigned,
const Twine &Name,
2423 "Invalid integer cast");
2427 (SrcBits == DstBits ? Instruction::BitCast :
2428 (SrcBits > DstBits ? Instruction::Trunc :
2429 (isSigned ? Instruction::SExt : Instruction::ZExt)));
2430 return Create(opcode, C, Ty, Name, InsertBefore);
2434 bool isSigned,
const Twine &Name,
2441 (SrcBits == DstBits ? Instruction::BitCast :
2442 (SrcBits > DstBits ? Instruction::Trunc :
2443 (isSigned ? Instruction::SExt : Instruction::ZExt)));
2444 return Create(opcode, C, Ty, Name, InsertAtEnd);
2455 (SrcBits == DstBits ? Instruction::BitCast :
2456 (SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt));
2457 return Create(opcode, C, Ty, Name, InsertBefore);
2468 (SrcBits == DstBits ? Instruction::BitCast :
2469 (SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt));
2470 return Create(opcode, C, Ty, Name, InsertAtEnd);
2479 if (SrcTy == DestTy)
2482 if (
VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy))
2483 if (
VectorType *DestVecTy = dyn_cast<VectorType>(DestTy))
2484 if (SrcVecTy->getNumElements() == DestVecTy->getNumElements()) {
2486 SrcTy = SrcVecTy->getElementType();
2487 DestTy = DestVecTy->getElementType();
2501 return DestBits == SrcBits;
2511 return DestBits == SrcBits;
2516 return DestBits == SrcBits;
2524 return DestBits == SrcBits;
2534 if (SrcTy == DestTy)
2537 if (
VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy)) {
2538 if (
VectorType *DestVecTy = dyn_cast<VectorType>(DestTy)) {
2539 if (SrcVecTy->getNumElements() == DestVecTy->getNumElements()) {
2541 SrcTy = SrcVecTy->getElementType();
2542 DestTy = DestVecTy->getElementType();
2547 if (
PointerType *DestPtrTy = dyn_cast<PointerType>(DestTy)) {
2548 if (
PointerType *SrcPtrTy = dyn_cast<PointerType>(SrcTy)) {
2549 return SrcPtrTy->getAddressSpace() == DestPtrTy->getAddressSpace();
2558 if (SrcBits == 0 || DestBits == 0)
2561 if (SrcBits != DestBits)
2572 if (
auto *PtrTy = dyn_cast<PointerType>(SrcTy))
2573 if (
auto *IntTy = dyn_cast<IntegerType>(DestTy))
2575 if (
auto *PtrTy = dyn_cast<PointerType>(DestTy))
2576 if (
auto *IntTy = dyn_cast<IntegerType>(SrcTy))
2591 const Value *Src,
bool SrcIsSigned,
Type *DestTy,
bool DestIsSigned) {
2595 "Only first class types are castable!");
2597 if (SrcTy == DestTy)
2601 if (
VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy))
2602 if (
VectorType *DestVecTy = dyn_cast<VectorType>(DestTy))
2603 if (SrcVecTy->getNumElements() == DestVecTy->getNumElements()) {
2606 SrcTy = SrcVecTy->getElementType();
2607 DestTy = DestVecTy->getElementType();
2617 if (DestBits < SrcBits)
2619 else if (DestBits > SrcBits) {
2633 assert(DestBits == SrcBits &&
2634 "Casting vector to integer of different width");
2638 "Casting from a value that is not first-class type");
2648 if (DestBits < SrcBits) {
2650 }
else if (DestBits > SrcBits) {
2656 assert(DestBits == SrcBits &&
2657 "Casting vector to floating point of different width");
2662 assert(DestBits == SrcBits &&
2663 "Illegal cast to vector (wrong type or size)");
2668 return AddrSpaceCast;
2676 assert(DestBits == SrcBits &&
"Casting vector of wrong width to X86_MMX");
2710 cast<VectorType>(SrcTy)->getNumElements() : 0;
2712 cast<VectorType>(DstTy)->getNumElements() : 0;
2716 default:
return false;
2717 case Instruction::Trunc:
2719 SrcLength == DstLength && SrcBitSize > DstBitSize;
2720 case Instruction::ZExt:
2722 SrcLength == DstLength && SrcBitSize < DstBitSize;
2723 case Instruction::SExt:
2725 SrcLength == DstLength && SrcBitSize < DstBitSize;
2726 case Instruction::FPTrunc:
2728 SrcLength == DstLength && SrcBitSize > DstBitSize;
2729 case Instruction::FPExt:
2731 SrcLength == DstLength && SrcBitSize < DstBitSize;
2732 case Instruction::UIToFP:
2733 case Instruction::SIToFP:
2735 SrcLength == DstLength;
2736 case Instruction::FPToUI:
2737 case Instruction::FPToSI:
2739 SrcLength == DstLength;
2740 case Instruction::PtrToInt:
2741 if (isa<VectorType>(SrcTy) != isa<VectorType>(DstTy))
2743 if (
VectorType *VT = dyn_cast<VectorType>(SrcTy))
2744 if (VT->getNumElements() != cast<VectorType>(DstTy)->getNumElements())
2748 case Instruction::IntToPtr:
2749 if (isa<VectorType>(SrcTy) != isa<VectorType>(DstTy))
2751 if (
VectorType *VT = dyn_cast<VectorType>(SrcTy))
2752 if (VT->getNumElements() != cast<VectorType>(DstTy)->getNumElements())
2756 case Instruction::BitCast: {
2762 if (!SrcPtrTy != !DstPtrTy)
2775 if (
VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy)) {
2776 if (
VectorType *DstVecTy = dyn_cast<VectorType>(DstTy))
2777 return (SrcVecTy->getNumElements() == DstVecTy->getNumElements());
2784 case Instruction::AddrSpaceCast: {
2796 if (
VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy)) {
2797 if (
VectorType *DstVecTy = dyn_cast<VectorType>(DstTy))
2798 return (SrcVecTy->getNumElements() == DstVecTy->getNumElements());
2810 ) :
CastInst(Ty, Trunc, S, Name, InsertBefore) {
2816 ) :
CastInst(Ty, Trunc, S, Name, InsertAtEnd) {
2822 ) :
CastInst(Ty, ZExt, S, Name, InsertBefore) {
2828 ) :
CastInst(Ty, ZExt, S, Name, InsertAtEnd) {
2833 ) :
CastInst(Ty, SExt, S, Name, InsertBefore) {
2839 ) :
CastInst(Ty, SExt, S, Name, InsertAtEnd) {
2845 ) :
CastInst(Ty, FPTrunc, S, Name, InsertBefore) {
2851 ) :
CastInst(Ty, FPTrunc, S, Name, InsertAtEnd) {
2857 ) :
CastInst(Ty, FPExt, S, Name, InsertBefore) {
2863 ) :
CastInst(Ty, FPExt, S, Name, InsertAtEnd) {
2869 ) :
CastInst(Ty, UIToFP, S, Name, InsertBefore) {
2875 ) :
CastInst(Ty, UIToFP, S, Name, InsertAtEnd) {
2881 ) :
CastInst(Ty, SIToFP, S, Name, InsertBefore) {
2887 ) :
CastInst(Ty, SIToFP, S, Name, InsertAtEnd) {
2893 ) :
CastInst(Ty, FPToUI, S, Name, InsertBefore) {
2899 ) :
CastInst(Ty, FPToUI, S, Name, InsertAtEnd) {
2905 ) :
CastInst(Ty, FPToSI, S, Name, InsertBefore) {
2911 ) :
CastInst(Ty, FPToSI, S, Name, InsertAtEnd) {
2917 ) :
CastInst(Ty, PtrToInt, S, Name, InsertBefore) {
2923 ) :
CastInst(Ty, PtrToInt, S, Name, InsertAtEnd) {
2929 ) :
CastInst(Ty, IntToPtr, S, Name, InsertBefore) {
2935 ) :
CastInst(Ty, IntToPtr, S, Name, InsertAtEnd) {
2941 ) :
CastInst(Ty, BitCast, S, Name, InsertBefore) {
2947 ) :
CastInst(Ty, BitCast, S, Name, InsertAtEnd) {
2953 ) :
CastInst(Ty, AddrSpaceCast, S, Name, InsertBefore) {
2959 ) :
CastInst(Ty, AddrSpaceCast, S, Name, InsertAtEnd) {
2999 if (Op == Instruction::ICmp) {
3019 if (Op == Instruction::ICmp) {
3028 if (
ICmpInst *IC = dyn_cast<ICmpInst>(
this))
3035 if (
const ICmpInst *IC = dyn_cast<ICmpInst>(
this))
3036 return IC->isCommutative();
3041 if (
const ICmpInst *IC = dyn_cast<ICmpInst>(
this))
3042 return IC->isEquality();
3200 switch (predicate) {
3201 default:
return false;
3208 switch (predicate) {
3209 default:
return false;
3216 switch (predicate) {
3217 default:
return false;
3225 switch (predicate) {
3226 default:
return false;
3235 default:
return false;
3245 default:
return false;
3255 assert(Value && Default && NumReserved);
3256 ReservedSpace = NumReserved;
3271 nullptr, 0, InsertBefore) {
3272 init(Value, Default, 2+NumCases*2);
3282 nullptr, 0, InsertAtEnd) {
3283 init(Value, Default, 2+NumCases*2);
3294 OL[i+1] = InOL[i+1];
3305 if (OpNo+2 > ReservedSpace)
3308 assert(OpNo+1 < ReservedSpace &&
"Growing didn't work!");
3310 CaseIt Case(
this, NewCaseIdx);
3320 assert(2 + idx*2 <
getNumOperands() &&
"Case index out of range!!!");
3326 if (2 + (idx + 1) * 2 != NumOps) {
3327 OL[2 + idx * 2] = OL[NumOps - 2];
3328 OL[2 + idx * 2 + 1] = OL[NumOps - 1];
3332 OL[NumOps-2].
set(
nullptr);
3333 OL[NumOps-2+1].
set(
nullptr);
3340 void SwitchInst::growOperands() {
3342 unsigned NumOps = e*3;
3344 ReservedSpace = NumOps;
3349 BasicBlock *SwitchInst::getSuccessorV(
unsigned idx)
const {
3352 unsigned SwitchInst::getNumSuccessorsV()
const {
3355 void SwitchInst::setSuccessorV(
unsigned idx,
BasicBlock *B) {
3363 void IndirectBrInst::init(
Value *
Address,
unsigned NumDests) {
3365 "Address of indirectbr must be a pointer");
3366 ReservedSpace = 1+NumDests;
3377 void IndirectBrInst::growOperands() {
3379 unsigned NumOps = e*2;
3381 ReservedSpace = NumOps;
3385 IndirectBrInst::IndirectBrInst(
Value *Address,
unsigned NumCases,
3388 nullptr, 0, InsertBefore) {
3389 init(Address, NumCases);
3392 IndirectBrInst::IndirectBrInst(
Value *Address,
unsigned NumCases,
3395 nullptr, 0, InsertAtEnd) {
3396 init(Address, NumCases);
3401 nullptr, IBI.getNumOperands()) {
3414 if (OpNo+1 > ReservedSpace)
3417 assert(OpNo < ReservedSpace &&
"Growing didn't work!");
3425 assert(idx <
getNumOperands()-1 &&
"Successor index out of range!");
3431 OL[idx+1] = OL[NumOps-1];
3434 OL[NumOps-1].
set(
nullptr);
3438 BasicBlock *IndirectBrInst::getSuccessorV(
unsigned idx)
const {
3441 unsigned IndirectBrInst::getNumSuccessorsV()
const {
3444 void IndirectBrInst::setSuccessorV(
unsigned idx,
BasicBlock *B) {
static int getMaskValue(Constant *Mask, unsigned i)
getMaskValue - Return the index from the shuffle mask for the specified output result.
static Instruction * createMalloc(Instruction *InsertBefore, BasicBlock *InsertAtEnd, Type *IntPtrTy, Type *AllocTy, Value *AllocSize, Value *ArraySize, Function *MallocF, const Twine &Name)
BasicBlock * getSuccessor(unsigned i) const
void removeAttribute(unsigned i, Attribute attr)
removeAttribute - removes the attribute from the list of attributes.
ReturnInst - Return a value (possibly void), from a function.
iplist< Instruction >::iterator eraseFromParent()
eraseFromParent - This method unlinks 'this' from the containing basic block and deletes it...
void setAttributes(const AttributeSet &Attrs)
setAttributes - Set the parameter attributes for this invoke.
void push_back(const T &Elt)
AllocaInst(Type *Ty, Value *ArraySize=nullptr, const Twine &Name="", Instruction *InsertBefore=nullptr)
A parsed version of the target data layout string in and methods for querying it. ...
AtomicOrdering getFailureOrdering() const
Returns the ordering constraint on this cmpxchg.
AtomicRMWInst * cloneImpl() const
void copyFastMathFlags(FastMathFlags FMF)
Convenience function for transferring all fast-math flag values to this instruction, which must be an operator which supports these flags.
Instruction::CastOps getOpcode() const
Return the opcode of this CastInst.
void setHasNoSignedWrap(bool b=true)
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag...
This class is the base class for the comparison instructions.
static IntegerType * getInt1Ty(LLVMContext &C)
static bool IsConstantOne(Value *val)
IsConstantOne - Return true only if val is constant int 1.
static BinaryOperator * CreateNot(Value *Op, const Twine &Name="", Instruction *InsertBefore=nullptr)
static const Value * getFNegArgument(const Value *BinOp)
void init(BinaryOps iType)
LandingPadInst * cloneImpl() const
bool isVolatile() const
isVolatile - Return true if this is a store to a volatile memory location.
SynchronizationScope getSynchScope() const
void swapSuccessors()
Swap the successors of this branch instruction.
void allocHungoffUses(unsigned N)
static bool isValidOperands(const Value *Vec, const Value *NewElt, const Value *Idx)
isValidOperands - Return true if an insertelement instruction can be formed with the specified operan...
A Module instance is used to store all the information related to an LLVM module. ...
unsigned getNumParams() const
getNumParams - Return the number of fixed parameters this function type requires. ...
void setOrdering(AtomicOrdering Ordering)
Set the ordering constraint on this RMW.
void setAlignment(unsigned Align)
static CastInst * CreateBitOrPointerCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=0)
Create a BitCast, a PtrToInt, or an IntToPTr cast instruction.
AtomicOrdering getSuccessOrdering() const
Returns the ordering constraint on this cmpxchg.
FenceInst - an instruction for ordering other memory operations.
Instruction * getInstruction() const
AtomicCmpXchgInst - an instruction that atomically checks whether a specified value is in a memory lo...
PtrToIntInst * cloneImpl() const
Clone an identical PtrToIntInst.
void setSynchScope(SynchronizationScope xthread)
Specify whether this fence orders other operations with respect to all concurrently executing threads...
This class represents zero extension of integer types.
unsigned getNumOperands() const
unsigned getNumSuccessors() const
unsigned getPointerTypeSizeInBits(Type *) const
Layout pointer size, in bits, based on the type.
void setSuccessor(BasicBlock *S)
Sets the new successor for current case.
static bool isOrdered(unsigned short predicate)
Determine if the predicate is an ordered operation.
void addCase(ConstantInt *OnVal, BasicBlock *Dest)
addCase - Add an entry to the switch instruction...
CallInst - This class represents a function call, abstracting a target machine's calling convention...
Predicate getInversePredicate() const
For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
bool indexValid(const Value *V) const
Function * getCalledFunction() const
getCalledFunction - Return the function called, or null if this is an indirect function invocation...
bool isSigned() const
Determine if this instruction is using a signed comparison.
void setVolatile(bool V)
setVolatile - Specify whether this is a volatile cmpxchg.
0 1 0 0 True if ordered and less than
ShuffleVectorInst - This instruction constructs a fixed permutation of two input vectors.
IndirectBrInst * cloneImpl() const
1 1 1 0 True if unordered or not equal
bool isPtrOrPtrVectorTy() const
isPtrOrPtrVectorTy - Return true if this is a pointer type or a vector of pointer types...
FastMathFlags getFastMathFlags() const
Convenience function for getting all the fast-math flags, which must be an operator which supports th...
const Function * getParent() const
Return the enclosing method, or null if none.
void setSuccessor(unsigned i, BasicBlock *NewSucc)
This class represents a sign extension of integer types.
unsigned getAddressSpace() const
Return the address space of the Pointer type.
LoadInst - an instruction for reading from memory.
FunctionType * getType(LLVMContext &Context, ID id, ArrayRef< Type * > Tys=None)
Return the function type for an intrinsic.
AtomicRMWInst - an instruction that atomically reads a memory location, combines it with another valu...
static Instruction * CreateFree(Value *Source, Instruction *InsertBefore)
CreateFree - Generate the IR for a call to the builtin free function.
BranchInst * cloneImpl() const
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
SExtInst * cloneImpl() const
Clone an identical SExtInst.
void setSynchScope(SynchronizationScope SynchScope)
Specify whether this cmpxchg is atomic and orders other operations with respect to all concurrently e...
void addDereferenceableOrNullAttr(unsigned i, uint64_t Bytes)
adds the dereferenceable_or_null attribute to the list of attributes.
BinaryOperator * cloneImpl() const
bool isEquality() const
This is just a convenience that dispatches to the subclasses.
static LandingPadInst * Create(Type *RetTy, unsigned NumReservedClauses, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructors - NumReservedClauses is a hint for the number of incoming clauses that this landingpad w...
Type * getPointerElementType() const
UnreachableInst * cloneImpl() const
FPExtInst * cloneImpl() const
Clone an identical FPExtInst.
void setVolatile(bool V)
setVolatile - Specify whether this is a volatile RMW or not.
static bool isBitOrNoopPointerCastable(Type *SrcTy, Type *DestTy, const DataLayout &DL)
Check whether a bitcast, inttoptr, or ptrtoint cast between these types is valid and a no-op...
block_iterator block_end()
void setCallingConv(CallingConv::ID CC)
bool swapOperands()
Exchange the two operands to this instruction.
bool isArrayAllocation() const
isArrayAllocation - Return true if there is an allocation size parameter to the allocation instructio...
1 0 0 1 True if unordered or equal
static InsertElementInst * Create(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
1 0 0 0 True if unordered: isnan(X) | isnan(Y)
static const Value * getNegArgument(const Value *BinOp)
Helper functions to extract the unary argument of a NEG, FNEG or NOT operation implemented via Sub...
This class represents a conversion between pointers from one address space to another.
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)
This method can be used to determine if a cast from S to DstTy using Opcode op is valid or not...
void push_back(NodeTy *val)
Value * removeIncomingValue(unsigned Idx, bool DeletePHIIfEmpty=true)
removeIncomingValue - Remove an incoming value.
unsigned getSubclassDataFromInstruction() const
SelectInst - This class represents the LLVM 'select' instruction.
IntToPtrInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static CallInst * Create(Value *Func, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
This is the base class for all instructions that perform data casts.
CallInst * cloneImpl() const
StructType - Class to represent struct types.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
A Use represents the edge between a Value definition and its users.
void growHungoffUses(unsigned N, bool IsPhi=false)
Grow the number of hung off uses.
void setHasNoUnsignedWrap(bool b=true)
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag...
void setOrdering(AtomicOrdering Ordering)
Set the ordering constraint on this fence.
void setIsInBounds(bool b=true)
setIsInBounds - Set or clear the inbounds flag on this GEP instruction.
PtrToIntInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
Instruction * getFirstNonPHI()
Returns a pointer to the first instruction in this block that is not a PHINode instruction.
static bool isNoopCast(Instruction::CastOps Opcode, Type *SrcTy, Type *DstTy, Type *IntPtrTy)
A no-op cast is one that can be effected without changing any bits.
UIToFPInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
0 1 0 1 True if ordered and less than or equal
FCmpInst * cloneImpl() const
Clone an identical FCmpInst.
bool isSized(SmallPtrSetImpl< const Type * > *Visited=nullptr) const
isSized - Return true if it makes sense to take the size of this type.
AttributeSet addDereferenceableAttr(LLVMContext &C, unsigned Index, uint64_t Bytes) const
Add the dereferenceable attribute to the attribute set at the given index.
void setName(const Twine &Name)
Change the name of the value.
FPToUIInst * cloneImpl() const
Clone an identical FPToUIInst.
static ConstantInt * ExtractElement(Constant *V, Constant *Idx)
static const unsigned MaximumAlignment
LandingPadInst * getLandingPadInst() const
getLandingPadInst - Get the landingpad instruction from the landing pad block (the unwind destination...
block_iterator block_begin()
unsigned getNumSuccessors() const
SynchronizationScope getSynchScope() const
This class represents a cast from a pointer to an integer.
static bool isValidOperands(const Value *V1, const Value *V2, const Value *Mask)
isValidOperands - Return true if a shufflevector instruction can be formed with the specified operand...
UIToFPInst * cloneImpl() const
Clone an identical UIToFPInst.
void setAtomic(AtomicOrdering Ordering, SynchronizationScope SynchScope=CrossThread)
ConstantExpr - a constant value that is initialized with an expression using other constant values...
FunctionType - Class to represent function types.
bool isVolatile() const
isVolatile - Return true if this is a cmpxchg from a volatile memory location.
AtomicOrdering getOrdering() const
Returns the ordering constraint on this RMW.
void setCleanup(bool V)
setCleanup - Indicate that this landingpad instruction is a cleanup.
BitCastInst * cloneImpl() const
Clone an identical BitCastInst.
static SelectInst * Create(Value *C, Value *S1, Value *S2, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
void setValue(ConstantInt *V)
Sets the new value for current case.
ConstantDataSequential - A vector or array constant whose element type is a simple 1/2/4/8-byte integ...
BinOp
This enumeration lists the possible modifications atomicrmw can make.
ArrayType - Class to represent array types.
This instruction compares its operands according to the predicate given to the constructor.
BasicBlock * getSuccessor(unsigned i) const
bool isIntegerCast() const
There are several places where we need to know if a cast instruction only deals with integer source a...
bool isFirstClassType() const
isFirstClassType - Return true if the type is "first class", meaning it is a valid type for a Value...
This class represents a no-op cast from one type to another.
StoreInst * cloneImpl() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
void addDereferenceableAttr(unsigned i, uint64_t Bytes)
adds the dereferenceable attribute to the list of attributes.
void addDereferenceableOrNullAttr(unsigned i, uint64_t Bytes)
adds the dereferenceable_or_null attribute to the list of attributes.
SIToFPInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
bool isFloatingPointTy() const
isFloatingPointTy - Return true if this is one of the six floating point types
Predicate getUnsignedPredicate() const
For example, EQ->EQ, SLE->ULE, UGT->UGT, etc.
FPToSIInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
StoreInst - an instruction for storing to memory.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
This class represents a cast from floating point to signed integer.
unsigned getNumElements() const
Return the number of elements in the Vector type.
This class represents a truncation of integer types.
Type * getElementType() const
size_t size() const
size - Get the array size.
bool isAtomic() const
isAtomic - Return true if this instruction has an AtomicOrdering of unordered or higher.
static const Value * getNotArgument(const Value *BinOp)
std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type cast(const Y &Val)
bool isInBounds() const
isInBounds - Determine whether the GEP has the inbounds flag.
void addAttribute(unsigned i, Attribute::AttrKind attr)
addAttribute - adds the attribute to the list of attributes.
PointerType - Class to represent pointers.
SwitchInst * cloneImpl() const
unsigned getNumIncomingValues() const
getNumIncomingValues - Return the number of incoming edges
FPTruncInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
void removeAttribute(unsigned i, Attribute attr)
removeAttribute - removes the attribute from the list of attributes.
static Type * getIndexedTypeInternal(Type *Agg, ArrayRef< IndexTy > IdxList)
getIndexedType - Returns the type of the element that would be accessed with a gep instruction with t...
SIToFPInst * cloneImpl() const
Clone an identical SIToFPInst.
GetElementPtrInst - an instruction for type-safe pointer arithmetic to access elements of arrays and ...
LoadInst * cloneImpl() const
bool isX86_MMXTy() const
isX86_MMXTy - Return true if this is X86 MMX.
bool isIntOrIntVectorTy() const
isIntOrIntVectorTy - Return true if this is an integer type or a vector of integer types...
Type * getParamType(unsigned i) const
Parameter type accessors.
initializer< Ty > init(const Ty &Val)
bool isLosslessCast() const
A lossless cast is one that does not alter the basic value.
InsertElementInst - This instruction inserts a single (scalar) element into a VectorType value...
static BinaryOperator * CreateNSWNeg(Value *Op, const Twine &Name="", Instruction *InsertBefore=nullptr)
LandingPadInst - The landingpad instruction holds all of the information necessary to generate correc...
static CmpInst * Create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2, const Twine &Name="", Instruction *InsertBefore=nullptr)
Construct a compare instruction, given the opcode, the predicate and the two operands.
unsigned getAlignment() const
getAlignment - Return the alignment of the access that is being performed
Subclasses of this class are all able to terminate a basic block.
void copyIRFlags(const Value *V)
Convenience method to copy supported wrapping, exact, and fast-math flags from V to this instruction...
unsigned getCaseIndex() const
Returns number of current case.
Constant * getOrInsertFunction(StringRef Name, FunctionType *T, AttributeSet AttributeList)
Look up the specified function in the module symbol table.
SynchronizationScope getSynchScope() const
Returns whether this RMW is atomic between threads or only within a single thread.
LLVM Basic Block Representation.
Value * hasConstantValue() const
hasConstantValue - If the specified PHI node always merges together the same value, return the value, otherwise return null.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
UnreachableInst(LLVMContext &C, Instruction *InsertBefore=nullptr)
BranchInst - Conditional or Unconditional Branch instruction.
bool isVectorTy() const
isVectorTy - True if this is an instance of VectorType.
UnreachableInst - This function has undefined behavior.
This is an important base class in LLVM.
ResumeInst - Resume the propagation of an exception.
void setFailureOrdering(AtomicOrdering Ordering)
This file contains the declarations for the subclasses of Constant, which represent the different fla...
void setUsedWithInAlloca(bool V)
Specify whether this alloca is used to represent the arguments to a call.
IndirectBrInst - Indirect Branch Instruction.
APInt Or(const APInt &LHS, const APInt &RHS)
Bitwise OR function for APInt.
unsigned getAlignment() const
getAlignment - Return the alignment of the memory that is being allocated by the instruction.
ConstantFP - Floating Point Values [float, double].
APInt Xor(const APInt &LHS, const APInt &RHS)
Bitwise XOR function for APInt.
AtomicRMWInst(BinOp Operation, Value *Ptr, Value *Val, AtomicOrdering Ordering, SynchronizationScope SynchScope, Instruction *InsertBefore=nullptr)
~TerminatorInst() override
bool paramHasAttr(unsigned i, Attribute::AttrKind A) const
Determine whether the call or the callee has the given attributes.
static bool isBitCastable(Type *SrcTy, Type *DestTy)
Check whether a bitcast between these types is valid.
bool hasAllZeroIndices() const
hasAllZeroIndices - Return true if all of the indices of this GEP are zeros.
static Type * getVoidTy(LLVMContext &C)
Type * getTypeAtIndex(const Value *V)
getTypeAtIndex - Given an index value into the type, return the type of the element.
const InstListType & getInstList() const
Return the underlying instruction list container.
bool isFalseWhenEqual() const
This is just a convenience.
bool isUsedWithInAlloca() const
Return true if this alloca is used as an inalloca argument to a call.
This instruction compares its operands according to the predicate given to the constructor.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
unsigned getBitWidth() const
Return the number of bits in the APInt.
void addClause(Constant *ClauseVal)
Add a catch or filter clause to the landing pad.
Value * getOperand(unsigned i) const
0 1 1 1 True if ordered (no nans)
static CastInst * CreatePointerBitCastOrAddrSpaceCast(Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd)
Create a BitCast or an AddrSpaceCast cast instruction.
bool isCommutative() const
isCommutative - Return true if the instruction is commutative:
static bool isNot(const Value *V)
void addAttribute(unsigned i, Attribute::AttrKind attr)
addAttribute - adds the attribute to the list of attributes.
ConstantVector - Constant Vector Declarations.
Predicate getPredicate() const
Return the predicate for this instruction.
static CastInst * CreatePointerCast(Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd)
Create a BitCast AddrSpaceCast, or a PtrToInt cast instruction.
bool empty() const
empty - Check if the array is empty.
void setTailCallKind(TailCallKind TCK)
Constant * getAggregateElement(unsigned Elt) const
getAggregateElement - For aggregates (struct/array/vector) return the constant that corresponds to th...
void setAlignment(unsigned Align)
This class represents a cast from an integer to a pointer.
static Constant * getAllOnesValue(Type *Ty)
Get the all ones value.
1 1 1 1 Always true (always folded)
NUW NUW NUW NUW Exact static Exact BinaryOperator * CreateNeg(Value *Op, const Twine &Name="", Instruction *InsertBefore=nullptr)
Helper functions to construct and inspect unary operations (NEG and NOT) via binary operators SUB and...
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
ShuffleVectorInst(Value *V1, Value *V2, Value *Mask, const Twine &NameStr="", Instruction *InsertBefor=nullptr)
void setTailCall(bool isTC=true)
bool isPointerTy() const
isPointerTy - True if this is an instance of PointerType.
static UndefValue * get(Type *T)
get() - Static factory methods - Return an 'undef' object of the specified type.
void andIRFlags(const Value *V)
Logical 'and' of any supported wrapping, exact, and fast-math flags of V and this instruction...
bool isCommutative() const
This is just a convenience that dispatches to the subclasses.
VAArgInst - This class represents the va_arg llvm instruction, which returns an argument of the speci...
FPToUIInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
void setAtomic(AtomicOrdering Ordering, SynchronizationScope SynchScope=CrossThread)
~UnaryInstruction() override
bool hasAllConstantIndices() const
hasAllConstantIndices - Return true if all of the indices of this GEP are constant integers...
LLVMContext & getContext() const
All values hold a context through their type.
static CastInst * CreateZExtOrBitCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a ZExt or BitCast cast instruction.
bool isFPOrFPVectorTy() const
isFPOrFPVectorTy - Return true if this is a FP type or a vector of FP.
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
bool hasNoSignedWrap() const
Determine whether the no signed wrap flag is set.
1 1 0 1 True if unordered, less than, or equal
void setMetadata(unsigned KindID, MDNode *Node)
setMetadata - Set the metadata of the specified kind to the specified node.
void swapOperands()
This is just a convenience that dispatches to the subclasses.
unsigned char SubclassOptionalData
Hold subclass data that can be dropped.
unsigned getNumSuccessors() const
float getFPAccuracy() const
Get the maximum error permitted by this operation in ULPs.
CallingConv::ID getCallingConv() const
getCallingConv/setCallingConv - Get or set the calling convention of this function call...
void setSuccessor(unsigned idx, BasicBlock *NewSucc)
BasicBlock * getSuccessor(unsigned i) const
void setIsExact(bool b=true)
Set or clear the exact flag on this instruction, which must be an operator which supports this flag...
static BinaryOperator * CreateNUWNeg(Value *Op, const Twine &Name="", Instruction *InsertBefore=nullptr)
TruncInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
bool isConditional() const
IntegerType * getIntPtrType(LLVMContext &C, unsigned AddressSpace=0) const
Returns an integer type with size at least as big as that of a pointer in the given address space...
0 0 1 0 True if ordered and greater than
BinaryOps getOpcode() const
static BinaryOperator * CreateFNeg(Value *Op, const Twine &Name="", Instruction *InsertBefore=nullptr)
const MDOperand & getOperand(unsigned I) const
static CastInst * CreateIntegerCast(Value *S, Type *Ty, bool isSigned, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a ZExt, BitCast, or Trunc for int -> int casts.
BasicBlock * getUnwindDest() const
AtomicOrdering getOrdering() const
Returns the ordering effect of this store.
static PointerType * getUnqual(Type *ElementType)
PointerType::getUnqual - This constructs a pointer to an object of the specified type in the generic ...
This is the shared class of boolean and integer constants.
Value * getIncomingValue(unsigned i) const
getIncomingValue - Return incoming value number x
AtomicCmpXchgInst * cloneImpl() const
unsigned getVectorNumElements() const
unsigned getScalarSizeInBits() const LLVM_READONLY
getScalarSizeInBits - If this is a vector type, return the getPrimitiveSizeInBits value for the eleme...
AddrSpaceCastInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
ICmpInst * cloneImpl() const
Clone an identical ICmpInst.
unsigned getNumSuccessors() const
ReturnInst * cloneImpl() const
1 1 0 0 True if unordered or less than
bool isStaticAlloca() const
isStaticAlloca - Return true if this alloca is in the entry block of the function and is a constant s...
Module.h This file contains the declarations for the Module class.
Type * getType() const
All values are typed, get the type of this value.
MDNode * getMetadata(unsigned KindID) const
getMetadata - Get the metadata of given kind attached to this Instruction.
static bool isCastable(Type *SrcTy, Type *DestTy)
Check whether it is valid to call getCastOpcode for these types.
LoadInst(Value *Ptr, const Twine &NameStr, Instruction *InsertBefore)
TailCallKind getTailCallKind() const
This class represents a range of values.
InvokeInst * cloneImpl() const
bool isVolatile() const
isVolatile - Return true if this is a load from a volatile memory location.
bool isTrueWhenEqual() const
This is just a convenience.
This class represents a cast from floating point to unsigned integer.
static CastInst * CreateFPCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create an FPExt, BitCast, or FPTrunc for fp -> fp casts.
static unsigned isEliminableCastPair(Instruction::CastOps firstOpcode, Instruction::CastOps secondOpcode, Type *SrcTy, Type *MidTy, Type *DstTy, Type *SrcIntPtrTy, Type *MidIntPtrTy, Type *DstIntPtrTy)
Determine how a pair of casts can be eliminated, if they can be at all.
ShuffleVectorInst * cloneImpl() const
Predicate getSwappedPredicate() const
For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
static APInt getMinValue(unsigned numBits)
Gets minimum unsigned value of APInt for a specific bit width.
VAArgInst * cloneImpl() const
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
Function * getCalledFunction() const
getCalledFunction - Return the function called, or null if this is an indirect function invocation...
AtomicOrdering getOrdering() const
Returns the ordering effect of this fence.
SExtInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
ZExtInst * cloneImpl() const
Clone an identical ZExtInst.
bool isExact() const
Determine whether the exact flag is set.
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(NoStrictAlign), cl::values(clEnumValN(StrictAlign,"aarch64-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"aarch64-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
void setSuccessor(unsigned idx, BasicBlock *NewSucc)
BinOp getOperation() const
void setPredicate(Predicate P)
Set the predicate for this instruction to the specified value.
unsigned Log2_32(uint32_t Value)
Log2_32 - This function returns the floor log base 2 of the specified value, -1 if the value is zero...
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
bool accumulateConstantOffset(const DataLayout &DL, APInt &Offset) const
Accumulate the constant address offset of this GEP if possible.
SynchronizationScope getSynchScope() const
AttributeSet removeAttributes(LLVMContext &C, unsigned Index, AttributeSet Attrs) const
Remove the specified attributes at the specified index from this attribute list.
VectorType - Class to represent vector types.
void setVolatile(bool V)
setVolatile - Specify whether this is a volatile store or not.
static bool isNeg(const Value *V)
Check if the given Value is a NEG, FNeg, or NOT instruction.
Class for arbitrary precision integers.
BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty, const Twine &Name, Instruction *InsertBefore)
VAArgInst(Value *List, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
bool isIntegerTy() const
isIntegerTy - True if this is an instance of IntegerType.
static BinaryOperator * Create(BinaryOps Op, Value *S1, Value *S2, const Twine &Name=Twine(), Instruction *InsertBefore=nullptr)
Construct a binary instruction, given the opcode and the two operands.
void setWeak(bool IsWeak)
LLVM_ATTRIBUTE_UNUSED_RESULT std::enable_if< !is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
ZExtInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
FCmpInst(Instruction *InsertBefore, Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
Constructor with insert-before-instruction semantics.
Value * getCondition() const
BitCastInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
const AttributeSet & getAttributes() const
getAttributes - Return the parameter attributes for this call.
static bool isConstantAllOnes(const Value *V)
CompositeType - Common super class of ArrayType, StructType, PointerType and VectorType.
const Type * getScalarType() const LLVM_READONLY
getScalarType - If this is a vector type, return the element type, otherwise return 'this'...
APInt And(const APInt &LHS, const APInt &RHS)
Bitwise AND function for APInt.
static Instruction * CreateMalloc(Instruction *InsertBefore, Type *IntPtrTy, Type *AllocTy, Value *AllocSize, Value *ArraySize=nullptr, Function *MallocF=nullptr, const Twine &Name="")
CreateMalloc - Generate the IR for a call to malloc:
AllocaInst * cloneImpl() const
static Type * getIndexedType(Type *Ty, ArrayRef< Value * > IdxList)
getIndexedType - Returns the type of the element that would be loaded with a load instruction with th...
static Instruction * createFree(Value *Source, Instruction *InsertBefore, BasicBlock *InsertAtEnd)
InsertElementInst * cloneImpl() const
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static CastInst * Create(Instruction::CastOps, Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Provides a way to construct any of the CastInst subclasses using an opcode instead of the subclass's ...
BasicBlock * getSuccessor(unsigned idx) const
Value * getCondition() const
const AttributeSet & getAttributes() const
getAttributes - Return the parameter attributes for this invoke.
BasicBlock * getDefaultDest() const
AttributeSet addAttribute(LLVMContext &C, unsigned Index, Attribute::AttrKind Attr) const
Add an attribute to the attribute set at the given index.
bool isAggregateType() const
isAggregateType - Return true if the type is an aggregate type.
unsigned getNumSuccessors() const
static IntegerType * getInt32Ty(LLVMContext &C)
AtomicOrdering getOrdering() const
Returns the ordering effect of this fence.
static CastInst * CreateTruncOrBitCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a Trunc or BitCast cast instruction.
unsigned greater or equal
AttributeSet addDereferenceableOrNullAttr(LLVMContext &C, unsigned Index, uint64_t Bytes) const
Add the dereferenceable_or_null attribute to the attribute set at the given index.
unsigned getAlignment() const
getAlignment - Return the alignment of the access that is being performed
static bool isFNeg(const Value *V, bool IgnoreZeroSign=false)
void setOperation(BinOp Operation)
static Instruction::CastOps getCastOpcode(const Value *Val, bool SrcIsSigned, Type *Ty, bool DstIsSigned)
Returns the opcode necessary to cast Val into Ty using usual casting rules.
void setSuccessor(unsigned idx, BasicBlock *NewSucc)
static Constant * getZeroValueForNegation(Type *Ty)
Floating point negation must be implemented with f(x) = -0.0 - x.
This class represents a cast unsigned integer to floating point.
0 1 1 0 True if ordered and operands are unequal
float convertToFloat() const
Compile-time customization of User operands.
static ConstantRange makeConstantRange(Predicate pred, const APInt &C)
Initialize a set of values that all satisfy the predicate with C.
unsigned getNumSuccessors() const
VectorType * getType() const
getType - Overload to return most specific vector type.
bool paramHasAttr(unsigned i, Attribute::AttrKind A) const
Determine whether the call or the callee has the given attributes.
IntToPtrInst * cloneImpl() const
Clone an identical IntToPtrInst.
bool hasNoSignedZeros() const
Determine whether the no-signed-zeros flag is set.
void removeCase(CaseIt i)
removeCase - This method removes the specified case and its successor from the switch instruction...
1 0 1 0 True if unordered or greater than
unsigned getNumCases() const
getNumCases - return the number of 'cases' in this switch instruction, except the default case ...
void addDestination(BasicBlock *Dest)
addDestination - Add a destination.
ResumeInst * cloneImpl() const
const APFloat & getValueAPF() const
SwitchInst - Multiway switch.
static CastInst * CreateSExtOrBitCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a SExt or BitCast cast instruction.
This class represents a cast from signed integer to floating point.
bool isUnsigned() const
Determine if this instruction is using an unsigned comparison.
bool isWeak() const
Return true if this cmpxchg may spuriously fail.
GetElementPtrInst * cloneImpl() const
void setAttributes(const AttributeSet &Attrs)
setAttributes - Set the parameter attributes for this call.
const ARM::ArchExtKind Kind
static APInt getSignedMinValue(unsigned numBits)
Gets minimum signed value of APInt for a specific bit width.
const BasicBlock & front() const
This class represents a truncation of floating point types.
unsigned getPrimitiveSizeInBits() const LLVM_READONLY
getPrimitiveSizeInBits - Return the basic size of this type if it is a primitive type.
void setSuccessOrdering(AtomicOrdering Ordering)
Set the ordering constraint on this cmpxchg.
0 0 0 1 True if ordered and equal
LLVM Value Representation.
void setAlignment(unsigned Align)
FPExtInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
bool hasNoUnsignedWrap() const
Determine whether the no unsigned wrap flag is set.
FPToSIInst * cloneImpl() const
Clone an identical FPToSIInst.
1 0 1 1 True if unordered, greater than, or equal
void allocHungoffUses(unsigned N, bool IsPhi=false)
Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User.
const Value * getArraySize() const
getArraySize - Get the number of elements allocated.
static bool isUnordered(unsigned short predicate)
Determine if the predicate is an unordered operation.
static Value * getAISize(LLVMContext &Context, Value *Amt)
StoreInst(Value *Val, Value *Ptr, Instruction *InsertBefore)
InvokeInst - Invoke instruction.
void setSynchScope(SynchronizationScope SynchScope)
Specify whether this RMW orders other operations with respect to all concurrently executing threads...
TruncInst * cloneImpl() const
Clone an identical TruncInst.
Predicate getSignedPredicate() const
For example, EQ->EQ, SLE->SLE, UGT->SGT, etc.
bool isCleanup() const
isCleanup - Return 'true' if this landingpad instruction is a cleanup.
Convenience struct for specifying and reasoning about fast-math flags.
StringRef - Represent a constant reference to a string, i.e.
AtomicCmpXchgInst(Value *Ptr, Value *Cmp, Value *NewVal, AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering, SynchronizationScope SynchScope, Instruction *InsertBefore=nullptr)
ICmpInst(Instruction *InsertBefore, Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
Constructor with insert-before-instruction semantics.
CallingConv::ID getCallingConv() const
getCallingConv/setCallingConv - Get or set the calling convention of this function call...
static bool isVolatile(Instruction *Inst)
void setNumHungOffUseOperands(unsigned NumOps)
Subclasses with hung off uses need to manage the operand count themselves.
static Constant * getMul(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
FenceInst * cloneImpl() const
static BinaryOperator * CreateMul(Value *S1, Value *S2, const Twine &Name, Instruction *InsertBefore, Value *FlagsOp)
Type * getAllocatedType() const
getAllocatedType - Return the type that is being allocated by the instruction.
This class represents an extension of floating point types.
0 0 1 1 True if ordered and greater than or equal
void setVolatile(bool V)
setVolatile - Specify whether this is a volatile load or not.
SynchronizationScope getSynchScope() const
Returns whether this cmpxchg is atomic between threads or only within a single thread.
bool isCall() const
isCall - true if a CallInst is enclosed.
FPTruncInst * cloneImpl() const
Clone an identical FPTruncInst.
InsertValueInst * cloneImpl() const
unsigned getNumSuccessors() const
void removeDestination(unsigned i)
removeDestination - This method removes the specified successor from the indirectbr instruction...
const BasicBlock * getParent() const
bool isOne() const
This is just a convenience method to make client code smaller for a common case.
SmallVector< int, 16 > getShuffleMask() const
FenceInst(LLVMContext &C, AtomicOrdering Ordering, SynchronizationScope SynchScope=CrossThread, Instruction *InsertBefore=nullptr)
void addDereferenceableAttr(unsigned i, uint64_t Bytes)
adds the dereferenceable attribute to the list of attributes.
0 0 0 0 Always false (always folded)
AddrSpaceCastInst * cloneImpl() const
Clone an identical AddrSpaceCastInst.
LLVMContext & getContext() const
Get the global data context.
PHINode * cloneImpl() const
bool isVoidTy() const
isVoidTy - Return true if this is 'void'.
AllocaInst - an instruction to allocate memory on the stack.
SelectInst * cloneImpl() const
InsertValueInst - This instruction inserts a struct field of array element value into an aggregate va...
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results...
bool isVolatile() const
isVolatile - Return true if this is a RMW on a volatile memory location.
static const char * areInvalidOperands(Value *Cond, Value *True, Value *False)
areInvalidOperands - Return a string if the specified operands are invalid for a select operation...