16 #ifndef LLVM_IR_INSTRUCTIONS_H
17 #define LLVM_IR_INSTRUCTIONS_H
156 return (I->
getOpcode() == Instruction::Alloca);
159 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
164 void setInstructionSubclassData(
unsigned short D) {
198 NameStr, isVolatile, Align, InsertBefore) {}
207 NameStr, isVolatile, Align, Order, SynchScope, InsertBefore) {}
299 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
304 void setInstructionSubclassData(
unsigned short D) {
317 void *
operator new(size_t,
unsigned) =
delete;
326 void *
operator new(
size_t s) {
327 return User::operator
new(s, 2);
423 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
428 void setInstructionSubclassData(
unsigned short D) {
446 void *
operator new(size_t,
unsigned) =
delete;
450 friend class Instruction;
455 void *
operator new(
size_t s) {
456 return User::operator
new(s, 0);
463 Instruction *InsertBefore =
nullptr);
476 setInstructionSubclassData((getSubclassDataFromInstruction() & 1) |
488 setInstructionSubclassData((getSubclassDataFromInstruction() & ~1) |
494 return I->
getOpcode() == Instruction::Fence;
497 return isa<Instruction>(V) && classof(cast<Instruction>(V));
502 void setInstructionSubclassData(
unsigned short D) {
516 void *
operator new(size_t,
unsigned) =
delete;
527 void *
operator new(
size_t s) {
528 return User::operator
new(s, 3);
571 "CmpXchg instructions can only be atomic.");
578 "CmpXchg instructions can only be atomic.");
631 switch (SuccessOrdering) {
646 return I->
getOpcode() == Instruction::AtomicCmpXchg;
649 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
654 void setInstructionSubclassData(
unsigned short D) {
675 void *
operator new(size_t,
unsigned) =
delete;
678 friend class Instruction;
716 void *
operator new(
size_t s) {
717 return User::operator
new(s, 2);
721 Instruction *InsertBefore =
nullptr);
727 return static_cast<BinOp>(getSubclassDataFromInstruction() >> 5);
731 unsigned short SubclassData = getSubclassDataFromInstruction();
732 setInstructionSubclassData((SubclassData & 31) |
739 return getSubclassDataFromInstruction() & 1;
745 setInstructionSubclassData((getSubclassDataFromInstruction() & ~1) |
755 "atomicrmw instructions can only be atomic.");
756 setInstructionSubclassData((getSubclassDataFromInstruction() & ~(7 << 2)) |
764 setInstructionSubclassData((getSubclassDataFromInstruction() & ~2) |
770 return AtomicOrdering((getSubclassDataFromInstruction() >> 2) & 7);
793 return I->
getOpcode() == Instruction::AtomicRMW;
796 return isa<Instruction>(V) && classof(cast<Instruction>(V));
803 void setInstructionSubclassData(
unsigned short D) {
823 assert(Ty &&
"Invalid GetElementPtrInst indices for type!");
831 Type *SourceElementType;
832 Type *ResultElementType;
856 const Twine &NameStr =
"",
867 NameStr, InsertBefore);
871 const Twine &NameStr,
882 NameStr, InsertAtEnd);
889 const Twine &NameStr =
"",
891 return CreateInBounds(
nullptr, Ptr, IdxList, NameStr, InsertBefore);
895 const Twine &NameStr =
"",
898 Create(PointeeType, Ptr, IdxList, NameStr, InsertBefore);
904 const Twine &NameStr,
906 return CreateInBounds(
nullptr, Ptr, IdxList, NameStr, InsertAtEnd);
910 const Twine &NameStr,
913 Create(PointeeType, Ptr, IdxList, NameStr, InsertAtEnd);
932 assert(ResultElementType ==
933 cast<PointerType>(
getType()->getScalarType())->getElementType());
934 return ResultElementType;
996 for (
Value *Index : IdxList)
997 if (Index->getType()->isVectorTy()) {
998 unsigned NumElem = Index->getType()->getVectorNumElements();
1042 return (I->
getOpcode() == Instruction::GetElementPtr);
1045 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
1054 GetElementPtrInst::GetElementPtrInst(
Type *PointeeType,
Value *Ptr,
1056 const Twine &NameStr,
1058 :
Instruction(getGEPReturnType(PointeeType, Ptr, IdxList), GetElementPtr,
1060 Values, InsertBefore),
1061 SourceElementType(PointeeType),
1062 ResultElementType(getIndexedType(PointeeType, IdxList)) {
1063 assert(ResultElementType ==
1064 cast<PointerType>(
getType()->getScalarType())->getElementType());
1065 init(Ptr, IdxList, NameStr);
1067 GetElementPtrInst::GetElementPtrInst(
Type *PointeeType, Value *Ptr,
1068 ArrayRef<Value *> IdxList,
unsigned Values,
1069 const Twine &NameStr,
1071 : Instruction(getGEPReturnType(PointeeType, Ptr, IdxList), GetElementPtr,
1072 OperandTraits<GetElementPtrInst>::op_end(this) - Values,
1073 Values, InsertAtEnd),
1074 SourceElementType(PointeeType),
1075 ResultElementType(getIndexedType(PointeeType, IdxList)) {
1076 assert(ResultElementType ==
1077 cast<PointerType>(
getType()->getScalarType())->getElementType());
1078 init(Ptr, IdxList, NameStr);
1097 "Invalid ICmp predicate value");
1099 "Both operands to ICmp instruction are not of the same type!");
1101 assert((getOperand(0)->
getType()->isIntOrIntVectorTy() ||
1102 getOperand(0)->
getType()->isPtrOrPtrVectorTy()) &&
1103 "Invalid operand types for ICmp instruction");
1119 const Twine &NameStr =
""
1120 ) : CmpInst(makeCmpResultType(LHS->
getType()),
1134 const Twine &NameStr =
""
1135 ) : CmpInst(makeCmpResultType(LHS->
getType()),
1148 const Twine &NameStr =
""
1149 ) : CmpInst(makeCmpResultType(LHS->
getType()),
1161 return getSignedPredicate(getPredicate());
1173 return getUnsignedPredicate(getPredicate());
1189 return isEquality(getPredicate());
1199 return !isEquality();
1205 return !isEquality(P);
1219 Op<0>().
swap(Op<1>());
1224 return I->
getOpcode() == Instruction::ICmp;
1227 return isa<Instruction>(V) && classof(cast<Instruction>(V));
1254 const Twine &NameStr =
""
1259 "Invalid FCmp predicate value");
1261 "Both operands to FCmp instruction are not of the same type!");
1264 "Invalid operand types for FCmp instruction");
1273 const Twine &NameStr =
""
1278 "Invalid FCmp predicate value");
1280 "Both operands to FCmp instruction are not of the same type!");
1283 "Invalid operand types for FCmp instruction");
1291 const Twine &NameStr =
""
1295 "Invalid FCmp predicate value");
1297 "Both operands to FCmp instruction are not of the same type!");
1300 "Invalid operand types for FCmp instruction");
1335 Op<0>().
swap(Op<1>());
1340 return I->
getOpcode() == Instruction::FCmp;
1343 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
1358 init(cast<FunctionType>(
1359 cast<PointerType>(Func->
getType())->getElementType()),
1360 Func, Args, NameStr);
1363 const Twine &NameStr);
1364 void init(
Value *Func,
const Twine &NameStr);
1373 cast<PointerType>(Func->
getType())->getElementType()),
1374 Func, Args, NameStr, InsertBefore) {}
1392 const Twine &NameStr =
"",
1394 return Create(cast<FunctionType>(
1395 cast<PointerType>(Func->
getType())->getElementType()),
1396 Func, Args, NameStr, InsertBefore);
1399 const Twine &NameStr =
"",
1402 CallInst(Ty, Func, Args, NameStr, InsertBefore);
1408 CallInst(Func, Args, NameStr, InsertAtEnd);
1412 return new(1)
CallInst(F, NameStr, InsertBefore);
1416 return new(1)
CallInst(F, NameStr, InsertAtEnd);
1426 Value *AllocSize,
Value *ArraySize =
nullptr,
1431 Value *AllocSize,
Value *ArraySize =
nullptr,
1502 (static_cast<unsigned>(CC) << 2));
1532 "Use CallInst::isNoBuiltin() to check for Attribute::NoBuiltin");
1533 return hasFnAttrImpl(A);
1538 return hasFnAttrImpl(A);
1652 cast<FunctionType>(cast<PointerType>(Fn->
getType())->getElementType()),
1657 assert(FTy == cast<FunctionType>(
1658 cast<PointerType>(Fn->
getType())->getElementType()));
1664 return isa<InlineAsm>(
Op<-1>());
1672 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
1676 template<
typename AttrKind>
1677 bool hasFnAttrImpl(AttrKind
A)
const {
1687 void setInstructionSubclassData(
unsigned short D) {
1699 ->getElementType())->getReturnType(),
1703 init(Func, Args, NameStr);
1706 CallInst::CallInst(FunctionType *Ty, Value *Func, ArrayRef<Value *> Args,
1707 const Twine &NameStr, Instruction *InsertBefore)
1708 : Instruction(Ty->getReturnType(), Instruction::
Call,
1709 OperandTraits<CallInst>::op_end(this) - (Args.
size() + 1),
1711 init(Ty, Func, Args, NameStr);
1728 assert(!areInvalidOperands(C, S1, S2) &&
"Invalid operands for select");
1735 Instruction *InsertBefore)
1737 &Op<0>(), 3, InsertBefore) {
1744 &Op<0>(), 3, InsertAtEnd) {
1750 friend class Instruction;
1755 const Twine &NameStr =
"",
1756 Instruction *InsertBefore =
nullptr) {
1757 return new(3)
SelectInst(C, S1, S2, NameStr, InsertBefore);
1760 const Twine &NameStr,
1762 return new(3)
SelectInst(C, S1, S2, NameStr, InsertAtEnd);
1774 static const char *areInvalidOperands(
Value *Cond,
Value *True,
Value *False);
1788 return isa<Instruction>(V) && classof(cast<Instruction>(V));
1814 : UnaryInstruction(Ty, VAArg, List, InsertBefore) {
1819 : UnaryInstruction(Ty, VAArg, List, InsertAtEnd) {
1832 return isa<Instruction>(V) && classof(cast<Instruction>(V));
1855 const Twine &NameStr =
"",
1860 const Twine &NameStr,
1887 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
1907 const Twine &NameStr =
"",
1908 Instruction *InsertBefore =
nullptr);
1913 friend class Instruction;
1918 const Twine &NameStr =
"",
1919 Instruction *InsertBefore =
nullptr) {
1923 const Twine &NameStr,
1930 static bool isValidOperands(
const Value *Vec,
const Value *NewElt,
1944 return I->
getOpcode() == Instruction::InsertElement;
1947 return isa<Instruction>(V) && classof(cast<Instruction>(V));
1968 friend class Instruction;
1973 void *
operator new(
size_t s) {
1974 return User::operator
new(s, 3);
1977 const Twine &NameStr =
"",
1978 Instruction *InsertBefor =
nullptr);
1984 static bool isValidOperands(
const Value *V1,
const Value *
V2,
1997 return cast<Constant>(getOperand(2));
2003 static int getMaskValue(
Constant *Mask,
unsigned i);
2006 return getMaskValue(getMask(), i);
2014 return getShuffleMask(getMask(), Result);
2019 getShuffleMask(Mask);
2026 return I->
getOpcode() == Instruction::ShuffleVector;
2029 return isa<Instruction>(V) && classof(cast<Instruction>(V));
2059 const Twine &NameStr,
2066 void *
operator new(
size_t s) {
2067 return User::operator
new(s, 1);
2077 const Twine &NameStr =
"",
2084 const Twine &NameStr,
2103 return getOperand(0);
2106 return getOperand(0);
2117 return (
unsigned)Indices.
size();
2126 return I->
getOpcode() == Instruction::ExtractValue;
2129 return isa<Instruction>(V) && classof(cast<Instruction>(V));
2133 ExtractValueInst::ExtractValueInst(Value *Agg,
2134 ArrayRef<unsigned> Idxs,
2135 const Twine &NameStr,
2136 Instruction *InsertBefore)
2138 ExtractValue, Agg, InsertBefore) {
2139 init(Idxs, NameStr);
2141 ExtractValueInst::ExtractValueInst(Value *Agg,
2142 ArrayRef<unsigned> Idxs,
2143 const Twine &NameStr,
2146 ExtractValue, Agg, InsertAtEnd) {
2147 init(Idxs, NameStr);
2161 void *
operator new(size_t,
unsigned) =
delete;
2164 const Twine &NameStr);
2170 inline InsertValueInst(
Value *Agg,
Value *Val,
2172 const Twine &NameStr,
2174 inline InsertValueInst(
Value *Agg,
Value *Val,
2181 unsigned Idx,
const Twine &NameStr =
"",
2183 InsertValueInst(
Value *Agg,
Value *Val,
unsigned Idx,
2192 void *
operator new(
size_t s) {
2193 return User::operator
new(s, 2);
2198 const Twine &NameStr =
"",
2200 return new InsertValueInst(Agg, Val, Idxs, NameStr, InsertBefore);
2204 const Twine &NameStr,
2206 return new InsertValueInst(Agg, Val, Idxs, NameStr, InsertAtEnd);
2244 return (
unsigned)Indices.
size();
2253 return I->
getOpcode() == Instruction::InsertValue;
2256 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
2265 InsertValueInst::InsertValueInst(
Value *Agg,
2268 const Twine &NameStr,
2273 init(Agg, Val, Idxs, NameStr);
2275 InsertValueInst::InsertValueInst(Value *Agg,
2277 ArrayRef<unsigned> Idxs,
2278 const Twine &NameStr,
2280 : Instruction(Agg->
getType(), InsertValue,
2281 OperandTraits<InsertValueInst>::op_begin(this),
2283 init(Agg, Val, Idxs, NameStr);
2297 void *
operator new(size_t,
unsigned) =
delete;
2300 unsigned ReservedSpace;
2303 void *
operator new(
size_t s) {
2304 return User::operator
new(s);
2306 explicit PHINode(
Type *Ty,
unsigned NumReservedValues,
2307 const Twine &NameStr =
"",
2308 Instruction *InsertBefore =
nullptr)
2310 ReservedSpace(NumReservedValues) {
2312 allocHungoffUses(ReservedSpace);
2318 ReservedSpace(NumReservedValues) {
2320 allocHungoffUses(ReservedSpace);
2331 friend class Instruction;
2338 const Twine &NameStr =
"",
2339 Instruction *InsertBefore =
nullptr) {
2340 return new PHINode(Ty, NumReservedValues, NameStr, InsertBefore);
2344 return new PHINode(Ty, NumReservedValues, NameStr, InsertAtEnd);
2358 reinterpret_cast<Use::UserRef*
>(op_begin() + ReservedSpace);
2359 return reinterpret_cast<block_iterator
>(ref + 1);
2364 reinterpret_cast<const Use::UserRef*
>(op_begin() + ReservedSpace);
2365 return reinterpret_cast<const_block_iterator
>(ref + 1);
2369 return block_begin() + getNumOperands();
2373 return block_begin() + getNumOperands();
2387 return getOperand(i);
2402 return block_begin()[i];
2409 assert(
this == U.
getUser() &&
"Iterator doesn't point to PHI's Uses?");
2410 return getIncomingBlock(
unsigned(&U - op_begin()));
2417 return getIncomingBlock(I.getUse());
2421 block_begin()[i] = BB;
2427 assert(V &&
"PHI node got a null value!");
2428 assert(BB &&
"PHI node got a null basic block!");
2430 "All operands to PHI node must be the same type as the PHI node!");
2431 if (getNumOperands() == ReservedSpace)
2434 setNumHungOffUseOperands(getNumOperands() + 1);
2435 setIncomingValue(getNumOperands() - 1, V);
2436 setIncomingBlock(getNumOperands() - 1, BB);
2447 Value *removeIncomingValue(
unsigned Idx,
bool DeletePHIIfEmpty =
true);
2450 int Idx = getBasicBlockIndex(BB);
2451 assert(Idx >= 0 &&
"Invalid basic block argument to remove!");
2452 return removeIncomingValue(Idx, DeletePHIIfEmpty);
2459 for (
unsigned i = 0, e = getNumOperands(); i != e; ++i)
2460 if (block_begin()[i] == BB)
2466 int Idx = getBasicBlockIndex(BB);
2467 assert(Idx >= 0 &&
"Invalid basic block argument!");
2468 return getIncomingValue(Idx);
2473 Value *hasConstantValue()
const;
2480 return isa<Instruction>(V) && classof(cast<Instruction>(V));
2483 void growOperands();
2507 unsigned ReservedSpace;
2512 void *
operator new(size_t,
unsigned) =
delete;
2514 void *
operator new(
size_t s) {
2515 return User::operator
new(s);
2517 void growOperands(
unsigned Size);
2518 void init(
unsigned NumReservedValues,
const Twine &NameStr);
2520 explicit LandingPadInst(
Type *RetTy,
unsigned NumReservedValues,
2521 const Twine &NameStr, Instruction *InsertBefore);
2522 explicit LandingPadInst(
Type *RetTy,
unsigned NumReservedValues,
2523 const Twine &NameStr,
BasicBlock *InsertAtEnd);
2527 friend class Instruction;
2534 const Twine &NameStr =
"",
2535 Instruction *InsertBefore =
nullptr);
2545 bool isCleanup()
const {
return getSubclassDataFromInstruction() & 1; }
2549 setInstructionSubclassData((getSubclassDataFromInstruction() & ~1) |
2554 void addClause(
Constant *ClauseVal);
2559 return cast<Constant>(getOperandList()[Idx]);
2564 return !isa<ArrayType>(getOperandList()[Idx]->getType());
2569 return isa<ArrayType>(getOperandList()[Idx]->getType());
2581 return I->
getOpcode() == Instruction::LandingPad;
2584 return isa<Instruction>(V) && classof(cast<Instruction>(V));
2629 return new(!!retVal)
ReturnInst(C, retVal, InsertBefore);
2633 return new(!!retVal)
ReturnInst(C, retVal, InsertAtEnd);
2645 return getNumOperands() != 0 ? getOperand(0) :
nullptr;
2655 return isa<Instruction>(V) && classof(cast<Instruction>(V));
2658 BasicBlock *getSuccessorV(
unsigned idx)
const override;
2659 unsigned getNumSuccessorsV()
const override;
2660 void setSuccessorV(
unsigned idx,
BasicBlock *B)
override;
2704 return new(1)
BranchInst(IfTrue, InsertBefore);
2708 return new(3)
BranchInst(IfTrue, IfFalse, Cond, InsertBefore);
2711 return new(1)
BranchInst(IfTrue, InsertAtEnd);
2715 return new(3)
BranchInst(IfTrue, IfFalse, Cond, InsertAtEnd);
2725 assert(isConditional() &&
"Cannot get condition of an uncond branch!");
2730 assert(isConditional() &&
"Cannot set condition of unconditional branch!");
2737 assert(i < getNumSuccessors() &&
"Successor # out of range for Branch!");
2738 return cast_or_null<BasicBlock>((&Op<-1>() - i)->get());
2742 assert(idx < getNumSuccessors() &&
"Successor # out of range for Branch!");
2743 *(&Op<-1>() - idx) = (
Value*)NewSucc;
2751 void swapSuccessors();
2755 return (I->
getOpcode() == Instruction::Br);
2758 return isa<Instruction>(V) && classof(cast<Instruction>(V));
2761 BasicBlock *getSuccessorV(
unsigned idx)
const override;
2762 unsigned getNumSuccessorsV()
const override;
2763 void setSuccessorV(
unsigned idx,
BasicBlock *B)
override;
2780 void *
operator new(size_t,
unsigned) =
delete;
2781 unsigned ReservedSpace;
2788 void growOperands();
2790 void *
operator new(
size_t s) {
2791 return User::operator
new(s);
2814 static const unsigned DefaultPseudoIndex =
static_cast<unsigned>(~0L-1);
2816 template <
class SwitchInstTy,
class ConstantIntTy,
class BasicBlockTy>
2837 assert(SuccessorIndex < SI->getNumSuccessors() &&
2838 "Successor index # out of range!");
2839 return SuccessorIndex != 0 ?
2840 Self(SI, SuccessorIndex - 1) :
2841 Self(SI, DefaultPseudoIndex);
2846 assert(Index < SI->getNumCases() &&
"Index out the number of cases.");
2847 return reinterpret_cast<ConstantIntTy*
>(SI->
getOperand(2 + Index*2));
2852 assert((Index < SI->getNumCases() ||
2853 Index == DefaultPseudoIndex) &&
2854 "Index out the number of cases.");
2863 assert((Index == DefaultPseudoIndex || Index < SI->getNumCases()) &&
2864 "Index out the number of cases.");
2865 return Index != DefaultPseudoIndex ? Index + 1 : 0;
2871 assert(Index+1 <= SI->
getNumCases() &&
"Index out the number of cases.");
2884 assert((Index == 0 || Index-1 <= SI->
getNumCases()) &&
2885 "Index out the number of cases.");
2895 assert(RHS.
SI == SI &&
"Incompatible operators.");
2896 return RHS.
Index == Index;
2899 assert(RHS.
SI == SI &&
"Incompatible operators.");
2900 return RHS.
Index != Index;
2907 typedef CaseIteratorT<const SwitchInst, const ConstantInt, const BasicBlock>
2921 assert(Index < SI->getNumCases() &&
"Index out the number of cases.");
2922 SI->
setOperand(2 + Index*2, reinterpret_cast<Value*>(V));
2934 return new SwitchInst(Value, Default, NumCases, InsertBefore);
2937 unsigned NumCases,
BasicBlock *InsertAtEnd) {
2938 return new SwitchInst(Value, Default, NumCases, InsertAtEnd);
2949 return cast<BasicBlock>(getOperand(1));
2953 setOperand(1, reinterpret_cast<Value*>(DefaultCase));
2959 return getNumOperands()/2 - 1;
2976 return CaseIt(
this, getNumCases());
3000 return CaseIt(
this, DefaultPseudoIndex);
3011 for (
CaseIt i = case_begin(), e = case_end(); i != e; ++i)
3012 if (i.getCaseValue() == C)
3014 return case_default();
3017 for (
ConstCaseIt i = case_begin(), e = case_end(); i != e; ++i)
3018 if (i.getCaseValue() == C)
3020 return case_default();
3026 if (BB == getDefaultDest())
return nullptr;
3029 for (
CaseIt i = case_begin(), e = case_end(); i != e; ++i) {
3030 if (i.getCaseSuccessor() == BB) {
3031 if (CI)
return nullptr;
3032 else CI = i.getCaseValue();
3050 void removeCase(CaseIt i);
3054 assert(idx < getNumSuccessors() &&
"Successor idx out of range for switch!");
3055 return cast<BasicBlock>(getOperand(idx*2+1));
3058 assert(idx < getNumSuccessors() &&
"Successor # out of range for switch!");
3059 setOperand(idx*2+1, (Value*)NewSucc);
3064 return I->
getOpcode() == Instruction::Switch;
3067 return isa<Instruction>(V) && classof(cast<Instruction>(V));
3070 BasicBlock *getSuccessorV(
unsigned idx)
const override;
3071 unsigned getNumSuccessorsV()
const override;
3072 void setSuccessorV(
unsigned idx,
BasicBlock *B)
override;
3090 void *
operator new(size_t,
unsigned) =
delete;
3091 unsigned ReservedSpace;
3098 void growOperands();
3100 void *
operator new(
size_t s) {
3101 return User::operator
new(s);
3152 void removeDestination(
unsigned i);
3156 return cast<BasicBlock>(getOperand(i+1));
3159 setOperand(i+1, (
Value*)NewSucc);
3164 return I->
getOpcode() == Instruction::IndirectBr;
3167 return isa<Instruction>(V) && classof(cast<Instruction>(V));
3170 BasicBlock *getSuccessorV(
unsigned idx)
const override;
3171 unsigned getNumSuccessorsV()
const override;
3172 void setSuccessorV(
unsigned idx,
BasicBlock *B)
override;
3195 init(cast<FunctionType>(
3196 cast<PointerType>(Func->
getType())->getElementType()),
3197 Func, IfNormal, IfException, Args, NameStr);
3201 const Twine &NameStr);
3210 cast<PointerType>(Func->
getType())->getElementType()),
3211 Func, IfNormal, IfException, Args, Values, NameStr,
3216 unsigned Values,
const Twine &NameStr,
3234 return Create(cast<FunctionType>(
3235 cast<PointerType>(Func->
getType())->getElementType()),
3236 Func, IfNormal, IfException, Args, NameStr, InsertBefore);
3240 const Twine &NameStr =
"",
3243 return new (Values)
InvokeInst(Ty, Func, IfNormal, IfException, Args,
3244 Values, NameStr, InsertBefore);
3251 return new(Values)
InvokeInst(Func, IfNormal, IfException, Args,
3252 Values, NameStr, InsertAtEnd);
3291 return static_cast<CallingConv::ID>(getSubclassDataFromInstruction());
3294 setInstructionSubclassData(static_cast<unsigned>(CC));
3309 void removeAttribute(
unsigned i,
Attribute attr);
3312 void addDereferenceableAttr(
unsigned i, uint64_t Bytes);
3316 void addDereferenceableOrNullAttr(
unsigned i, uint64_t Bytes);
3321 "Use CallInst::isNoBuiltin() to check for Attribute::NoBuiltin");
3322 return hasFnAttrImpl(A);
3430 cast<FunctionType>(cast<PointerType>(Fn->
getType())->getElementType()),
3435 assert(FTy == cast<FunctionType>(
3436 cast<PointerType>(Fn->
getType())->getElementType()));
3442 return cast<BasicBlock>(Op<-2>());
3445 return cast<BasicBlock>(Op<-1>());
3448 Op<-2>() = reinterpret_cast<Value*>(B);
3451 Op<-1>() = reinterpret_cast<Value*>(B);
3459 assert(i < 2 &&
"Successor # out of range for invoke!");
3460 return i == 0 ? getNormalDest() : getUnwindDest();
3464 assert(idx < 2 &&
"Successor # out of range for invoke!");
3465 *(&Op<-2>() + idx) =
reinterpret_cast<Value*
>(NewSucc);
3472 return (I->
getOpcode() == Instruction::Invoke);
3475 return isa<Instruction>(V) && classof(cast<Instruction>(V));
3479 BasicBlock *getSuccessorV(
unsigned idx)
const override;
3480 unsigned getNumSuccessorsV()
const override;
3481 void setSuccessorV(
unsigned idx,
BasicBlock *B)
override;
3487 void setInstructionSubclassData(
unsigned short D) {
3498 unsigned Values,
const Twine &NameStr,
3503 init(Ty, Func, IfNormal, IfException, Args, NameStr);
3505 InvokeInst::InvokeInst(Value *Func,
3507 ArrayRef<Value *> Args,
unsigned Values,
3508 const Twine &NameStr,
BasicBlock *InsertAtEnd)
3509 : TerminatorInst(
cast<FunctionType>(
cast<PointerType>(Func->
getType())
3510 ->getElementType())->getReturnType(),
3511 Instruction::Invoke,
3512 OperandTraits<InvokeInst>::op_end(this) - Values,
3513 Values, InsertAtEnd) {
3514 init(Func, IfNormal, IfException, Args, NameStr);
3554 return I->
getOpcode() == Instruction::Resume;
3557 return isa<Instruction>(V) && classof(cast<Instruction>(V));
3560 BasicBlock *getSuccessorV(
unsigned idx)
const override;
3561 unsigned getNumSuccessorsV()
const override;
3562 void setSuccessorV(
unsigned idx,
BasicBlock *B)
override;
3582 void *
operator new(size_t,
unsigned) =
delete;
3590 void *
operator new(
size_t s) {
3591 return User::operator
new(s, 0);
3600 return I->
getOpcode() == Instruction::Unreachable;
3603 return isa<Instruction>(V) && classof(cast<Instruction>(V));
3606 BasicBlock *getSuccessorV(
unsigned idx)
const override;
3607 unsigned getNumSuccessorsV()
const override;
3608 void setSuccessorV(
unsigned idx,
BasicBlock *B)
override;
3628 const Twine &NameStr =
"",
3636 const Twine &NameStr,
3645 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3666 const Twine &NameStr =
"",
3674 const Twine &NameStr,
3683 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3704 const Twine &NameStr =
"",
3712 const Twine &NameStr,
3721 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3742 const Twine &NameStr =
"",
3750 const Twine &NameStr,
3759 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3780 const Twine &NameStr =
"",
3788 const Twine &NameStr,
3797 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3818 const Twine &NameStr =
"",
3826 const Twine &NameStr,
3835 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3856 const Twine &NameStr =
"",
3864 const Twine &NameStr,
3873 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3894 const Twine &NameStr =
"",
3902 const Twine &NameStr,
3911 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3932 const Twine &NameStr =
"",
3940 const Twine &NameStr,
3949 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3964 const Twine &NameStr =
"",
3972 const Twine &NameStr,
3991 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
4012 const Twine &NameStr =
"",
4020 const Twine &NameStr,
4041 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
4062 const Twine &NameStr =
"",
4070 const Twine &NameStr,
4079 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
4101 const Twine &NameStr =
"",
4109 const Twine &NameStr,
4118 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
static unsigned getInsertedValueOperandIndex()
const Value * getAddress() const
const Use & getOperandUse(unsigned i) const
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.
Value * getValueOperand()
const Value * getCalledValue() const
getCalledValue - Get a pointer to the function that is invoked by this instruction.
bool hasStructRetAttr() const
Determine if the call returns a structure through first pointer argument.
void setAttributes(const AttributeSet &Attrs)
setAttributes - Set the parameter attributes for this invoke.
AllocaInst(Type *Ty, Value *ArraySize=nullptr, const Twine &Name="", Instruction *InsertBefore=nullptr)
static bool isEquality(Predicate Pred)
Determine if this is an equality predicate.
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.
Value * getPointerOperand()
static bool classof(const Instruction *I)
CaseIt case_end()
Returns a read/write iterator that points one past the last in the SwitchInst.
This class is the base class for the comparison instructions.
ConstantIntTy * getCaseValue()
Resolves case value for current case.
void getShuffleMask(SmallVectorImpl< int > &Result) const
void addIncoming(Value *V, BasicBlock *BB)
addIncoming - Add an incoming value to the end of the PHI list
*p = old <signed v ? old : v
iterator_range< CaseIt > cases()
cases - iteration adapter for range-for loops.
Value * getAggregateOperand()
static bool classof(const Instruction *I)
static bool classof(const Instruction *I)
static Type * makeCmpResultType(Type *opnd_type)
Create a result type for fcmp/icmp.
Type * getSourceElementType() const
static bool classof(const Value *V)
bool isVolatile() const
isVolatile - Return true if this is a store to a volatile memory location.
SynchronizationScope getSynchScope() const
ArrayRef< unsigned > getIndices() const
void setCalledFunction(Value *Fn)
setCalledFunction - Set the function called.
void allocHungoffUses(unsigned N)
static PHINode * Create(Type *Ty, unsigned NumReservedValues, const Twine &NameStr, BasicBlock *InsertAtEnd)
const Use & getArgOperandUse(unsigned i) const
Wrappers for getting the Use of a invoke argument.
Constant * getClause(unsigned Idx) const
Get the value of the clause at index Idx.
static ResumeInst * Create(Value *Exn, Instruction *InsertBefore=nullptr)
void setOrdering(AtomicOrdering Ordering)
Set the ordering constraint on this RMW.
static bool classof(const Instruction *I)
void setAlignment(unsigned Align)
AtomicOrdering getSuccessOrdering() const
Returns the ordering constraint on this cmpxchg.
FenceInst - an instruction for ordering other memory operations.
unsigned getSuccessorIndex() const
Returns TerminatorInst's successor index for current case successor.
AtomicCmpXchgInst - an instruction that atomically checks whether a specified value is in a memory lo...
bool isAtLeastAcquire(AtomicOrdering Ord)
Returns true if the ordering is at least as strong as acquire (i.e.
PtrToIntInst * cloneImpl() const
Clone an identical PtrToIntInst.
int getMaskValue(unsigned i) const
bool hasFnAttr(Attribute::AttrKind A) const
Determine whether this call has the given attribute.
iterator_range< const_op_iterator > arg_operands() const
arg_operands - iteration adapter for range-for loops.
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
void setSuccessor(BasicBlock *S)
Sets the new successor for current case.
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
Value * getValue() const
Convenience accessor.
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
Value * getPointerOperand()
Gets the pointer operand.
CallInst - This class represents a function call, abstracting a target machine's calling convention...
static bool classof(const Value *V)
void setOrdering(AtomicOrdering Ordering)
Set the ordering constraint on this load.
static unsigned getPointerOperandIndex()
Gets the operand index of the pointer operand.
static bool classof(const Value *V)
static PointerType * get(Type *ElementType, unsigned AddressSpace)
PointerType::get - This constructs a pointer to an object of the specified type in a numbered address...
Function * getCalledFunction() const
getCalledFunction - Return the function called, or null if this is an indirect function invocation...
CaseIt case_begin()
Returns a read/write iterator that points to the first case in SwitchInst.
*p = old <unsigned v ? old : v
void setAllocatedType(Type *Ty)
for use only in special circumstances that need to generically transform a whole instruction (eg: IR ...
CaseIteratorT(SwitchInstTy *SI, unsigned CaseNum)
Initializes case iterator for given SwitchInst and for given case number.
void setVolatile(bool V)
setVolatile - Specify whether this is a volatile cmpxchg.
*p = old >unsigned v ? old : v
ShuffleVectorInst - This instruction constructs a fixed permutation of two input vectors.
static bool classof(const Value *V)
static bool classof(const Value *V)
iterator_range< op_iterator > arg_operands()
arg_operands - iteration adapter for range-for loops.
1 1 1 0 True if unordered or not equal
bool doesNotThrow() const
Determine if the call cannot unwind.
static bool classof(const Instruction *I)
static bool isEquality(Predicate P)
isEquality - Return true if this predicate is either EQ or NE.
unsigned getNumIndices() const
void setSuccessor(unsigned i, BasicBlock *NewSucc)
Value * getNewValOperand()
unsigned getParamAlignment(unsigned Index) const
Return the alignment for the specified function parameter.
This class represents a sign extension of integer types.
LoadInst - an instruction for reading from memory.
static bool classof(const Value *V)
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
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...
void setAddress(Value *V)
LoadInst(Value *Ptr, const char *NameStr=nullptr, bool isVolatile=false, Instruction *InsertBefore=nullptr)
CaseIt(SwitchInst *SI, unsigned CaseNum)
static Instruction * CreateFree(Value *Source, Instruction *InsertBefore)
CreateFree - Generate the IR for a call to the builtin free function.
static bool classof(const Value *V)
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
const Use & getArgOperandUse(unsigned i) const
Wrappers for getting the Use of a call argument.
static bool classof(const Instruction *I)
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
bool isNoBuiltin() const
Return true if the call should not be treated as a call to a builtin.
SExtInst * cloneImpl() const
Clone an identical SExtInst.
static bool classof(const Instruction *I)
const Value * getPointerOperand() const
*p = old >signed v ? old : v
void setSynchScope(SynchronizationScope SynchScope)
Specify whether this cmpxchg is atomic and orders other operations with respect to all concurrently e...
bool doesNotReturn() const
Determine if the call cannot return.
unsigned getNumIndices() const
static bool classof(const Instruction *I)
Value * removeIncomingValue(const BasicBlock *BB, bool DeletePHIIfEmpty=true)
ConstantInt * findCaseDest(BasicBlock *BB)
findCaseDest - Finds the unique case value for a given successor.
static SwitchInst * Create(Value *Value, BasicBlock *Default, unsigned NumCases, BasicBlock *InsertAtEnd)
Constant * getMask() const
FPExtInst * cloneImpl() const
Clone an identical FPExtInst.
static BranchInst * Create(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond, BasicBlock *InsertAtEnd)
void setVolatile(bool V)
setVolatile - Specify whether this is a volatile RMW or not.
block_iterator block_end()
static bool classof(const Instruction *I)
BasicBlock *const * const_block_iterator
void setCallingConv(CallingConv::ID CC)
static ReturnInst * Create(LLVMContext &C, Value *retVal=nullptr, Instruction *InsertBefore=nullptr)
static InsertValueInst * Create(Value *Agg, Value *Val, ArrayRef< unsigned > Idxs, const Twine &NameStr, BasicBlock *InsertAtEnd)
bool isArrayAllocation() const
isArrayAllocation - Return true if there is an allocation size parameter to the allocation instructio...
static bool classof(const Instruction *I)
1 0 0 1 True if unordered or equal
void setSynchScope(SynchronizationScope xthread)
Specify whether this load is ordered with respect to all concurrently executing threads, or only with respect to signal handlers executing in the same thread.
bool onlyReadsMemory() const
Determine if the call does not access or only reads memory.
static unsigned getOperandNumForIncomingValue(unsigned i)
static GetElementPtrInst * Create(Type *PointeeType, Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr, BasicBlock *InsertAtEnd)
static bool isRelational(Predicate P)
isRelational - Return true if the predicate is relational (not EQ or NE).
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)
bool isUnconditional() const
This class represents a conversion between pointers from one address space to another.
uint64_t getDereferenceableBytes(unsigned Index) const
Get the number of dereferenceable bytes (or zero if unknown).
static Value * getPointerOperand(Instruction &Inst)
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.
static bool classof(const Value *V)
Value * getReturnValue() const
Convenience accessor. Returns null if there is no return value.
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.
bool hasFnAttr(StringRef A) const
Determine whether this call has the given attribute.
bool onlyReadsMemory() const
Determine if the call does not access or only reads memory.
CallInst * cloneImpl() const
static bool classof(const Instruction *I)
bool doesNotReturn() const
Determine if the call cannot return.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static bool classof(const Value *V)
A Use represents the edge between a Value definition and its users.
void setSynchScope(SynchronizationScope xthread)
Specify whether this store instruction is ordered with respect to all concurrently executing threads...
static bool classof(const Value *V)
void setOrdering(AtomicOrdering Ordering)
Set the ordering constraint on this fence.
bool onlyAccessesArgMemory() const
Determine if the call access memmory only using it's pointer arguments.
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.
unsigned getNumArgOperands() const
getNumArgOperands - Return the number of call arguments.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
const Value * getCalledValue() const
getCalledValue - Get a pointer to the function that is invoked by this instruction ...
UIToFPInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
This file contains the simple types necessary to represent the attributes associated with functions a...
FCmpInst * cloneImpl() const
Clone an identical FCmpInst.
bool isCommutative() const
Determine if this relation is commutative.
bool isMustTailCall() const
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
void setCalledFunction(FunctionType *FTy, Value *Fn)
FPToUIInst * cloneImpl() const
Clone an identical FPToUIInst.
static ConstantInt * ExtractElement(Constant *V, Constant *Idx)
Value * getPointerOperand()
Type * getPointerOperandType() const
getPointerOperandType - Method to return the pointer operand as a PointerType.
block_iterator block_begin()
unsigned getNumSuccessors() const
Function does not access memory.
BasicBlock * getDestination(unsigned i)
getDestination - Return the specified destination.
Hidden pointer to structure to return.
iterator_range< ConstCaseIt > cases() const
cases - iteration adapter for range-for loops.
static bool classof(const Instruction *I)
SynchronizationScope getSynchScope() const
This class represents a cast from a pointer to an integer.
bool doesNotThrow() const
Determine if the call cannot unwind.
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
void setUnwindDest(BasicBlock *B)
Value * getPointerOperand()
UIToFPInst * cloneImpl() const
Clone an identical UIToFPInst.
const_op_iterator idx_end() const
void setAtomic(AtomicOrdering Ordering, SynchronizationScope SynchScope=CrossThread)
#define DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CLASS, VALUECLASS)
Macro for generating out-of-class operand accessor definitions.
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.
static GetElementPtrInst * CreateInBounds(Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Create an "inbounds" getelementptr.
void setCleanup(bool V)
setCleanup - Indicate that this landingpad instruction is a cleanup.
static bool classof(const Instruction *I)
BitCastInst * cloneImpl() const
Clone an identical BitCastInst.
static bool classof(const Value *V)
static SelectInst * Create(Value *C, Value *S1, Value *S2, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
static bool classof(const Instruction *I)
VectorType * getType() const
getType - Overload to return most specific vector type.
bool isNoInline() const
Return true if the call should not be inlined.
void setValue(ConstantInt *V)
Sets the new value for current case.
BinOp
This enumeration lists the possible modifications atomicrmw can make.
void setNormalDest(BasicBlock *B)
bool hasFnAttr(Attribute::AttrKind A) const
Determine whether this call has the given attribute.
bool doesNotAccessMemory() const
Determine if the call does not access memory.
void mutateFunctionType(FunctionType *FTy)
const unsigned * idx_iterator
CaseIteratorT< const SwitchInst, const ConstantInt, const BasicBlock > ConstCaseIt
CaseIt(const ParentTy &Src)
static BranchInst * Create(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond, Instruction *InsertBefore=nullptr)
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide fast operand accessors.
This instruction compares its operands according to the predicate given to the constructor.
idx_iterator idx_end() const
BasicBlock * getSuccessor(unsigned i) const
static bool classof(const Value *V)
static bool classof(const Value *V)
This class represents a no-op cast from one type to another.
BasicBlock * getIncomingBlock(const Use &U) const
getIncomingBlock - Return incoming basic block corresponding to an operand of the PHI...
StoreInst * cloneImpl() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Value * getInsertedValueOperand()
const Value * getInsertedValueOperand() const
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.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
Predicate getUnsignedPredicate() const
For example, EQ->EQ, SLE->ULE, UGT->UGT, etc.
static bool classof(const Value *V)
unsigned getNumClauses() const
getNumClauses - Get the number of clauses for this landing pad.
FPToSIInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
void setInstructionSubclassData(unsigned short D)
StoreInst - an instruction for storing to memory.
This class represents a cast from floating point to signed integer.
BasicBlock * getIncomingBlock(Value::const_user_iterator I) const
getIncomingBlock - Return incoming basic block corresponding to value use iterator.
const Value * getPointerOperand() const
Gets the pointer operand.
static bool classof(const Value *V)
ICmpInst(BasicBlock &InsertAtEnd, Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
Constructor with insert-at-end semantics.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
static bool classof(const Value *V)
uint64_t getDereferenceableOrNullBytes(unsigned i) const
Extract the number of dereferenceable_or_null bytes for a call or parameter (0=unknown).
bool cannotDuplicate() const
Determine if the invoke cannot be duplicated.
This class represents a truncation of integer types.
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.
bool hasByValArgument() const
Determine if any call argument is an aggregate passed by value.
BasicBlock * getNormalDest() const
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.
OtherOps getOpcode() 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.
SIToFPInst * cloneImpl() const
Clone an identical SIToFPInst.
GetElementPtrInst - an instruction for type-safe pointer arithmetic to access elements of arrays and ...
LoadInst * cloneImpl() const
static bool classof(const Instruction *I)
bool isFilter(unsigned Idx) const
isFilter - Return 'true' if the clause and index Idx is a filter clause.
static bool classof(const Value *V)
static unsigned getPointerOperandIndex()
initializer< Ty > init(const Ty &Val)
InsertElementInst - This instruction inserts a single (scalar) element into a VectorType value...
LandingPadInst - The landingpad instruction holds all of the information necessary to generate correc...
void setDoesNotAccessMemory()
VAArgInst(Value *List, Type *Ty, const Twine &NameStr, BasicBlock *InsertAtEnd)
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.
unsigned getCaseIndex() const
Returns number of current case.
SynchronizationScope getSynchScope() const
Returns whether this RMW is atomic between threads or only within a single thread.
static unsigned getAggregateOperandIndex()
LLVM Basic Block Representation.
iterator_range< idx_iterator > indices() const
PointerIntPair - This class implements a pair of a pointer and small integer.
The instances of the Type class are immutable: once they are created, they are never changed...
static unsigned getPointerOperandIndex()
This is an important class for using LLVM in a threaded context.
BranchInst - Conditional or Unconditional Branch instruction.
bool isVectorTy() const
isVectorTy - True if this is an instance of VectorType.
bool isEquality() const
isEquality - Return true if this predicate is either EQ or NE.
uint64_t getDereferenceableBytes(unsigned i) const
Extract the number of dereferenceable bytes for a call or parameter (0=unknown).
UnreachableInst - This function has undefined behavior.
This is an important base class in LLVM.
PointerType * getType() const
getType - Overload to return most specific pointer type
const Value * getCondition() const
ResumeInst - Resume the propagation of an exception.
Value * getCompareOperand()
void setFailureOrdering(AtomicOrdering Ordering)
void setUsedWithInAlloca(bool V)
Specify whether this alloca is used to represent the arguments to a call.
static BranchInst * Create(BasicBlock *IfTrue, BasicBlock *InsertAtEnd)
void setCalledFunction(FunctionType *FTy, Value *Fn)
IndirectBrInst - Indirect Branch Instruction.
unsigned getAlignment() const
getAlignment - Return the alignment of the memory that is being allocated by the instruction.
unsigned getParamAlignment(unsigned i) const
Extract the alignment for a call or parameter (0=unknown).
bool paramHasAttr(unsigned i, Attribute::AttrKind A) const
Determine whether the call or the callee has the given attributes.
static CallInst * Create(Value *Func, ArrayRef< Value * > Args, const Twine &NameStr, BasicBlock *InsertAtEnd)
static bool classof(const Value *V)
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
static SelectInst * Create(Value *C, Value *S1, Value *S2, const Twine &NameStr, BasicBlock *InsertAtEnd)
bool hasAllZeroIndices() const
hasAllZeroIndices - Return true if all of the indices of this GEP are zeros.
BasicBlock * getIncomingBlock(unsigned i) const
getIncomingBlock - Return incoming basic block number i.
static GetElementPtrInst * CreateInBounds(Type *PointeeType, Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr, BasicBlock *InsertAtEnd)
static unsigned getPointerOperandIndex()
static bool classof(const Value *V)
uint64_t getDereferenceableOrNullBytes(unsigned Index) const
Get the number of dereferenceable_or_null bytes (or zero if unknown).
bool isUsedWithInAlloca() const
Return true if this alloca is used as an inalloca argument to a call.
static GetElementPtrInst * CreateInBounds(Type *PointeeType, Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
This instruction compares its operands according to the predicate given to the constructor.
const Value * getValueOperand() const
bool doesNotAccessMemory() const
Determine if the call does not access memory.
User * getUser() const
Returns the User that contains this Use.
Value * getOperand(unsigned i) const
0 1 1 1 True if ordered (no nans)
Value * getPointerOperand()
static InvokeInst * Create(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr, BasicBlock *InsertAtEnd)
static bool classof(const Value *V)
Function doesn't unwind stack.
iterator_range< const_op_iterator > arg_operands() const
arg_operands - iteration adapter for range-for loops.
Predicate getPredicate() const
Return the predicate for this instruction.
static bool classof(const Value *V)
static Type * getGEPReturnType(Type *ElTy, Value *Ptr, ArrayRef< Value * > IdxList)
void setTailCallKind(TailCallKind TCK)
void setSourceElementType(Type *Ty)
void setAlignment(unsigned Align)
This class represents a cast from an integer to a pointer.
1 1 1 1 Always true (always folded)
Mark the function as not returning.
CaseIteratorT< SwitchInstTy, ConstantIntTy, BasicBlockTy > Self
static bool classof(const Value *V)
#define DECLARE_TRANSPARENT_OPERAND_ACCESSORS(VALUECLASS)
Macro for generating in-class operand accessor declarations.
void setTailCall(bool isTC=true)
FunctionType * getFunctionType() const
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 swapOperands()
Exchange the two operands to this instruction in such a way that it does not modify the semantics of ...
void setAtomic(AtomicOrdering Ordering, SynchronizationScope SynchScope=CrossThread)
bool hasAllConstantIndices() const
hasAllConstantIndices - Return true if all of the indices of this GEP are constant integers...
static unsigned getIncomingValueNumForOperand(unsigned i)
bool isNoInline() const
Return true if the call should not be inlined.
const Value * getTrueValue() const
static Self fromSuccessorIndex(SwitchInstTy *SI, unsigned SuccessorIndex)
Initializes case iterator for given SwitchInst and for given TerminatorInst's successor index...
ConstCaseIt case_end() const
Returns a read-only iterator that points one past the last in the SwitchInst.
static GetElementPtrInst * Create(Type *PointeeType, Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Call cannot be duplicated.
static IndirectBrInst * Create(Value *Address, unsigned NumDests, Instruction *InsertBefore=nullptr)
unsigned getNumSuccessors() const
FunctionType * getFunctionType() const
bool isRelational() const
isRelational - Return true if the predicate is relational (not EQ or NE).
bool operator!=(const Self &RHS) const
static bool classof(const Instruction *I)
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
static bool classof(const Value *V)
FCmpInst(Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
Constructor with no-insertion semantics.
unsigned getAddressSpace() const
Returns the address space of this instruction's pointer type.
void setOnlyAccessesArgMemory()
static AtomicOrdering getStrongestFailureOrdering(AtomicOrdering SuccessOrdering)
Returns the strongest permitted ordering on failure, given the desired ordering on success...
bool hasByValArgument() const
Determine if any call argument is an aggregate passed by value.
TruncInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
static InsertElementInst * Create(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr, BasicBlock *InsertAtEnd)
bool isConditional() const
SequentialType - This is the superclass of the array, pointer and vector type classes.
idx_iterator idx_begin() const
LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile=false, Instruction *InsertBefore=nullptr)
static bool classof(const Value *V)
static InvokeInst * Create(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
static bool classof(const Instruction *I)
static bool classof(const Value *V)
BasicBlock * getUnwindDest() const
AtomicOrdering getOrdering() const
Returns the ordering effect of this store.
This is the shared class of boolean and integer constants.
static bool classof(const Instruction *I)
void setIncomingBlock(unsigned i, BasicBlock *BB)
Value * getIncomingValue(unsigned i) const
getIncomingValue - Return incoming value number x
AtomicCmpXchgInst * cloneImpl() const
bool cannotDuplicate() const
Determine if the call cannot be duplicated.
unsigned getVectorNumElements() const
static Type * getGEPReturnType(Value *Ptr, ArrayRef< Value * > IdxList)
GetGEPReturnType - Returns the pointer type returned by the GEP instruction, which may be a vector of...
static bool classof(const Instruction *I)
static SwitchInst * Create(Value *Value, BasicBlock *Default, unsigned NumCases, Instruction *InsertBefore=nullptr)
AddrSpaceCastInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
unsigned getParamAlignment(unsigned i) const
Extract the alignment for a call or parameter (0=unknown).
Type * checkGEPType(Type *Ty)
unsigned getNumSuccessors() const
const BasicBlock * getDestination(unsigned i) const
static bool classof(const Instruction *I)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Use & getArgOperandUse(unsigned i)
ConstCaseIt case_begin() const
Returns a read-only iterator that points to the first case in the SwitchInst.
bool isStaticAlloca() const
isStaticAlloca - Return true if this alloca is in the entry block of the function and is a constant s...
Type * getType() const
All values are typed, get the type of this value.
const Value * getCompareOperand() const
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
Callee is recognized as a builtin, despite nobuiltin attribute on its declaration.
void mutateFunctionType(FunctionType *FTy)
const Value * getValOperand() const
LoadInst(Value *Ptr, const Twine &NameStr, Instruction *InsertBefore)
TailCallKind getTailCallKind() const
This class represents a range of values.
bool isVolatile() const
isVolatile - Return true if this is a load from a volatile memory location.
bool isEquality() const
Determine if this is an equality predicate.
This class represents a cast from floating point to unsigned integer.
BasicBlockTy * getCaseSuccessor()
Resolves successor for current case.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
SequentialType * getType() const
void setCannotDuplicate()
Predicate getSwappedPredicate() const
For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
static CallInst * Create(FunctionType *Ty, Value *Func, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Function * getCalledFunction() const
getCalledFunction - Return the function called, or null if this is an indirect function invocation...
static BranchInst * Create(BasicBlock *IfTrue, Instruction *InsertBefore=nullptr)
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
AtomicOrdering getOrdering() const
Returns the ordering effect of this fence.
const Value * getAggregateOperand() const
static PHINode * Create(Type *Ty, unsigned NumReservedValues, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructors - NumReservedValues is a hint for the number of incoming edges that this phi node will h...
SExtInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
ZExtInst * cloneImpl() const
Clone an identical ZExtInst.
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
CaseIt findCaseValue(const ConstantInt *C)
findCaseValue - Search all of the case values for the specified constant.
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
static bool classof(const Instruction *I)
void setPredicate(Predicate P)
Set the predicate for this instruction to the specified value.
unsigned getAddressSpace() const
Returns the address space of this instruction's pointer type.
FCmpInst(BasicBlock &InsertAtEnd, Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
Constructor with insert-at-end semantics.
void setOperand(unsigned i, Value *Val)
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
Value * getArgOperand(unsigned i) const
getArgOperand/setArgOperand - Return/set the i-th call argument.
A range adaptor for a pair of iterators.
VectorType - Class to represent vector types.
BasicBlock ** block_iterator
void setVolatile(bool V)
setVolatile - Specify whether this is a volatile store or not.
Class for arbitrary precision integers.
static bool classof(const Instruction *I)
static bool classof(const Value *V)
static bool classof(const Value *V)
ConstCaseIt findCaseValue(const ConstantInt *C) const
const Value * getPointerOperand() const
VAArgInst(Value *List, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Value * getIncomingValueForBlock(const BasicBlock *BB) const
void setWeak(bool IsWeak)
void setResultElementType(Type *Ty)
bool isCommutative() const
Determine if this is a commutative predicate.
Function only reads from memory.
static bool classof(const Value *V)
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.
static ReturnInst * Create(LLVMContext &C, BasicBlock *InsertAtEnd)
bool hasStructRetAttr() const
Determine if the call returns a structure through first pointer argument.
FCmpInst(Instruction *InsertBefore, Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
Constructor with insert-before-instruction semantics.
static ResumeInst * Create(Value *Exn, BasicBlock *InsertAtEnd)
Value * getCondition() const
BitCastInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
bool isInlineAsm() const
isInlineAsm - Check if this call is an inline asm statement.
const AttributeSet & getAttributes() const
getAttributes - Return the parameter attributes for this call.
static CallInst * Create(Value *F, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
const Type * getScalarType() const LLVM_READONLY
getScalarType - If this is a vector type, return the element type, otherwise return 'this'...
bool isNoBuiltin() const
Return true if the call should not be treated as a call to a builtin.
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:
const Value * getNewValOperand() const
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...
LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile, unsigned Align, AtomicOrdering Order, SynchronizationScope SynchScope=CrossThread, Instruction *InsertBefore=nullptr)
bool onlyAccessesArgMemory() const
Determine if the call can access memmory only using pointers based on its arguments.
static bool classof(const Value *V)
void setOrdering(AtomicOrdering Ordering)
Set the ordering constraint on this store.
ConstCaseIt case_default() const
void setCalledFunction(Value *Fn)
setCalledFunction - Set the function called.
Value * getArgOperand(unsigned i) const
getArgOperand/setArgOperand - Return/set the i-th invoke argument.
BasicBlock * getSuccessor(unsigned idx) const
uint64_t getDereferenceableBytes(unsigned i) const
Extract the number of dereferenceable bytes for a call or parameter (0=unknown).
user_iterator_impl< const User > const_user_iterator
Value * getCondition() const
const AttributeSet & getAttributes() const
getAttributes - Return the parameter attributes for this invoke.
BasicBlock * getDefaultDest() const
void setArgOperand(unsigned i, Value *v)
void setDoesNotAccessMemory()
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
unsigned getNumSuccessors() const
void setCondition(Value *V)
AtomicOrdering getOrdering() const
Returns the ordering effect of this fence.
bool hasAttrSomewhere(Attribute::AttrKind Attr) const
Return true if the specified attribute is set for at least one parameter or for the return value...
unsigned getAlignment() const
getAlignment - Return the alignment of the access that is being performed
void setOperation(BinOp Operation)
Value * getPointerOperand()
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
static InsertValueInst * Create(Value *Agg, Value *Val, ArrayRef< unsigned > Idxs, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
uint64_t getDereferenceableOrNullBytes(unsigned i) const
Extract the number of dereferenceable_or_null bytes for a call or parameter (0=unknown).
Callee isn't recognized as a builtin.
void setOnlyAccessesArgMemory()
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
bool isCatch(unsigned Idx) const
isCatch - Return 'true' if the clause and index Idx is a catch clause.
static ReturnInst * Create(LLVMContext &C, Value *retVal, BasicBlock *InsertAtEnd)
void setSuccessor(unsigned idx, BasicBlock *NewSucc)
void setArgOperand(unsigned i, Value *v)
static bool classof(const Value *V)
This class represents a cast unsigned integer to floating point.
static GetElementPtrInst * CreateInBounds(Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr, BasicBlock *InsertAtEnd)
static bool classof(const Value *V)
0 1 1 0 True if ordered and operands are unequal
Compile-time customization of User operands.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
unsigned getNumSuccessors() const
VectorType * getType() const
getType - Overload to return most specific vector type.
IntToPtrInst * cloneImpl() const
Clone an identical IntToPtrInst.
static unsigned getPointerOperandIndex()
void setOnlyReadsMemory()
CaseIt case_default()
Returns an iterator that points to the default case.
ICmpInst(Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
Constructor with no-insertion semantics.
bool isAtLeastRelease(AtomicOrdering Ord)
Returns true if the ordering is at least as strong as release (i.e.
unsigned getNumCases() const
getNumCases - return the number of 'cases' in this switch instruction, except the default case ...
Funciton can access memory only using pointers based on its arguments.
void mutateType(Type *Ty)
Mutate the type of this Value to be of the specified type.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
static CallInst * Create(Value *F, const Twine &NameStr, BasicBlock *InsertAtEnd)
void reserveClauses(unsigned Size)
reserveClauses - Grow the size of the operand list to accommodate the new number of clauses...
static InvokeInst * Create(FunctionType *Ty, Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
static bool classof(const Value *V)
static bool classof(const Value *V)
void setCondition(Value *V)
const_block_iterator block_begin() const
Use & getArgOperandUse(unsigned i)
SwitchInst - Multiway switch.
iterator_range< op_iterator > arg_operands()
arg_operands - iteration adapter for range-for loops.
static unsigned getPointerOperandIndex()
const Value * getPointerOperand() const
This class represents a cast from signed integer to floating point.
void swapOperands()
Exchange the two operands to this instruction in such a way that it does not modify the semantics of ...
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.
Type * getReturnType() const
Function can return twice.
const ARM::ArchExtKind Kind
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
This class represents a truncation of floating point types.
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.
FPToSIInst * cloneImpl() const
Clone an identical FPToSIInst.
unsigned getOpcode() const
getOpcode() returns a member of one of the enums like Instruction::Add.
void setDefaultDest(BasicBlock *DefaultCase)
void setOnlyReadsMemory()
HungoffOperandTraits - determine the allocation regime of the Use array when it is not a prefix to th...
static VectorType * get(Type *ElementType, unsigned NumElements)
VectorType::get - This static method is the primary way to construct an VectorType.
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.
StoreInst(Value *Val, Value *Ptr, Instruction *InsertBefore)
void setCallingConv(CallingConv::ID CC)
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
InvokeInst - Invoke instruction.
void setSynchScope(SynchronizationScope SynchScope)
Specify whether this RMW orders other operations with respect to all concurrently executing threads...
static bool classof(const Instruction *I)
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.
C - The default llvm calling convention, compatible with C.
const Value * getFalseValue() const
StringRef - Represent a constant reference to a string, i.e.
const_block_iterator block_end() const
AtomicCmpXchgInst(Value *Ptr, Value *Cmp, Value *NewVal, AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering, SynchronizationScope SynchScope, Instruction *InsertBefore=nullptr)
FixedNumOperandTraits - determine the allocation regime of the Use array when it is a prefix to the U...
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 classof(const Value *V)
const_op_range incoming_values() const
VariadicOperandTraits - determine the allocation regime of the Use array when it is a prefix to the U...
void setIncomingValue(unsigned i, Value *V)
static bool classof(const Value *V)
Type * getAllocatedType() const
getAllocatedType - Return the type that is being allocated by the instruction.
op_range incoming_values()
This class represents an extension of floating point types.
bool isRelational() const
Determine if this a relational predicate.
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.
const Value * getPointerOperand() const
void setCannotDuplicate()
FPTruncInst * cloneImpl() const
Clone an identical FPTruncInst.
unsigned getNumArgOperands() const
getNumArgOperands - Return the number of invoke arguments.
InsertValueInst * cloneImpl() const
Value * getPointerOperand()
unsigned getNumSuccessors() const
int getBasicBlockIndex(const BasicBlock *BB) const
getBasicBlockIndex - Return the first index of the specified basic block in the value list for this P...
unsigned getNumDestinations() const
getNumDestinations - return the number of possible destinations in this indirectbr instruction...
const Value * getPointerOperand() const
static bool classof(const Value *V)
static bool classof(const Instruction *I)
Type * getResultElementType() const
static unsigned getPointerOperandIndex()
const_op_iterator idx_begin() const
SmallVector< int, 16 > getShuffleMask() const
void addDereferenceableAttr(unsigned i, uint64_t Bytes)
adds the dereferenceable attribute to the list of attributes.
0 0 0 0 Always false (always folded)
bool canReturnTwice() const
Return true if the call can return twice.
static bool classof(const Value *V)
AddrSpaceCastInst * cloneImpl() const
Clone an identical AddrSpaceCastInst.
static IndirectBrInst * Create(Value *Address, unsigned NumDests, BasicBlock *InsertAtEnd)
AllocaInst - an instruction to allocate memory on the stack.
static bool classof(const Instruction *I)
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 operator==(const Self &RHS) const
bool isVolatile() const
isVolatile - Return true if this is a RMW on a volatile memory location.
static bool classof(const Instruction *I)
const Value * getPointerOperand() const
LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile, unsigned Align, Instruction *InsertBefore=nullptr)
Predicate getSwappedPredicate(Predicate Opcode)
Assume the condition register is set by MI(a,b), return the predicate if we modify the instructions s...