16 #ifndef LLVM_IR_INSTRUCTIONS_H
17 #define LLVM_IR_INSTRUCTIONS_H
115 return (I->
getOpcode() == Instruction::Alloca);
118 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
123 void setInstructionSubclassData(
unsigned short D) {
163 bool isVolatile =
false,
Instruction *InsertBefore = 0);
238 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
243 void setInstructionSubclassData(
unsigned short D) {
262 void *
operator new(
size_t s) {
263 return User::operator
new(s, 2);
360 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
365 void setInstructionSubclassData(
unsigned short D) {
389 void *
operator new(
size_t s) {
390 return User::operator
new(s, 0);
397 Instruction *InsertBefore = 0);
410 setInstructionSubclassData((getSubclassDataFromInstruction() & 1) |
422 setInstructionSubclassData((getSubclassDataFromInstruction() & ~1) |
428 return I->
getOpcode() == Instruction::Fence;
431 return isa<Instruction>(V) && classof(cast<Instruction>(V));
436 void setInstructionSubclassData(
unsigned short D) {
457 void *
operator new(
size_t s) {
458 return User::operator
new(s, 3);
487 "CmpXchg instructions can only be atomic.");
528 return I->
getOpcode() == Instruction::AtomicCmpXchg;
531 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
536 void setInstructionSubclassData(
unsigned short D) {
595 void *
operator new(
size_t s) {
596 return User::operator
new(s, 2);
600 Instruction *InsertBefore = 0);
606 return static_cast<BinOp>(getSubclassDataFromInstruction() >> 5);
610 unsigned short SubclassData = getSubclassDataFromInstruction();
611 setInstructionSubclassData((SubclassData & 31) |
618 return getSubclassDataFromInstruction() & 1;
624 setInstructionSubclassData((getSubclassDataFromInstruction() & ~1) |
634 "atomicrmw instructions can only be atomic.");
635 setInstructionSubclassData((getSubclassDataFromInstruction() & ~(7 << 2)) |
643 setInstructionSubclassData((getSubclassDataFromInstruction() & ~2) |
649 return AtomicOrdering((getSubclassDataFromInstruction() >> 2) & 7);
672 return I->
getOpcode() == Instruction::AtomicRMW;
675 return isa<Instruction>(V) && classof(cast<Instruction>(V));
682 void setInstructionSubclassData(
unsigned short D) {
702 assert(Ty &&
"Invalid GetElementPtrInst indices for type!");
718 unsigned Values,
const Twine &NameStr,
721 unsigned Values,
const Twine &NameStr,
727 const Twine &NameStr =
"",
734 const Twine &NameStr,
745 const Twine &NameStr =
"",
753 const Twine &NameStr,
819 unsigned NumElem = cast<VectorType>(Ptr->
getType())->getNumElements();
864 return (I->
getOpcode() == Instruction::GetElementPtr);
867 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
876 GetElementPtrInst::GetElementPtrInst(
Value *Ptr,
879 const Twine &NameStr,
884 Values, InsertBefore) {
885 init(Ptr, IdxList, NameStr);
887 GetElementPtrInst::GetElementPtrInst(Value *Ptr,
888 ArrayRef<Value *> IdxList,
890 const Twine &NameStr,
892 : Instruction(getGEPReturnType(Ptr, IdxList),
894 OperandTraits<GetElementPtrInst>::op_end(this) - Values,
895 Values, InsertAtEnd) {
896 init(Ptr, IdxList, NameStr);
915 "Invalid ICmp predicate value");
917 "Both operands to ICmp instruction are not of the same type!");
919 assert((getOperand(0)->
getType()->isIntOrIntVectorTy() ||
920 getOperand(0)->
getType()->isPtrOrPtrVectorTy()) &&
921 "Invalid operand types for ICmp instruction");
926 virtual ICmpInst *clone_impl()
const;
934 const Twine &NameStr =
""
935 ) : CmpInst(makeCmpResultType(LHS->
getType()),
949 const Twine &NameStr =
""
950 ) : CmpInst(makeCmpResultType(LHS->
getType()),
963 const Twine &NameStr =
""
964 ) : CmpInst(makeCmpResultType(LHS->
getType()),
976 return getSignedPredicate(getPredicate());
988 return getUnsignedPredicate(getPredicate());
998 return P == ICMP_EQ || P == ICMP_NE;
1004 return isEquality(getPredicate());
1014 return !isEquality();
1020 return !isEquality(P);
1034 Op<0>().
swap(Op<1>());
1039 return I->
getOpcode() == Instruction::ICmp;
1042 return isa<Instruction>(V) && classof(cast<Instruction>(V));
1066 const Twine &NameStr =
""
1071 "Invalid FCmp predicate value");
1073 "Both operands to FCmp instruction are not of the same type!");
1076 "Invalid operand types for FCmp instruction");
1085 const Twine &NameStr =
""
1090 "Invalid FCmp predicate value");
1092 "Both operands to FCmp instruction are not of the same type!");
1095 "Invalid operand types for FCmp instruction");
1103 const Twine &NameStr =
""
1107 "Invalid FCmp predicate value");
1109 "Both operands to FCmp instruction are not of the same type!");
1112 "Invalid operand types for FCmp instruction");
1143 Op<0>().
swap(Op<1>());
1148 return I->
getOpcode() == Instruction::FCmp;
1151 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
1165 void init(
Value *Func,
const Twine &NameStr);
1189 const Twine &NameStr =
"",
1192 CallInst(Func, Args, NameStr, InsertBefore);
1198 CallInst(Func, Args, NameStr, InsertAtEnd);
1202 return new(1)
CallInst(F, NameStr, InsertBefore);
1206 return new(1)
CallInst(F, NameStr, InsertAtEnd);
1218 const Twine &Name =
"");
1223 const Twine &Name =
"");
1255 (static_cast<unsigned>(CC) << 1));
1275 "Use CallInst::isNoBuiltin() to check for Attribute::NoBuiltin");
1276 return hasFnAttrImpl(A);
1373 return isa<InlineAsm>(
Op<-1>());
1381 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
1389 void setInstructionSubclassData(
unsigned short D) {
1401 ->getElementType())->getReturnType(),
1404 unsigned(Args.size() + 1), InsertAtEnd) {
1405 init(Func, Args, NameStr);
1408 CallInst::CallInst(Value *
Func, ArrayRef<Value *> Args,
1409 const Twine &NameStr, Instruction *InsertBefore)
1411 ->getElementType())->getReturnType(),
1413 OperandTraits<CallInst>::op_end(this) - (Args.size() + 1),
1414 unsigned(Args.size() + 1), InsertBefore) {
1415 init(Func, Args, NameStr);
1432 assert(!areInvalidOperands(C, S1, S2) &&
"Invalid operands for select");
1439 Instruction *InsertBefore)
1441 &Op<0>(), 3, InsertBefore) {
1448 &Op<0>(), 3, InsertAtEnd) {
1456 const Twine &NameStr =
"",
1457 Instruction *InsertBefore = 0) {
1458 return new(3)
SelectInst(C, S1, S2, NameStr, InsertBefore);
1461 const Twine &NameStr,
1463 return new(3)
SelectInst(C, S1, S2, NameStr, InsertAtEnd);
1475 static const char *areInvalidOperands(
Value *Cond,
Value *True,
Value *False);
1489 return isa<Instruction>(V) && classof(cast<Instruction>(V));
1513 : UnaryInstruction(Ty, VAArg, List, InsertBefore) {
1518 : UnaryInstruction(Ty, VAArg, List, InsertAtEnd) {
1531 return isa<Instruction>(V) && classof(cast<Instruction>(V));
1552 const Twine &NameStr =
"",
1557 const Twine &NameStr,
1584 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
1604 const Twine &NameStr =
"",
1605 Instruction *InsertBefore = 0);
1613 const Twine &NameStr =
"",
1614 Instruction *InsertBefore = 0) {
1618 const Twine &NameStr,
1625 static bool isValidOperands(
const Value *Vec,
const Value *NewElt,
1639 return I->
getOpcode() == Instruction::InsertElement;
1642 return isa<Instruction>(V) && classof(cast<Instruction>(V));
1666 void *
operator new(
size_t s) {
1667 return User::operator
new(s, 3);
1670 const Twine &NameStr =
"",
1671 Instruction *InsertBefor = 0);
1677 static bool isValidOperands(
const Value *V1,
const Value *
V2,
1690 return cast<Constant>(getOperand(2));
1696 static int getMaskValue(
Constant *Mask,
unsigned i);
1699 return getMaskValue(getMask(), i);
1707 return getShuffleMask(getMask(), Result);
1712 getShuffleMask(Mask);
1719 return I->
getOpcode() == Instruction::ShuffleVector;
1722 return isa<Instruction>(V) && classof(cast<Instruction>(V));
1752 const Twine &NameStr,
1759 void *
operator new(
size_t s) {
1760 return User::operator
new(s, 1);
1768 const Twine &NameStr =
"",
1775 const Twine &NameStr,
1791 return getOperand(0);
1794 return getOperand(0);
1805 return (
unsigned)Indices.
size();
1814 return I->
getOpcode() == Instruction::ExtractValue;
1817 return isa<Instruction>(V) && classof(cast<Instruction>(V));
1821 ExtractValueInst::ExtractValueInst(Value *Agg,
1822 ArrayRef<unsigned> Idxs,
1823 const Twine &NameStr,
1824 Instruction *InsertBefore)
1826 ExtractValue, Agg, InsertBefore) {
1827 init(Idxs, NameStr);
1829 ExtractValueInst::ExtractValueInst(Value *Agg,
1830 ArrayRef<unsigned> Idxs,
1831 const Twine &NameStr,
1834 ExtractValue, Agg, InsertAtEnd) {
1835 init(Idxs, NameStr);
1852 const Twine &NameStr);
1858 inline InsertValueInst(
Value *Agg,
Value *Val,
1860 const Twine &NameStr,
1862 inline InsertValueInst(
Value *Agg,
Value *Val,
1869 unsigned Idx,
const Twine &NameStr =
"",
1871 InsertValueInst(
Value *Agg,
Value *Val,
unsigned Idx,
1877 void *
operator new(
size_t s) {
1878 return User::operator
new(s, 2);
1883 const Twine &NameStr =
"",
1885 return new InsertValueInst(Agg, Val, Idxs, NameStr, InsertBefore);
1889 const Twine &NameStr,
1891 return new InsertValueInst(Agg, Val, Idxs, NameStr, InsertAtEnd);
1926 return (
unsigned)Indices.
size();
1935 return I->
getOpcode() == Instruction::InsertValue;
1938 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
1947 InsertValueInst::InsertValueInst(
Value *Agg,
1950 const Twine &NameStr,
1955 init(Agg, Val, Idxs, NameStr);
1957 InsertValueInst::InsertValueInst(Value *Agg,
1959 ArrayRef<unsigned> Idxs,
1960 const Twine &NameStr,
1962 : Instruction(Agg->
getType(), InsertValue,
1963 OperandTraits<InsertValueInst>::op_begin(this),
1965 init(Agg, Val, Idxs, NameStr);
1982 unsigned ReservedSpace;
1985 void *
operator new(
size_t s) {
1986 return User::operator
new(s, 0);
1988 explicit PHINode(
Type *Ty,
unsigned NumReservedValues,
1989 const Twine &NameStr =
"", Instruction *InsertBefore = 0)
1991 ReservedSpace(NumReservedValues) {
1993 OperandList = allocHungoffUses(ReservedSpace);
1999 ReservedSpace(NumReservedValues) {
2001 OperandList = allocHungoffUses(ReservedSpace);
2007 Use *allocHungoffUses(
unsigned)
const;
2009 virtual PHINode *clone_impl()
const;
2014 const Twine &NameStr =
"",
2015 Instruction *InsertBefore = 0) {
2016 return new PHINode(Ty, NumReservedValues, NameStr, InsertBefore);
2020 return new PHINode(Ty, NumReservedValues, NameStr, InsertAtEnd);
2035 reinterpret_cast<Use::UserRef*
>(op_begin() + ReservedSpace);
2036 return reinterpret_cast<block_iterator
>(ref + 1);
2041 reinterpret_cast<const Use::UserRef*
>(op_begin() + ReservedSpace);
2042 return reinterpret_cast<const_block_iterator
>(ref + 1);
2046 return block_begin() + getNumOperands();
2050 return block_begin() + getNumOperands();
2060 return getOperand(i);
2075 return block_begin()[i];
2082 assert(
this == U.
getUser() &&
"Iterator doesn't point to PHI's Uses?");
2083 return getIncomingBlock(
unsigned(&U - op_begin()));
2089 template <
typename U>
2091 return getIncomingBlock(I.
getUse());
2095 block_begin()[i] = BB;
2101 assert(V &&
"PHI node got a null value!");
2102 assert(BB &&
"PHI node got a null basic block!");
2104 "All operands to PHI node must be the same type as the PHI node!");
2105 if (NumOperands == ReservedSpace)
2109 setIncomingValue(NumOperands - 1, V);
2110 setIncomingBlock(NumOperands - 1, BB);
2121 Value *removeIncomingValue(
unsigned Idx,
bool DeletePHIIfEmpty =
true);
2124 int Idx = getBasicBlockIndex(BB);
2125 assert(Idx >= 0 &&
"Invalid basic block argument to remove!");
2126 return removeIncomingValue(Idx, DeletePHIIfEmpty);
2133 for (
unsigned i = 0, e = getNumOperands(); i != e; ++i)
2134 if (block_begin()[i] == BB)
2140 int Idx = getBasicBlockIndex(BB);
2141 assert(Idx >= 0 &&
"Invalid basic block argument!");
2142 return getIncomingValue(Idx);
2147 Value *hasConstantValue()
const;
2154 return isa<Instruction>(V) && classof(cast<Instruction>(V));
2157 void growOperands();
2181 unsigned ReservedSpace;
2188 void *
operator new(
size_t s) {
2189 return User::operator
new(s, 0);
2191 void growOperands(
unsigned Size);
2192 void init(Value *PersFn,
unsigned NumReservedValues,
const Twine &NameStr);
2194 explicit LandingPadInst(
Type *RetTy, Value *PersonalityFn,
2195 unsigned NumReservedValues,
const Twine &NameStr,
2196 Instruction *InsertBefore);
2197 explicit LandingPadInst(
Type *RetTy, Value *PersonalityFn,
2198 unsigned NumReservedValues,
const Twine &NameStr,
2201 virtual LandingPadInst *clone_impl()
const;
2205 static LandingPadInst *Create(
Type *RetTy, Value *PersonalityFn,
2206 unsigned NumReservedClauses,
2207 const Twine &NameStr =
"",
2208 Instruction *InsertBefore = 0);
2209 static LandingPadInst *Create(
Type *RetTy, Value *PersonalityFn,
2210 unsigned NumReservedClauses,
2211 const Twine &NameStr,
BasicBlock *InsertAtEnd);
2224 bool isCleanup()
const {
return getSubclassDataFromInstruction() & 1; }
2228 setInstructionSubclassData((getSubclassDataFromInstruction() & ~1) |
2233 void addClause(
Value *ClauseVal);
2241 return !isa<ArrayType>(OperandList[Idx + 1]->getType());
2246 return isa<ArrayType>(OperandList[Idx + 1]->getType());
2258 return I->
getOpcode() == Instruction::LandingPad;
2261 return isa<Instruction>(V) && classof(cast<Instruction>(V));
2303 return new(!!retVal)
ReturnInst(C, retVal, InsertBefore);
2307 return new(!!retVal)
ReturnInst(C, retVal, InsertAtEnd);
2319 return getNumOperands() != 0 ? getOperand(0) : 0;
2329 return isa<Instruction>(V) && classof(cast<Instruction>(V));
2332 virtual BasicBlock *getSuccessorV(
unsigned idx)
const;
2333 virtual unsigned getNumSuccessorsV()
const;
2334 virtual void setSuccessorV(
unsigned idx,
BasicBlock *B);
2374 return new(1)
BranchInst(IfTrue, InsertBefore);
2378 return new(3)
BranchInst(IfTrue, IfFalse, Cond, InsertBefore);
2381 return new(1)
BranchInst(IfTrue, InsertAtEnd);
2385 return new(3)
BranchInst(IfTrue, IfFalse, Cond, InsertAtEnd);
2395 assert(isConditional() &&
"Cannot get condition of an uncond branch!");
2400 assert(isConditional() &&
"Cannot set condition of unconditional branch!");
2407 assert(i < getNumSuccessors() &&
"Successor # out of range for Branch!");
2408 return cast_or_null<BasicBlock>((&Op<-1>() - i)->get());
2412 assert(idx < getNumSuccessors() &&
"Successor # out of range for Branch!");
2413 *(&Op<-1>() - idx) = (
Value*)NewSucc;
2421 void swapSuccessors();
2425 return (I->
getOpcode() == Instruction::Br);
2428 return isa<Instruction>(V) && classof(cast<Instruction>(V));
2431 virtual BasicBlock *getSuccessorV(
unsigned idx)
const;
2432 virtual unsigned getNumSuccessorsV()
const;
2433 virtual void setSuccessorV(
unsigned idx,
BasicBlock *B);
2451 unsigned ReservedSpace;
2458 void growOperands();
2460 void *
operator new(
size_t s) {
2461 return User::operator
new(s, 0);
2481 static const unsigned DefaultPseudoIndex =
static_cast<unsigned>(~0L-1);
2483 template <
class SwitchInstTy,
class ConstantIntTy,
class BasicBlockTy>
2504 assert(SuccessorIndex < SI->getNumSuccessors() &&
2505 "Successor index # out of range!");
2506 return SuccessorIndex != 0 ?
2507 Self(SI, SuccessorIndex - 1) :
2508 Self(SI, DefaultPseudoIndex);
2513 assert(Index < SI->getNumCases() &&
"Index out the number of cases.");
2514 return reinterpret_cast<ConstantIntTy*
>(SI->
getOperand(2 + Index*2));
2519 assert((Index < SI->getNumCases() ||
2520 Index == DefaultPseudoIndex) &&
2521 "Index out the number of cases.");
2530 assert((Index == DefaultPseudoIndex || Index < SI->getNumCases()) &&
2531 "Index out the number of cases.");
2532 return Index != DefaultPseudoIndex ? Index + 1 : 0;
2538 assert(Index+1 <= SI->
getNumCases() &&
"Index out the number of cases.");
2551 assert((Index == 0 || Index-1 <= SI->
getNumCases()) &&
2552 "Index out the number of cases.");
2562 assert(RHS.
SI == SI &&
"Incompatible operators.");
2563 return RHS.
Index == Index;
2566 assert(RHS.
SI == SI &&
"Incompatible operators.");
2567 return RHS.
Index != Index;
2571 typedef CaseIteratorT<const SwitchInst, const ConstantInt, const BasicBlock>
2585 assert(Index < SI->getNumCases() &&
"Index out the number of cases.");
2586 SI->
setOperand(2 + Index*2, reinterpret_cast<Value*>(V));
2596 unsigned NumCases,
Instruction *InsertBefore = 0) {
2597 return new SwitchInst(Value, Default, NumCases, InsertBefore);
2600 unsigned NumCases,
BasicBlock *InsertAtEnd) {
2601 return new SwitchInst(Value, Default, NumCases, InsertAtEnd);
2614 return cast<BasicBlock>(getOperand(1));
2618 setOperand(1, reinterpret_cast<Value*>(DefaultCase));
2624 return getNumOperands()/2 - 1;
2641 return CaseIt(
this, getNumCases());
2654 return CaseIt(
this, DefaultPseudoIndex);
2665 for (
CaseIt i = case_begin(), e = case_end(); i != e; ++i)
2666 if (i.getCaseValue() ==
C)
2668 return case_default();
2671 for (
ConstCaseIt i = case_begin(), e = case_end(); i != e; ++i)
2672 if (i.getCaseValue() ==
C)
2674 return case_default();
2680 if (BB == getDefaultDest())
return NULL;
2683 for (
CaseIt i = case_begin(), e = case_end(); i != e; ++i) {
2684 if (i.getCaseSuccessor() == BB) {
2685 if (CI)
return NULL;
2686 else CI = i.getCaseValue();
2704 void removeCase(CaseIt i);
2708 assert(idx < getNumSuccessors() &&
"Successor idx out of range for switch!");
2709 return cast<BasicBlock>(getOperand(idx*2+1));
2712 assert(idx < getNumSuccessors() &&
"Successor # out of range for switch!");
2713 setOperand(idx*2+1, (Value*)NewSucc);
2718 return I->
getOpcode() == Instruction::Switch;
2721 return isa<Instruction>(V) && classof(cast<Instruction>(V));
2724 virtual BasicBlock *getSuccessorV(
unsigned idx)
const;
2725 virtual unsigned getNumSuccessorsV()
const;
2726 virtual void setSuccessorV(
unsigned idx,
BasicBlock *B);
2745 unsigned ReservedSpace;
2751 void init(
Value *Address,
unsigned NumDests);
2752 void growOperands();
2754 void *
operator new(
size_t s) {
2755 return User::operator
new(s, 0);
2804 void removeDestination(
unsigned i);
2808 return cast<BasicBlock>(getOperand(i+1));
2811 setOperand(i+1, (
Value*)NewSucc);
2816 return I->
getOpcode() == Instruction::IndirectBr;
2819 return isa<Instruction>(V) && classof(cast<Instruction>(V));
2822 virtual BasicBlock *getSuccessorV(
unsigned idx)
const;
2823 virtual unsigned getNumSuccessorsV()
const;
2824 virtual void setSuccessorV(
unsigned idx,
BasicBlock *B);
2868 return new(Values)
InvokeInst(Func, IfNormal, IfException, Args,
2869 Values, NameStr, InsertBefore);
2876 return new(Values)
InvokeInst(Func, IfNormal, IfException, Args,
2877 Values, NameStr, InsertAtEnd);
2895 return static_cast<CallingConv::ID>(getSubclassDataFromInstruction());
2898 setInstructionSubclassData(static_cast<unsigned>(CC));
2913 void removeAttribute(
unsigned i,
Attribute attr);
2918 "Use CallInst::isNoBuiltin() to check for Attribute::NoBuiltin");
2919 return hasFnAttrImpl(A);
3004 return cast<BasicBlock>(Op<-2>());
3007 return cast<BasicBlock>(Op<-1>());
3010 Op<-2>() = reinterpret_cast<Value*>(B);
3013 Op<-1>() = reinterpret_cast<Value*>(B);
3021 assert(i < 2 &&
"Successor # out of range for invoke!");
3022 return i == 0 ? getNormalDest() : getUnwindDest();
3026 assert(idx < 2 &&
"Successor # out of range for invoke!");
3027 *(&Op<-2>() + idx) =
reinterpret_cast<Value*
>(NewSucc);
3034 return (I->
getOpcode() == Instruction::Invoke);
3037 return isa<Instruction>(V) && classof(cast<Instruction>(V));
3041 virtual BasicBlock *getSuccessorV(
unsigned idx)
const;
3042 virtual unsigned getNumSuccessorsV()
const;
3043 virtual void setSuccessorV(
unsigned idx,
BasicBlock *B);
3049 void setInstructionSubclassData(
unsigned short D) {
3063 ->getElementType())->getReturnType(),
3066 Values, InsertBefore) {
3067 init(Func, IfNormal, IfException, Args, NameStr);
3069 InvokeInst::InvokeInst(Value *
Func,
3071 ArrayRef<Value *> Args,
unsigned Values,
3072 const Twine &NameStr,
BasicBlock *InsertAtEnd)
3073 : TerminatorInst(
cast<FunctionType>(
cast<PointerType>(Func->
getType())
3074 ->getElementType())->getReturnType(),
3075 Instruction::Invoke,
3076 OperandTraits<InvokeInst>::op_end(this) - Values,
3077 Values, InsertAtEnd) {
3078 init(Func, IfNormal, IfException, Args, NameStr);
3115 return I->
getOpcode() == Instruction::Resume;
3118 return isa<Instruction>(V) && classof(cast<Instruction>(V));
3121 virtual BasicBlock *getSuccessorV(
unsigned idx)
const;
3122 virtual unsigned getNumSuccessorsV()
const;
3123 virtual void setSuccessorV(
unsigned idx,
BasicBlock *B);
3149 void *
operator new(
size_t s) {
3150 return User::operator
new(s, 0);
3159 return I->
getOpcode() == Instruction::Unreachable;
3162 return isa<Instruction>(V) && classof(cast<Instruction>(V));
3165 virtual BasicBlock *getSuccessorV(
unsigned idx)
const;
3166 virtual unsigned getNumSuccessorsV()
const;
3167 virtual void setSuccessorV(
unsigned idx,
BasicBlock *B);
3185 const Twine &NameStr =
"",
3193 const Twine &NameStr,
3202 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3221 const Twine &NameStr =
"",
3229 const Twine &NameStr,
3238 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3257 const Twine &NameStr =
"",
3265 const Twine &NameStr,
3274 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3293 const Twine &NameStr =
"",
3301 const Twine &NameStr,
3310 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3329 const Twine &NameStr =
"",
3337 const Twine &NameStr,
3346 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3365 const Twine &NameStr =
"",
3373 const Twine &NameStr,
3382 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3401 const Twine &NameStr =
"",
3409 const Twine &NameStr,
3418 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3437 const Twine &NameStr =
"",
3445 const Twine &NameStr,
3454 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3473 const Twine &NameStr =
"",
3481 const Twine &NameStr,
3490 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3505 const Twine &NameStr =
"",
3513 const Twine &NameStr,
3530 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3549 const Twine &NameStr =
"",
3557 const Twine &NameStr,
3578 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3597 const Twine &NameStr =
"",
3605 const Twine &NameStr,
3614 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
3634 const Twine &NameStr =
"",
3642 const Twine &NameStr,
3651 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
static unsigned getInsertedValueOperandIndex()
const Value * getAddress() const
IntToPtrInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
Constructor with insert-before-instruction semantics.
BasicBlock * getSuccessor(unsigned i) const
void removeAttribute(unsigned i, Attribute attr)
removeAttribute - removes the attribute from the list of attributes.
Value * getValueOperand()
const Value * getCalledValue() const
bool hasStructRetAttr() const
Determine if the call returns a structure through first pointer argument.
void setAttributes(const AttributeSet &Attrs)
COFF::RelocationTypeX86 Type
Value * getPointerOperand()
static bool classof(const Instruction *I)
Abstract base class of comparison instructions.
ConstantIntTy * getCaseValue()
Resolves case value for current case.
void getShuffleMask(SmallVectorImpl< int > &Result) const
AtomicOrdering getOrdering() const
Returns the ordering constraint on this cmpxchg.
void addIncoming(Value *V, BasicBlock *BB)
*p = old <signed v ? old : v
virtual StoreInst * clone_impl() const
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.
AddrSpaceCastInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
Constructor with insert-before-instruction semantics.
static bool classof(const Value *V)
SynchronizationScope getSynchScope() const
ArrayRef< unsigned > getIndices() const
void setCalledFunction(Value *Fn)
setCalledFunction - Set the function called.
static PHINode * Create(Type *Ty, unsigned NumReservedValues, const Twine &NameStr, BasicBlock *InsertAtEnd)
static BranchInst * Create(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond, Instruction *InsertBefore=0)
void setOrdering(AtomicOrdering Ordering)
Set the ordering constraint on this RMW.
static bool classof(const Instruction *I)
void setAlignment(unsigned Align)
unsigned getSuccessorIndex() const
Returns TerminatorInst's successor index for current case successor.
static SelectInst * Create(Value *C, Value *S1, Value *S2, const Twine &NameStr="", Instruction *InsertBefore=0)
int getMaskValue(unsigned i) const
bool hasFnAttr(Attribute::AttrKind A) const
Determine whether this call has the given attribute.
virtual LoadInst * clone_impl() const
enable_if_c<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
void setSynchScope(SynchronizationScope xthread)
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.
Value * getValue() const
Convenience accessor.
static CallInst * Create(Value *F, const Twine &NameStr="", Instruction *InsertBefore=0)
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
Value * getPointerOperand()
Gets the pointer operand.
static bool classof(const Value *V)
void setOrdering(AtomicOrdering Ordering)
static unsigned getPointerOperandIndex()
Gets the operand index of the pointer operand.
static bool classof(const Value *V)
static PointerType * get(Type *ElementType, unsigned AddressSpace)
Function * getCalledFunction() const
virtual TruncInst * clone_impl() const
Clone an identical TruncInst.
*p = old <unsigned v ? old : v
CaseIteratorT(SwitchInstTy *SI, unsigned CaseNum)
void setOrdering(AtomicOrdering Ordering)
Set the ordering constraint on this cmpxchg.
*p = old >unsigned v ? old : v
static bool classof(const Value *V)
static bool classof(const Value *V)
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)
unsigned getNumIndices() const
void setSuccessor(unsigned i, BasicBlock *NewSucc)
FPTruncInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
Constructor with insert-before-instruction semantics.
Value * getNewValOperand()
unsigned getParamAlignment(unsigned Index) const
Return the alignment for the specified function parameter.
enable_if_c<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type cast(const Y &Val)
This class represents a sign extension of integer types.
virtual FPTruncInst * clone_impl() const
Clone an identical FPTruncInst.
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)
void setAddress(Value *V)
static IndirectBrInst * Create(Value *Address, unsigned NumDests, Instruction *InsertBefore=0)
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.
static bool classof(const Instruction *I)
bool isNoBuiltin() const
Return true if the call should not be treated as a call to a builtin.
static bool classof(const Instruction *I)
const Value * getPointerOperand() const
Value * getPersonalityFn() const
*p = old >signed v ? old : v
void setSynchScope(SynchronizationScope SynchScope)
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)
static SwitchInst * Create(Value *Value, BasicBlock *Default, unsigned NumCases, BasicBlock *InsertAtEnd)
Constant * getMask() const
FPToUIInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
Constructor with insert-before-instruction semantics.
virtual InsertValueInst * clone_impl() const
static BranchInst * Create(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond, BasicBlock *InsertAtEnd)
block_iterator block_end()
static bool classof(const Instruction *I)
BasicBlock *const * const_block_iterator
void setCallingConv(CallingConv::ID CC)
void swap(OwningPtr< T > &a, OwningPtr< T > &b)
static InsertValueInst * Create(Value *Agg, Value *Val, ArrayRef< unsigned > Idxs, const Twine &NameStr, BasicBlock *InsertAtEnd)
bool isArrayAllocation() const
static bool classof(const Instruction *I)
1 0 0 1 True if unordered or equal
void setSynchScope(SynchronizationScope xthread)
bool onlyReadsMemory() const
Determine if the call does not access or only reads memory.
static unsigned getOperandNumForIncomingValue(unsigned i)
static bool isRelational(Predicate P)
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.
virtual CallInst * clone_impl() const
static Value * getPointerOperand(Instruction &Inst)
unsigned getSubclassDataFromInstruction() const
static bool classof(const Value *V)
Value * getReturnValue() const
Convenience accessor. Returns null if there is no return value.
Base class of casting instructions.
bool onlyReadsMemory() const
Determine if the call does not access or only reads memory.
static bool classof(const Instruction *I)
bool doesNotReturn() const
Determine if the call cannot return.
static bool classof(const Value *V)
void setSynchScope(SynchronizationScope xthread)
static bool classof(const Value *V)
void setOrdering(AtomicOrdering Ordering)
void setIsInBounds(bool b=true)
unsigned getNumArgOperands() const
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
static BranchInst * Create(BasicBlock *IfTrue, Instruction *InsertBefore=0)
const Value * getCalledValue() const
This file contains the simple types necessary to represent the attributes associated with functions a...
bool isCommutative() const
Determine if this relation is commutative.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
Type * getAllocatedType() const
static ConstantInt * ExtractElement(Constant *V, Constant *Idx)
ID
LLVM Calling Convention Representation.
Value * getPointerOperand()
Type * getPointerOperandType() const
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.
static bool classof(const Instruction *I)
virtual SIToFPInst * clone_impl() const
Clone an identical SIToFPInst.
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()
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.
AtomicOrdering getOrdering() const
Returns the ordering constraint on this RMW.
void setCleanup(bool V)
setCleanup - Indicate that this landingpad instruction is a cleanup.
static bool classof(const Instruction *I)
static bool classof(const Value *V)
static bool classof(const Instruction *I)
VectorType * getType() const
bool isNoInline() const
Return true if the call should not be inlined.
void setValue(ConstantInt *V)
Sets the new value for current case.
virtual AddrSpaceCastInst * clone_impl() const
Clone an identical AddrSpaceCastInst.
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.
const unsigned * idx_iterator
CaseIteratorT< const SwitchInst, const ConstantInt, const BasicBlock > ConstCaseIt
CaseIt(const ParentTy &Src)
virtual PtrToIntInst * clone_impl() const
Clone an identical PtrToIntInst.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide fast operand accessors.
Represents a floating point comparison operator.
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
Value * getInsertedValueOperand()
const Value * getInsertedValueOperand() const
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
Predicate getUnsignedPredicate() const
Return the unsigned version of the predicate.
static bool classof(const Value *V)
unsigned getNumClauses() const
getNumClauses - Get the number of clauses for this landing pad.
void setInstructionSubclassData(unsigned short D)
virtual ZExtInst * clone_impl() const
Clone an identical ZExtInst.
This class represents a cast from floating point to signed integer.
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)
This class represents a truncation of integer types.
size_t size() const
size - Get the array size.
bool hasByValArgument() const
Determine if any call argument is an aggregate passed by value.
BasicBlock * getNormalDest() const
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.
OtherOps getOpcode() const
unsigned getNumIncomingValues() const
AllocaInst(Type *Ty, Value *ArraySize=0, const Twine &Name="", Instruction *InsertBefore=0)
BasicBlock * getIncomingBlock(value_use_iterator< U > I) const
Value * getClause(unsigned Idx) 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()
SIToFPInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
Constructor with insert-before-instruction semantics.
initializer< Ty > init(const Ty &Val)
void setDoesNotAccessMemory()
VAArgInst(Value *List, Type *Ty, const Twine &NameStr, BasicBlock *InsertAtEnd)
unsigned getAlignment() const
unsigned getCaseIndex() const
Returns number of current case.
static InsertElementInst * Create(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr="", Instruction *InsertBefore=0)
SynchronizationScope getSynchScope() const
static unsigned getAggregateOperandIndex()
LLVM Basic Block Representation.
static unsigned getPointerOperandIndex()
LLVM Constant Representation.
PointerType * getType() const
const Value * getCondition() const
Value * getCompareOperand()
virtual SExtInst * clone_impl() const
Clone an identical SExtInst.
static BranchInst * Create(BasicBlock *IfTrue, BasicBlock *InsertAtEnd)
unsigned getAlignment() const
static InvokeInst * Create(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=0)
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 PHINode * Create(Type *Ty, unsigned NumReservedValues, const Twine &NameStr="", Instruction *InsertBefore=0)
static SelectInst * Create(Value *C, Value *S1, Value *S2, const Twine &NameStr, BasicBlock *InsertAtEnd)
bool hasAllZeroIndices() const
BasicBlock * getIncomingBlock(unsigned i) const
static unsigned getPointerOperandIndex()
static bool classof(const Value *V)
Represent an integer comparison operator.
const Value * getValueOperand() const
bool doesNotAccessMemory() const
Determine if the call does not access memory.
Value * getOperand(unsigned i) const
0 1 1 1 True if ordered (no nans)
Value * getPointerOperand()
virtual AllocaInst * clone_impl() const
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.
Predicate getPredicate() const
Return the predicate for this instruction.
static bool classof(const Value *V)
virtual AtomicCmpXchgInst * clone_impl() const
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)
void setTailCall(bool isTC=true)
void swapOperands()
Swap operands and adjust predicate.
void setAtomic(AtomicOrdering Ordering, SynchronizationScope SynchScope=CrossThread)
bool hasAllConstantIndices() const
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)
ConstCaseIt case_end() const
Call cannot be duplicated.
unsigned getNumSuccessors() const
bool isRelational() const
bool operator!=(const Self &RHS) const
static bool classof(const Instruction *I)
CallingConv::ID getCallingConv() const
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.
bool hasByValArgument() const
Determine if any call argument is an aggregate passed by value.
static CallInst * Create(Value *Func, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=0)
ZExtInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
Constructor with insert-before-instruction semantics.
static InsertElementInst * Create(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr, BasicBlock *InsertAtEnd)
bool isConditional() const
idx_iterator idx_begin() const
static bool classof(const Value *V)
static bool classof(const Instruction *I)
static bool classof(const Value *V)
virtual FPToSIInst * clone_impl() const
Clone an identical FPToSIInst.
BasicBlock * getUnwindDest() const
AtomicOrdering getOrdering() const
Returns the ordering effect of this store.
Class for constant integers.
static bool classof(const Instruction *I)
void setIncomingBlock(unsigned i, BasicBlock *BB)
Value * getIncomingValue(unsigned i) const
bool cannotDuplicate() const
Determine if the call cannot be duplicated.
static Type * getGEPReturnType(Value *Ptr, ArrayRef< Value * > IdxList)
static bool classof(const Instruction *I)
AtomicCmpXchgInst(Value *Ptr, Value *Cmp, Value *NewVal, AtomicOrdering Ordering, SynchronizationScope SynchScope, Instruction *InsertBefore=0)
unsigned getParamAlignment(unsigned i) const
Extract the alignment for a call or parameter (0=unknown).
Type * checkGEPType(Type *Ty)
unsigned getNumSuccessors() const
virtual BitCastInst * clone_impl() const
Clone an identical BitCastInst.
const BasicBlock * getDestination(unsigned i) const
virtual IntToPtrInst * clone_impl() const
Clone an identical IntToPtrInst.
static bool classof(const Instruction *I)
ConstCaseIt case_begin() const
bool isStaticAlloca() const
const Value * getCompareOperand() const
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
const Value * getValOperand() const
LoadInst(Value *Ptr, const Twine &NameStr, Instruction *InsertBefore)
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
Return the predicate as if the operands were swapped.
Function * getCalledFunction() const
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 GetElementPtrInst * Create(Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=0)
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
CaseIt findCaseValue(const ConstantInt *C)
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)
#define LLVM_DELETED_FUNCTION
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
BasicBlock ** block_iterator
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
Value * getIncomingValueForBlock(const BasicBlock *BB) const
bool isCommutative() const
Determine if this is a commutative predicate.
PtrToIntInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
Constructor with insert-before-instruction semantics.
Function only reads from memory.
static bool classof(const Value *V)
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.
virtual GetElementPtrInst * clone_impl() const
static ResumeInst * Create(Value *Exn, BasicBlock *InsertAtEnd)
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(DefaultAlign), cl::values(clEnumValN(DefaultAlign,"arm-default-align","Generate unaligned accesses only on hardware/OS ""combinations that are known to support them"), clEnumValN(StrictAlign,"arm-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"arm-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
Value * getCondition() const
bool isInlineAsm() const
isInlineAsm - Check if this call is an inline asm statement.
const AttributeSet & getAttributes() const
bool isNoBuiltin() const
Return true if the call should not be treated as a call to a builtin.
const Value * getNewValOperand() const
static bool classof(const Value *V)
static InsertValueInst * Create(Value *Agg, Value *Val, ArrayRef< unsigned > Idxs, const Twine &NameStr="", Instruction *InsertBefore=0)
void setOrdering(AtomicOrdering Ordering)
ConstCaseIt case_default() const
void setCalledFunction(Value *Fn)
setCalledFunction - Set the function called.
BitCastInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
Constructor with insert-before-instruction semantics.
Value * getArgOperand(unsigned i) const
BasicBlock * getSuccessor(unsigned idx) const
Value * getCondition() const
const AttributeSet & getAttributes() const
BasicBlock * getDefaultDest() const
void setArgOperand(unsigned i, Value *v)
void setDoesNotAccessMemory()
virtual FCmpInst * clone_impl() const
Clone an identical FCmpInst.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
unsigned getNumSuccessors() const
void setCondition(Value *V)
FPExtInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
Constructor with insert-before-instruction semantics.
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...
static GetElementPtrInst * Create(Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr, BasicBlock *InsertAtEnd)
unsigned getAlignment() const
void setOperation(BinOp Operation)
Value * getPointerOperand()
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
Callee isn't recognized as a builtin.
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
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
unsigned getNumSuccessors() const
VAArgInst(Value *List, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
VectorType * getType() const
static unsigned getPointerOperandIndex()
void setOnlyReadsMemory()
ICmpInst(Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
Constructor with no-insertion semantics.
virtual FPToUIInst * clone_impl() const
Clone an identical FPToUIInst.
static ReturnInst * Create(LLVMContext &C, Value *retVal=0, Instruction *InsertBefore=0)
unsigned getNumCases() const
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)
static bool classof(const Value *V)
static bool classof(const Value *V)
void setCondition(Value *V)
const_block_iterator block_begin() const
static unsigned getPointerOperandIndex()
const Value * getPointerOperand() const
This class represents a cast from signed integer to floating point.
void swapOperands()
Swap operands and adjust predicate.
void setAttributes(const AttributeSet &Attrs)
Function can return twice.
static Type * getIndexedType(Type *Ptr, ArrayRef< Value * > IdxList)
virtual FPExtInst * clone_impl() const
Clone an identical FPExtInst.
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
This class represents a truncation of floating point types.
0 0 0 1 True if ordered and equal
FPToSIInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
Constructor with insert-before-instruction semantics.
LLVM Value Representation.
void setAlignment(unsigned Align)
unsigned getOpcode() const
getOpcode() returns a member of one of the enums like Instruction::Add.
void setDefaultDest(BasicBlock *DefaultCase)
void setOnlyReadsMemory()
static VectorType * get(Type *ElementType, unsigned NumElements)
const Value * getArraySize() const
StoreInst(Value *Val, Value *Ptr, Instruction *InsertBefore)
void setCallingConv(CallingConv::ID CC)
UIToFPInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
Constructor with insert-before-instruction semantics.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
void setSynchScope(SynchronizationScope SynchScope)
static bool classof(const Instruction *I)
Predicate getSignedPredicate() const
Return the signed version of the predicate.
const Value * getFalseValue() const
const_block_iterator block_end() const
ICmpInst(Instruction *InsertBefore, Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
Constructor with insert-before-instruction semantics.
CallingConv::ID getCallingConv() const
virtual UIToFPInst * clone_impl() const
Clone an identical UIToFPInst.
static bool classof(const Value *V)
static GetElementPtrInst * CreateInBounds(Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=0)
void setIncomingValue(unsigned i, Value *V)
TruncInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
Constructor with insert-before-instruction semantics.
static bool classof(const Value *V)
This class represents an extension of floating point types.
bool isRelational() const
Determine if this a relational predicate.
SynchronizationScope getSynchScope() const
const Value * getPointerOperand() const
SExtInst(Value *S, Type *Ty, const Twine &NameStr="", Instruction *InsertBefore=0)
Constructor with insert-before-instruction semantics.
unsigned getNumArgOperands() const
Value * getPointerOperand()
unsigned getNumSuccessors() const
int getBasicBlockIndex(const BasicBlock *BB) const
static ResumeInst * Create(Value *Exn, Instruction *InsertBefore=0)
unsigned getNumDestinations() const
const Value * getPointerOperand() const
static SwitchInst * Create(Value *Value, BasicBlock *Default, unsigned NumCases, Instruction *InsertBefore=0)
static bool classof(const Value *V)
static bool classof(const Instruction *I)
static Instruction * CreateMalloc(Instruction *InsertBefore, Type *IntPtrTy, Type *AllocTy, Value *AllocSize, Value *ArraySize=0, Function *MallocF=0, const Twine &Name="")
static unsigned getPointerOperandIndex()
const_op_iterator idx_begin() const
SmallVector< int, 16 > getShuffleMask() const
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)
static IndirectBrInst * Create(Value *Address, unsigned NumDests, BasicBlock *InsertAtEnd)
static bool classof(const Instruction *I)
bool operator==(const Self &RHS) const
static bool classof(const Instruction *I)
const Value * getPointerOperand() const
Predicate getSwappedPredicate(Predicate Opcode)