9#ifndef LLVM_SANDBOXIR_INSTRUCTION_H
10#define LLVM_SANDBOXIR_INSTRUCTION_H
31 assert(InsertAtEnd !=
nullptr &&
"Expected non-null!");
32 InsertAt = InsertAtEnd->
end();
47#define OPCODES(...) __VA_ARGS__
48#define DEF_INSTR(ID, OPC, CLASS) OPC
49#include "llvm/SandboxIR/Values.def"
107 auto &
Ctx = WhereBB->getContext();
109 if (WhereIt != WhereBB->end())
110 Builder.SetInsertPoint((*Pos).getTopmostLLVMInstruction());
112 Builder.SetInsertPoint(cast<llvm::BasicBlock>(WhereBB->Val));
135 return cast<llvm::Instruction>(
Val)->getModule()->getDataLayout();
144 return cast<llvm::Instruction>(
Val)->isTerminator();
146 bool isUnaryOp()
const {
return cast<llvm::Instruction>(
Val)->isUnaryOp(); }
147 bool isBinaryOp()
const {
return cast<llvm::Instruction>(
Val)->isBinaryOp(); }
149 return cast<llvm::Instruction>(
Val)->isIntDivRem();
151 bool isShift()
const {
return cast<llvm::Instruction>(
Val)->isShift(); }
152 bool isCast()
const {
return cast<llvm::Instruction>(
Val)->isCast(); }
154 return cast<llvm::Instruction>(
Val)->isFuncletPad();
157 return cast<llvm::Instruction>(
Val)->isSpecialTerminator();
160 return cast<llvm::Instruction>(
Val)->isOnlyUserOfAnyOperand();
163 return cast<llvm::Instruction>(
Val)->isLogicalShift();
172 return cast<llvm::Instruction>(
Val)->hasMetadata();
178 return cast<llvm::Instruction>(
Val)->hasMetadataOtherThanDebugLoc();
183 return cast<llvm::Instruction>(
Val)->hasMetadata(KindID);
216 return cast<llvm::Instruction>(
Val)->comesBefore(
217 cast<llvm::Instruction>(
Other->Val));
227 return cast<llvm::Instruction>(
Val)->hasNoUnsignedWrap();
234 return cast<llvm::Instruction>(
Val)->hasNoSignedWrap();
240 bool isFast()
const {
return cast<llvm::Instruction>(
Val)->isFast(); }
247 return cast<llvm::Instruction>(
Val)->hasAllowReassoc();
254 bool isExact()
const {
return cast<llvm::Instruction>(
Val)->isExact(); }
259 bool hasNoNaNs()
const {
return cast<llvm::Instruction>(
Val)->hasNoNaNs(); }
265 bool hasNoInfs()
const {
return cast<llvm::Instruction>(
Val)->hasNoInfs(); }
272 return cast<llvm::Instruction>(
Val)->hasNoSignedZeros();
280 return cast<llvm::Instruction>(
Val)->hasAllowReciprocal();
288 return cast<llvm::Instruction>(
Val)->hasAllowContract();
296 return cast<llvm::Instruction>(
Val)->hasApproxFunc();
306 return cast<llvm::Instruction>(
Val)->getFastMathFlags();
318 return cast<llvm::Instruction>(
Val)->isAssociative();
322 return cast<llvm::Instruction>(
Val)->isCommutative();
326 return cast<llvm::Instruction>(
Val)->isIdempotent();
330 return cast<llvm::Instruction>(
Val)->isNilpotent();
334 return cast<llvm::Instruction>(
Val)->mayWriteToMemory();
338 return cast<llvm::Instruction>(
Val)->mayReadFromMemory();
341 return cast<llvm::Instruction>(
Val)->mayReadOrWriteMemory();
344 bool isAtomic()
const {
return cast<llvm::Instruction>(
Val)->isAtomic(); }
347 return cast<llvm::Instruction>(
Val)->hasAtomicLoad();
351 return cast<llvm::Instruction>(
Val)->hasAtomicStore();
354 bool isVolatile()
const {
return cast<llvm::Instruction>(
Val)->isVolatile(); }
358 bool mayThrow(
bool IncludePhaseOneUnwind =
false)
const {
359 return cast<llvm::Instruction>(
Val)->mayThrow(IncludePhaseOneUnwind);
363 return cast<llvm::Instruction>(
Val)->isFenceLike();
367 return cast<llvm::Instruction>(
Val)->mayHaveSideEffects();
384#define DEF_INSTR(ID, OPC, CLASS) friend class CLASS;
385#include "llvm/SandboxIR/Values.def"
391 Use getOperandUseInternal(
unsigned OpIdx,
bool Verify)
const final {
395 return {cast<llvm::Instruction>(
Val)};
423 return cast<llvm::FenceInst>(
Val)->getOrdering();
430 return cast<llvm::FenceInst>(
Val)->getSyncScopeID();
435 return From->getSubclassID() == ClassID::Fence;
488 return From->getSubclassID() == ClassID::InsertElement;
502 Opcode::ExtractElement,
I,
Ctx) {}
510 return From->getSubclassID() == ClassID::ExtractElement;
539 return From->getSubclassID() == ClassID::ShuffleVector;
564 return cast<llvm::ShuffleVectorInst>(
Val)->getMaskValue(Elt);
578 cast<llvm::ShuffleVectorInst>(
Val)->getShuffleMask(Result);
590 return cast<llvm::ShuffleVectorInst>(
Val)->getShuffleMask();
598 return cast<llvm::ShuffleVectorInst>(
Val)->changesLength();
605 return cast<llvm::ShuffleVectorInst>(
Val)->increasesLength();
618 cast<llvm::Constant>(Mask->Val), NumSrcElts);
625 return cast<llvm::ShuffleVectorInst>(
Val)->isSingleSource();
638 cast<llvm::Constant>(Mask->Val), NumSrcElts);
646 return cast<llvm::ShuffleVectorInst>(
Val)->isIdentity();
652 return cast<llvm::ShuffleVectorInst>(
Val)->isIdentityWithPadding();
658 return cast<llvm::ShuffleVectorInst>(
Val)->isIdentityWithExtract();
665 return cast<llvm::ShuffleVectorInst>(
Val)->isConcat();
681 cast<llvm::Constant>(Mask->Val), NumSrcElts);
692 return cast<llvm::ShuffleVectorInst>(
Val)->isSelect();
705 cast<llvm::Constant>(Mask->Val), NumSrcElts);
712 return cast<llvm::ShuffleVectorInst>(
Val)->isReverse();
725 cast<llvm::Constant>(Mask->Val), NumSrcElts);
733 return cast<llvm::ShuffleVectorInst>(
Val)->isZeroEltSplat();
773 cast<llvm::Constant>(Mask->Val), NumSrcElts);
782 return cast<llvm::ShuffleVectorInst>(
Val)->isTranspose();
796 cast<llvm::Constant>(Mask->Val), NumSrcElts,
Index);
804 return cast<llvm::ShuffleVectorInst>(
Val)->isSplice(
Index);
818 cast<llvm::Constant>(Mask->Val), NumSrcElts,
Index);
823 return cast<llvm::ShuffleVectorInst>(
Val)->isExtractSubvectorMask(
Index);
831 int &NumSubElts,
int &
Index) {
836 int &NumSubElts,
int &
Index) {
838 cast<llvm::Constant>(Mask->Val), NumSrcElts, NumSubElts,
Index);
843 return cast<llvm::ShuffleVectorInst>(
Val)->isInsertSubvectorMask(NumSubElts,
859 cast<llvm::Constant>(Mask->Val), ReplicationFactor, VF);
864 return cast<llvm::ShuffleVectorInst>(
Val)->isReplicationMask(
865 ReplicationFactor, VF);
884 return cast<llvm::ShuffleVectorInst>(
Val)->isOneUseSingleSourceMask(VF);
890 unsigned InVecNumElts) {
896 return cast<llvm::ShuffleVectorInst>(
Val)->isInterleave(Factor);
919 unsigned NumInputElts,
925 unsigned NumInputElts) {
954 unsigned MinSubElts,
unsigned MaxSubElts,
955 unsigned &NumSubElts,
unsigned &RotateAmt) {
957 Mask, EltSizeInBits, MinSubElts, MaxSubElts, NumSubElts, RotateAmt);
975 return From->getSubclassID() == ClassID::InsertValue;
980 return cast<llvm::InsertValueInst>(
Val)->idx_begin();
983 return cast<llvm::InsertValueInst>(
Val)->idx_end();
986 return cast<llvm::InsertValueInst>(
Val)->indices();
1010 return cast<llvm::InsertValueInst>(
Val)->getIndices();
1014 return cast<llvm::InsertValueInst>(
Val)->getNumIndices();
1018 return cast<llvm::InsertValueInst>(
Val)->hasIndices();
1037 return cast<llvm::BranchInst>(
Val)->isUnconditional();
1040 return cast<llvm::BranchInst>(
Val)->isConditional();
1050 struct LLVMBBToSBBB {
1052 LLVMBBToSBBB(
Context &Ctx) : Ctx(Ctx) {}
1056 struct ConstLLVMBBToSBBB {
1058 ConstLLVMBBToSBBB(Context &Ctx) : Ctx(Ctx) {}
1067 cast<llvm::BranchInst>(
Val)->successors();
1068 LLVMBBToSBBB BBMap(
Ctx);
1081 ConstLLVMBBToSBBB ConstBBMap(
Ctx);
1086 return make_range(ConstMappedBegin, ConstMappedEnd);
1100 return isa<LoadInst>(
I) || isa<CastInst>(
I) || isa<FreezeInst>(
I);
1103 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
1120 return From->getSubclassID() == ClassID::ExtractValue;
1132 return cast<llvm::ExtractValueInst>(
Val)->idx_begin();
1135 return cast<llvm::ExtractValueInst>(
Val)->idx_end();
1138 return cast<llvm::ExtractValueInst>(
Val)->indices();
1152 return cast<llvm::ExtractValueInst>(
Val)->getIndices();
1156 return cast<llvm::ExtractValueInst>(
Val)->getNumIndices();
1160 return cast<llvm::ExtractValueInst>(
Val)->hasIndices();
1180 return From->getSubclassID() == ClassID::VAArg;
1193 return From->getSubclassID() == ClassID::Freeze;
1223 bool isSimple()
const {
return cast<llvm::LoadInst>(
Val)->isSimple(); }
1251 bool isSimple()
const {
return cast<llvm::StoreInst>(
Val)->isSimple(); }
1260 Use getOperandUseInternal(
unsigned OpIdx,
bool Verify)
const final {
1264 return {cast<llvm::Instruction>(
Val)};
1291 return From->getSubclassID() == ClassID::Ret;
1306 auto Opc =
From->getSubclassID();
1307 return Opc == Instruction::ClassID::Call ||
1308 Opc == Instruction::ClassID::Invoke ||
1309 Opc == Instruction::ClassID::CallBr;
1319 auto *LLVMCB = cast<llvm::CallBase>(
Val);
1320 auto Dist = LLVMCB->data_operands_end() - LLVMCB->data_operands_begin();
1324 auto *LLVMCB = cast<llvm::CallBase>(
Val);
1325 auto Dist = LLVMCB->data_operands_end() - LLVMCB->data_operands_begin();
1341 assert(
this == U.getUser() &&
1342 "Only valid to query with a use of this instruction!");
1343 return cast<llvm::CallBase>(
Val)->isDataOperand(U.LLVMUse);
1347 return cast<llvm::CallBase>(
Val)->getDataOperandNo(U.LLVMUse);
1353 return cast<llvm::CallBase>(
Val)->getNumTotalBundleOperands();
1392 return cast<llvm::CallBase>(
Val)->isArgOperand(U.LLVMUse);
1395 return cast<llvm::CallBase>(
Val)->getArgOperandNo(U.LLVMUse);
1404 return cast<llvm::CallBase>(
Val)->isIndirectCall();
1407 return cast<llvm::CallBase>(
Val)->isCallee(U.LLVMUse);
1414 return cast<llvm::CallBase>(
Val)->isMustTailCall();
1418 return cast<llvm::CallBase>(
Val)->getIntrinsicID();
1423 return cast<llvm::CallBase>(
Val)->getCallingConv();
1442 return From->getSubclassID() == ClassID::Call;
1462 return From->getSubclassID() == ClassID::Invoke;
1471 assert(SuccIdx < 2 &&
"Successor # out of range for invoke!");
1478 return cast<llvm::InvokeInst>(
Val)->getNumSuccessors();
1497 return From->getSubclassID() == ClassID::CallBr;
1500 return cast<llvm::CallBrInst>(
Val)->getNumIndirectDests();
1511 return cast<llvm::CallBrInst>(
Val)->getNumSuccessors();
1523 unsigned NumReservedClauses,
1530 return cast<llvm::LandingPadInst>(
Val)->isCleanup();
1544 return cast<llvm::LandingPadInst>(
Val)->isCatch(
Idx);
1548 return cast<llvm::LandingPadInst>(
Val)->isFilter(
Idx);
1552 return cast<llvm::LandingPadInst>(
Val)->getNumOperands();
1556 return From->getSubclassID() == ClassID::LandingPad;
1570 return cast<llvm::FuncletPadInst>(
Val)->arg_size();
1585 return From->getSubclassID() == ClassID::CatchPad ||
1586 From->getSubclassID() == ClassID::CleanupPad;
1604 return From->getSubclassID() == ClassID::CatchPad;
1619 return From->getSubclassID() == ClassID::CleanupPad;
1639 return cast<llvm::CatchReturnInst>(
Val)->getNumSuccessors();
1643 return From->getSubclassID() == ClassID::CatchRet;
1659 return cast<llvm::CleanupReturnInst>(
Val)->hasUnwindDest();
1662 return cast<llvm::CleanupReturnInst>(
Val)->unwindsToCaller();
1667 return cast<llvm::CleanupReturnInst>(
Val)->getNumSuccessors();
1673 return From->getSubclassID() == ClassID::CleanupRet;
1692 const Twine &NameStr =
"");
1695 return From->getSubclassID() == ClassID::GetElementPtr;
1701 return cast<llvm::GetElementPtrInst>(
Val)->getAddressSpace();
1725 return cast<llvm::GetElementPtrInst>(
Val)->getPointerAddressSpace();
1728 return cast<llvm::GetElementPtrInst>(
Val)->getNumIndices();
1731 return cast<llvm::GetElementPtrInst>(
Val)->hasIndices();
1734 return cast<llvm::GetElementPtrInst>(
Val)->hasAllConstantIndices();
1737 return cast<llvm::GetElementPtrInst>(
Val)->getNoWrapFlags();
1740 return cast<llvm::GetElementPtrInst>(
Val)->isInBounds();
1743 return cast<llvm::GetElementPtrInst>(
Val)->hasNoUnsignedSignedWrap();
1746 return cast<llvm::GetElementPtrInst>(
Val)->hasNoUnsignedWrap();
1749 return cast<llvm::GetElementPtrInst>(
Val)->accumulateConstantOffset(
DL,
1771 return cast<llvm::CatchSwitchInst>(
Val)->hasUnwindDest();
1774 return cast<llvm::CatchSwitchInst>(
Val)->unwindsToCaller();
1780 return cast<llvm::CatchSwitchInst>(
Val)->getNumHandlers();
1784 static BasicBlock *handler_helper(
Value *V) {
return cast<BasicBlock>(V); }
1786 return cast<BasicBlock>(V);
1832 "Successor # out of range for catchswitch!");
1837 "Successor # out of range for catchswitch!");
1842 return From->getSubclassID() == ClassID::CatchSwitch;
1856 return cast<llvm::ResumeInst>(
Val)->getNumSuccessors();
1859 return From->getSubclassID() == ClassID::Resume;
1880 return cast<llvm::SwitchInst>(
Val)->defaultDestUnreachable();
1884 return cast<llvm::SwitchInst>(
Val)->getNumCases();
1940 return cast<llvm::SwitchInst>(
Val)->getNumSuccessors();
1945 return From->getSubclassID() == ClassID::Switch;
1952 case llvm::Instruction::FNeg:
1953 return Opcode::FNeg;
1954 case llvm::Instruction::UnaryOpsEnd:
1973 return From->getSubclassID() == ClassID::UnOp;
1981 case llvm::Instruction::Add:
1983 case llvm::Instruction::FAdd:
1984 return Opcode::FAdd;
1985 case llvm::Instruction::Sub:
1987 case llvm::Instruction::FSub:
1988 return Opcode::FSub;
1989 case llvm::Instruction::Mul:
1991 case llvm::Instruction::FMul:
1992 return Opcode::FMul;
1993 case llvm::Instruction::UDiv:
1994 return Opcode::UDiv;
1995 case llvm::Instruction::SDiv:
1996 return Opcode::SDiv;
1997 case llvm::Instruction::FDiv:
1998 return Opcode::FDiv;
1999 case llvm::Instruction::URem:
2000 return Opcode::URem;
2001 case llvm::Instruction::SRem:
2002 return Opcode::SRem;
2003 case llvm::Instruction::FRem:
2004 return Opcode::FRem;
2005 case llvm::Instruction::Shl:
2007 case llvm::Instruction::LShr:
2008 return Opcode::LShr;
2009 case llvm::Instruction::AShr:
2010 return Opcode::AShr;
2011 case llvm::Instruction::And:
2013 case llvm::Instruction::Or:
2015 case llvm::Instruction::Xor:
2017 case llvm::Instruction::BinaryOpsEnd:
2040 return From->getSubclassID() == ClassID::BinaryOperator;
2052 return cast<llvm::PossiblyDisjointInst>(
Val)->isDisjoint();
2056 return isa<Instruction>(
From) &&
2057 cast<Instruction>(
From)->getOpcode() == Opcode::Or;
2064 Instruction::Opcode::AtomicRMW, Atomic,
Ctx) {
2071 return cast<llvm::AtomicRMWInst>(
Val)->getOperation();
2080 cast<llvm::AtomicRMWInst>(
Val)->setOperation(
Op);
2085 return cast<llvm::AtomicRMWInst>(
Val)->isVolatile();
2089 return cast<llvm::AtomicRMWInst>(
Val)->getOrdering();
2093 return cast<llvm::AtomicRMWInst>(
Val)->getSyncScopeID();
2105 return cast<llvm::AtomicRMWInst>(
Val)->getPointerAddressSpace();
2108 return cast<llvm::AtomicRMWInst>(
Val)->isFloatingPointOperation();
2111 return From->getSubclassID() == ClassID::AtomicRMW;
2124 Instruction::Opcode::AtomicCmpXchg, Atomic,
2132 return cast<llvm::AtomicCmpXchgInst>(
Val)->getAlign();
2139 return cast<llvm::AtomicCmpXchgInst>(
Val)->isVolatile();
2144 bool isWeak()
const {
return cast<llvm::AtomicCmpXchgInst>(
Val)->isWeak(); }
2153 return cast<llvm::AtomicCmpXchgInst>(
Val)->getSuccessOrdering();
2158 return cast<llvm::AtomicCmpXchgInst>(
Val)->getFailureOrdering();
2162 return cast<llvm::AtomicCmpXchgInst>(
Val)->getMergedOrdering();
2165 return cast<llvm::AtomicCmpXchgInst>(
Val)->getSyncScopeID();
2185 return cast<llvm::AtomicCmpXchgInst>(
Val)->getPointerAddressSpace();
2195 return From->getSubclassID() == ClassID::AtomicCmpXchg;
2208 Value *ArraySize =
nullptr,
2214 return cast<llvm::AllocaInst>(
Val)->isArrayAllocation();
2226 return cast<llvm::AllocaInst>(
Val)->getAddressSpace();
2231 return cast<llvm::AllocaInst>(
Val)->getAllocationSize(
DL);
2236 return cast<llvm::AllocaInst>(
Val)->getAllocationSizeInBits(
DL);
2251 return cast<llvm::AllocaInst>(
Val)->isStaticAlloca();
2256 return cast<llvm::AllocaInst>(
Val)->isUsedWithInAlloca();
2262 if (
auto *
I = dyn_cast<Instruction>(
From))
2263 return I->getSubclassID() == Instruction::ClassID::Alloca;
2271 case llvm::Instruction::ZExt:
2272 return Opcode::ZExt;
2273 case llvm::Instruction::SExt:
2274 return Opcode::SExt;
2275 case llvm::Instruction::FPToUI:
2276 return Opcode::FPToUI;
2277 case llvm::Instruction::FPToSI:
2278 return Opcode::FPToSI;
2279 case llvm::Instruction::FPExt:
2280 return Opcode::FPExt;
2281 case llvm::Instruction::PtrToAddr:
2282 return Opcode::PtrToAddr;
2283 case llvm::Instruction::PtrToInt:
2284 return Opcode::PtrToInt;
2285 case llvm::Instruction::IntToPtr:
2286 return Opcode::IntToPtr;
2287 case llvm::Instruction::SIToFP:
2288 return Opcode::SIToFP;
2289 case llvm::Instruction::UIToFP:
2290 return Opcode::UIToFP;
2291 case llvm::Instruction::Trunc:
2292 return Opcode::Trunc;
2293 case llvm::Instruction::FPTrunc:
2294 return Opcode::FPTrunc;
2295 case llvm::Instruction::BitCast:
2296 return Opcode::BitCast;
2297 case llvm::Instruction::AddrSpaceCast:
2298 return Opcode::AddrSpaceCast;
2299 case llvm::Instruction::CastOpsEnd:
2325 return cast<llvm::PossiblyNonNegInst>(
Val)->hasNonNeg();
2330 if (
auto *
I = dyn_cast<Instruction>(
From)) {
2331 switch (
I->getOpcode()) {
2333 case Opcode::UIToFP:
2352 if (
auto *
I = dyn_cast<Instruction>(
From))
2353 return I->getOpcode() ==
Op;
2370 :
public CastInstImpl<Instruction::Opcode::PtrToAddr> {};
2375 :
public CastInstImpl<Instruction::Opcode::AddrSpaceCast> {
2403 LLVMBBToBB(
Context &Ctx) : Ctx(Ctx) {}
2418 LLVMBBToBB BBGetter(
Ctx);
2423 LLVMBBToBB BBGetter(
Ctx);
2436 return cast<llvm::PHINode>(
Val)->getNumIncomingValues();
2462 return cast<llvm::PHINode>(
Val)->hasConstantOrUndefValue();
2475#define WRAP_STATIC_PREDICATE(FunctionName) \
2476 static auto FunctionName(Predicate P) { return LLVMValType::FunctionName(P); }
2479#define WRAP_MEMBER(FunctionName) \
2480 auto FunctionName() const { return cast<LLVMValType>(Val)->FunctionName(); }
2482#define WRAP_BOTH(FunctionName) \
2483 WRAP_STATIC_PREDICATE(FunctionName) \
2484 WRAP_MEMBER(FunctionName)
2536 return From->getSubclassID() == ClassID::ICmp ||
2537 From->getSubclassID() == ClassID::FCmp;
2552 :
CmpInst(CI,
Ctx, ClassID::ICmp, Opcode::ICmp) {}
2582 return From->getSubclassID() == ClassID::ICmp;
2589 :
CmpInst(CI,
Ctx, ClassID::FCmp, Opcode::FCmp) {}
2607 return From->getSubclassID() == ClassID::FCmp;
2611#undef WRAP_STATIC_PREDICATE
2626 return From->getSubclassID() == ClassID::Opaque;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
BlockVerifier::State From
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
static bool isSigned(unsigned int Opcode)
Module.h This file contains the declarations for the Module class.
MachineInstr unsigned OpIdx
ppc ctr loops PowerPC CTR Loops Verify
const SmallVectorImpl< MachineOperand > & Cond
Class for arbitrary precision integers.
an instruction to allocate memory on the stack
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
An instruction that atomically checks whether a specified value is in a memory location,...
static bool isValidFailureOrdering(AtomicOrdering Ordering)
static bool isValidSuccessOrdering(AtomicOrdering Ordering)
an instruction that atomically reads a memory location, combines it with another value,...
static bool isFPOperation(BinOp Op)
BinOp
This enumeration lists the possible modifications atomicrmw can make.
static LLVM_ABI StringRef getOperationName(BinOp Op)
LLVM Basic Block Representation.
Conditional or Unconditional Branch instruction.
This is the base class for all instructions that perform data casts.
Instruction::CastOps getOpcode() const
Return the opcode of this CastInst.
This class is the base class for the comparison instructions.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
An abstraction over a floating-point predicate, and a pack of an integer predicate with samesign info...
This class represents an Operation in the Expression.
A parsed version of the target data layout string in and methods for querying it.
This instruction compares its operands according to the predicate given to the constructor.
static LLVM_ABI bool compare(const APFloat &LHS, const APFloat &RHS, FCmpInst::Predicate Pred)
Return result of LHS Pred RHS comparison.
static auto predicates()
Returns the sequence of all FCmp predicates.
Convenience struct for specifying and reasoning about fast-math flags.
An instruction for ordering other memory operations.
This class represents a freeze function that returns random concrete value if an operand is either a ...
Represents flags for the getelementptr instruction/expression.
static unsigned getPointerOperandIndex()
This instruction compares its operands according to the predicate given to the constructor.
static LLVM_ABI bool compare(const APInt &LHS, const APInt &RHS, ICmpInst::Predicate Pred)
Return result of LHS Pred RHS comparison.
static LLVM_ABI std::optional< bool > isImpliedByMatchingCmp(CmpPredicate Pred1, CmpPredicate Pred2)
Determine if Pred1 implies Pred2 is true, false, or if nothing can be inferred about the implication,...
static auto predicates()
Returns the sequence of all ICmp predicates.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
static LLVM_ABI bool isValidOperands(const Value *Vec, const Value *NewElt, const Value *Idx)
Return true if an insertelement instruction can be formed with the specified operands.
This instruction inserts a struct field of array element value into an aggregate value.
static unsigned getAggregateOperandIndex()
const unsigned * idx_iterator
static unsigned getInsertedValueOperandIndex()
The landingpad instruction holds all of the information necessary to generate correct exception handl...
An instruction for reading from memory.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
static unsigned getOperandNumForIncomingValue(unsigned i)
static unsigned getIncomingValueNumForOperand(unsigned i)
Resume the propagation of an exception.
This class represents the LLVM 'select' instruction.
static LLVM_ABI const char * areInvalidOperands(Value *Cond, Value *True, Value *False)
Return a string if the specified operands are invalid for a select operation, otherwise return null.
static LLVM_ABI bool isZeroEltSplatMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask chooses all elements with the same value as the first element of exa...
ArrayRef< int > getShuffleMask() const
static LLVM_ABI bool isSpliceMask(ArrayRef< int > Mask, int NumSrcElts, int &Index)
Return true if this shuffle mask is a splice mask, concatenating the two inputs together and then ext...
static LLVM_ABI bool isValidOperands(const Value *V1, const Value *V2, const Value *Mask)
Return true if a shufflevector instruction can be formed with the specified operands.
static LLVM_ABI bool isSelectMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask chooses elements from its source vectors without lane crossings.
static LLVM_ABI bool isBitRotateMask(ArrayRef< int > Mask, unsigned EltSizeInBits, unsigned MinSubElts, unsigned MaxSubElts, unsigned &NumSubElts, unsigned &RotateAmt)
Checks if the shuffle is a bit rotation of the first operand across multiple subelements,...
static LLVM_ABI bool isOneUseSingleSourceMask(ArrayRef< int > Mask, int VF)
Return true if this shuffle mask represents "clustered" mask of size VF, i.e.
static LLVM_ABI bool isSingleSourceMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask chooses elements from exactly one source vector.
static LLVM_ABI bool isDeInterleaveMaskOfFactor(ArrayRef< int > Mask, unsigned Factor, unsigned &Index)
Check if the mask is a DE-interleave mask of the given factor Factor like: <Index,...
static LLVM_ABI bool isIdentityMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask chooses elements from exactly one source vector without lane crossin...
static LLVM_ABI bool isExtractSubvectorMask(ArrayRef< int > Mask, int NumSrcElts, int &Index)
Return true if this shuffle mask is an extract subvector mask.
static LLVM_ABI bool isReverseMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask swaps the order of elements from exactly one source vector.
static void commuteShuffleMask(MutableArrayRef< int > Mask, unsigned InVecNumElts)
Change values in a shuffle permute mask assuming the two vector operands of length InVecNumElts have ...
static LLVM_ABI bool isTransposeMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask is a transpose mask.
static LLVM_ABI bool isInsertSubvectorMask(ArrayRef< int > Mask, int NumSrcElts, int &NumSubElts, int &Index)
Return true if this shuffle mask is an insert subvector mask.
static LLVM_ABI bool isReplicationMask(ArrayRef< int > Mask, int &ReplicationFactor, int &VF)
Return true if this shuffle mask replicates each of the VF elements in a vector ReplicationFactor tim...
static LLVM_ABI bool isInterleaveMask(ArrayRef< int > Mask, unsigned Factor, unsigned NumInputElts, SmallVectorImpl< unsigned > &StartIndexes)
Return true if the mask interleaves one or more input vectors together.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
An instruction for storing to memory.
StringRef - Represent a constant reference to a string, i.e.
ConstantIntT * getCaseValue() const
Resolves case value for current case.
static const unsigned DefaultPseudoIndex
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
UnaryOps getOpcode() const
This function has undefined behavior.
This class represents the va_arg llvm instruction, which returns an argument of the specified type gi...
static unsigned getPointerOperandIndex()
LLVM Value Representation.
An efficient, type-erasing, non-owning reference to a callable.
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
unsigned getSrcAddressSpace() const
\Returns the address space of the pointer operand.
Value * getPointerOperand()
\Returns the pointer operand.
unsigned getDestAddressSpace() const
\Returns the address space of the result.
const Value * getPointerOperand() const
\Returns the pointer operand.
static unsigned getPointerOperandIndex()
\Returns the operand index of the pointer operand.
bool isUsedWithInAlloca() const
Return true if this alloca is used as an inalloca argument to a call.
LLVM_ABI Type * getAllocatedType() const
Return the type that is being allocated by the instruction.
bool isStaticAlloca() const
Return true if this alloca is in the entry block of the function and is a constant size.
LLVM_ABI void setAllocatedType(Type *Ty)
for use only in special circumstances that need to generically transform a whole instruction (eg: IR ...
bool isArrayAllocation() const
Return true if there is an allocation size parameter to the allocation instruction that is not 1.
std::optional< TypeSize > getAllocationSizeInBits(const DataLayout &DL) const
Get allocation size in bits.
LLVM_ABI Value * getArraySize()
Get the number of elements allocated.
unsigned getAddressSpace() const
Return the address space for the allocation.
Align getAlign() const
Return the alignment of the memory that is being allocated by the instruction.
LLVM_ABI PointerType * getType() const
Overload to return most specific pointer type.
LLVM_ABI void setUsedWithInAlloca(bool V)
Specify whether this alloca is used to represent the arguments to a call.
static bool classof(const Value *From)
std::optional< TypeSize > getAllocationSize(const DataLayout &DL) const
Get allocation size in bytes.
LLVM_ABI void setAlignment(Align Align)
const Value * getArraySize() const
static LLVM_ABI AllocaInst * create(Type *Ty, unsigned AddrSpace, InsertPosition Pos, Context &Ctx, Value *ArraySize=nullptr, const Twine &Name="")
LLVM_ABI Value * getPointerOperand()
const Value * getNewValOperand() const
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
AtomicOrdering getMergedOrdering() const
LLVM_ABI void setSuccessOrdering(AtomicOrdering Ordering)
const Value * getCompareOperand() const
LLVM_ABI void setWeak(bool IsWeak)
LLVM_ABI void setVolatile(bool V)
Specify whether this is a volatile cmpxchg.
const Value * getPointerOperand() const
LLVM_ABI void setFailureOrdering(AtomicOrdering Ordering)
static bool classof(const Value *From)
AtomicOrdering getFailureOrdering() const
LLVM_ABI void setAlignment(Align Align)
LLVM_ABI Value * getCompareOperand()
static LLVM_ABI AtomicCmpXchgInst * create(Value *Ptr, Value *Cmp, Value *New, MaybeAlign Align, AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering, InsertPosition Pos, Context &Ctx, SyncScope::ID SSID=SyncScope::System, const Twine &Name="")
static bool isValidFailureOrdering(AtomicOrdering Ordering)
bool isVolatile() const
Return true if this is a cmpxchg from a volatile memory location.
static bool isValidSuccessOrdering(AtomicOrdering Ordering)
LLVM_ABI void setSyncScopeID(SyncScope::ID SSID)
AtomicOrdering getSuccessOrdering() const
SyncScope::ID getSyncScopeID() const
LLVM_ABI Value * getNewValOperand()
Align getAlign() const
Return the alignment of the memory that is being allocated by the instruction.
bool isWeak() const
Return true if this cmpxchg may spuriously fail.
LLVM_ABI Value * getValOperand()
static LLVM_ABI AtomicRMWInst * create(BinOp Op, Value *Ptr, Value *Val, MaybeAlign Align, AtomicOrdering Ordering, InsertPosition Pos, Context &Ctx, SyncScope::ID SSID=SyncScope::System, const Twine &Name="")
BinOp getOperation() const
const Value * getPointerOperand() const
LLVM_ABI void setSyncScopeID(SyncScope::ID SSID)
unsigned getPointerAddressSpace() const
llvm::AtomicRMWInst::BinOp BinOp
LLVM_ABI void setOrdering(AtomicOrdering Ordering)
SyncScope::ID getSyncScopeID() const
LLVM_ABI void setVolatile(bool V)
const Value * getValOperand() const
static StringRef getOperationName(BinOp Op)
AtomicOrdering getOrdering() const
void setOperation(BinOp Op)
LLVM_ABI Value * getPointerOperand()
static bool classof(const Value *From)
bool isFloatingPointOperation() const
static bool isFPOperation(BinOp Op)
LLVM_ABI void setAlignment(Align Align)
Iterator for Instructions in a `BasicBlock.
LLVM_ABI BasicBlock * getNodeParent() const
\Returns the parent BB.
Contains a list of sandboxir::Instruction's.
static LLVM_ABI Value * create(Instruction::Opcode Op, Value *LHS, Value *RHS, InsertPosition Pos, Context &Ctx, const Twine &Name="")
static Opcode getBinOpOpcode(llvm::Instruction::BinaryOps BinOp)
static bool classof(const Value *From)
For isa/dyn_cast.
BinaryOperator(llvm::BinaryOperator *BinOp, Context &Ctx)
static LLVM_ABI Value * createWithCopiedFlags(Instruction::Opcode Op, Value *LHS, Value *RHS, Value *CopyFrom, InsertPosition Pos, Context &Ctx, const Twine &Name="")
LLVM_ABI BasicBlock * getSuccessor(unsigned SuccIdx) const
LLVM_ABI Value * getCondition() const
LLVM_ABI void setSuccessor(unsigned Idx, BasicBlock *NewSucc)
unsigned getNumSuccessors() const
iterator_range< sb_succ_op_iterator > successors()
static LLVM_ABI BranchInst * create(BasicBlock *IfTrue, InsertPosition Pos, Context &Ctx)
static LLVM_ABI bool classof(const Value *From)
For isa/dyn_cast.
iterator_range< const_sb_succ_op_iterator > successors() const
void setCondition(Value *V)
bool isConditional() const
bool isUnconditional() const
iterator_range< const_op_iterator > args() const
CallingConv::ID getCallingConv() const
bool isMustTailCall() const
const Function * getCaller() const
LLVM_ABI Function * getCalledFunction() const
LLVM_ABI Use getCalledOperandUse() const
LLVM_ABI FunctionType * getFunctionType() const
const_op_iterator arg_end() const
iterator_range< op_iterator > args()
static bool classof(const Value *From)
Value * getArgOperand(unsigned OpIdx) const
LLVM_ABI void setCalledFunction(Function *F)
Use getArgOperandUse(unsigned Idx)
bool isDataOperand(Use U) const
unsigned getArgOperandNo(Use U) const
const_op_iterator data_operands_end() const
op_iterator data_operands_end()
LLVM_ABI Function * getCaller()
unsigned getDataOperandNo(Use U) const
unsigned getNumTotalBundleOperands() const
Return the total number operands (not operand bundles) used by every operand bundle in this OperandBu...
iterator_range< op_iterator > data_ops()
const_op_iterator data_operands_begin() const
bool data_operands_empty() const
bool hasArgument(const Value *V) const
LLVM_ABI Value * getCalledOperand() const
void setCalledOperand(Value *V)
unsigned arg_size() const
unsigned data_operands_size() const
const_op_iterator arg_begin() const
Intrinsic::ID getIntrinsicID() const
Use getArgOperandUse(unsigned Idx) const
op_iterator data_operands_begin()
bool isArgOperand(Use U) const
void setArgOperand(unsigned OpIdx, Value *NewOp)
iterator_range< const_op_iterator > data_ops() const
bool isCallee(Use U) const
bool isIndirectCall() const
LLVM_ABI Value * getIndirectDestLabelUse(unsigned Idx) const
static LLVM_ABI CallBrInst * create(FunctionType *FTy, Value *Func, BasicBlock *DefaultDest, ArrayRef< BasicBlock * > IndirectDests, ArrayRef< Value * > Args, InsertPosition Pos, Context &Ctx, const Twine &NameStr="")
LLVM_ABI Value * getIndirectDestLabel(unsigned Idx) const
LLVM_ABI BasicBlock * getSuccessor(unsigned Idx) const
static bool classof(const Value *From)
LLVM_ABI void setIndirectDest(unsigned Idx, BasicBlock *BB)
LLVM_ABI BasicBlock * getDefaultDest() const
unsigned getNumIndirectDests() const
LLVM_ABI BasicBlock * getIndirectDest(unsigned Idx) const
LLVM_ABI SmallVector< BasicBlock *, 16 > getIndirectDests() const
unsigned getNumSuccessors() const
LLVM_ABI void setDefaultDest(BasicBlock *BB)
static LLVM_ABI CallInst * create(FunctionType *FTy, Value *Func, ArrayRef< Value * > Args, InsertPosition Pos, Context &Ctx, const Twine &NameStr="")
static bool classof(const Value *From)
static bool classof(const Value *From)
static Value * create(Value *Src, Type *DestTy, InsertPosition Pos, Context &Ctx, const Twine &Name="")
LLVM_ABI Type * getSrcTy() const
static LLVM_ABI Value * create(Type *DestTy, Opcode Op, Value *Operand, InsertPosition Pos, Context &Ctx, const Twine &Name="")
LLVM_ABI Type * getDestTy() const
static LLVM_ABI bool classof(const Value *From)
For isa/dyn_cast.
static bool classof(const Value *From)
static LLVM_ABI CatchPadInst * create(Value *ParentPad, ArrayRef< Value * > Args, InsertPosition Pos, Context &Ctx, const Twine &Name="")
LLVM_ABI CatchSwitchInst * getCatchSwitch() const
LLVM_ABI CatchPadInst * getCatchPad() const
LLVM_ABI BasicBlock * getSuccessor() const
static bool classof(const Value *From)
LLVM_ABI void setSuccessor(BasicBlock *NewSucc)
LLVM_ABI void setCatchPad(CatchPadInst *CatchPad)
unsigned getNumSuccessors()
LLVM_ABI Value * getCatchSwitchParentPad() const
static LLVM_ABI CatchReturnInst * create(CatchPadInst *CatchPad, BasicBlock *BB, InsertPosition Pos, Context &Ctx)
LLVM_ABI void addHandler(BasicBlock *Dest)
const_handler_iterator handler_begin() const
const_handler_iterator handler_end() const
const BasicBlock *(*)(const Value *) ConstDerefFnTy
BasicBlock *(*)(Value *) DerefFnTy
unsigned getNumSuccessors() const
LLVM_ABI void setParentPad(Value *ParentPad)
bool hasUnwindDest() const
bool unwindsToCaller() const
LLVM_ABI void setUnwindDest(BasicBlock *UnwindDest)
handler_iterator handler_begin()
static LLVM_ABI CatchSwitchInst * create(Value *ParentPad, BasicBlock *UnwindBB, unsigned NumHandlers, InsertPosition Pos, Context &Ctx, const Twine &Name="")
mapped_iterator< const_op_iterator, ConstDerefFnTy > const_handler_iterator
mapped_iterator< op_iterator, DerefFnTy > handler_iterator
static bool classof(const Value *From)
handler_iterator handler_end()
unsigned getNumHandlers() const
void setSuccessor(unsigned Idx, BasicBlock *NewSucc)
LLVM_ABI BasicBlock * getUnwindDest() const
LLVM_ABI Value * getParentPad() const
BasicBlock * getSuccessor(unsigned Idx) const
const_handler_range handlers() const
static LLVM_ABI CleanupPadInst * create(Value *ParentPad, ArrayRef< Value * > Args, InsertPosition Pos, Context &Ctx, const Twine &Name="")
static bool classof(const Value *From)
LLVM_ABI CleanupPadInst * getCleanupPad() const
bool hasUnwindDest() const
LLVM_ABI void setUnwindDest(BasicBlock *NewDest)
bool unwindsToCaller() const
static LLVM_ABI CleanupReturnInst * create(CleanupPadInst *CleanupPad, BasicBlock *UnwindBB, InsertPosition Pos, Context &Ctx)
unsigned getNumSuccessors() const
LLVM_ABI BasicBlock * getUnwindDest() const
LLVM_ABI void setCleanupPad(CleanupPadInst *CleanupPad)
static bool classof(const Value *From)
WRAP_STATIC_PREDICATE(isUnordered)
WRAP_BOTH(isTrueWhenEqual)
WRAP_BOTH(getInversePredicate)
static LLVM_ABI Value * createCommon(Value *Cond, Value *True, Value *False, const Twine &Name, IRBuilder<> &Builder, Context &Ctx)
void dumpOS(raw_ostream &OS) const override
LLVM_DUMP_METHOD void dump() const
WRAP_BOTH(getNonStrictPredicate)
static LLVM_ABI Value * createWithCopiedFlags(Predicate Pred, Value *S1, Value *S2, const Instruction *FlagsSource, InsertPosition Pos, Context &Ctx, const Twine &Name="")
static LLVM_ABI Type * makeCmpResultType(Type *OpndType)
Create a result type for fcmp/icmp.
static LLVM_ABI Value * create(Predicate Pred, Value *S1, Value *S2, InsertPosition Pos, Context &Ctx, const Twine &Name="")
LLVM_ABI void setPredicate(Predicate P)
WRAP_BOTH(isIntPredicate)
WRAP_STATIC_PREDICATE(isOrdered)
WRAP_BOTH(isNonStrictPredicate)
WRAP_BOTH(getSwappedPredicate)
WRAP_BOTH(getStrictPredicate)
WRAP_BOTH(isStrictPredicate)
WRAP_STATIC_PREDICATE(getPredicateName)
CmpInst(llvm::CmpInst *CI, Context &Ctx, ClassID Id, Opcode Opc)
Use Context::createCmpInst(). Don't call the constructor directly.
WRAP_BOTH(isFalseWhenEqual)
WRAP_MEMBER(getPredicate)
LLVM_ABI void swapOperands()
WRAP_BOTH(getUnorderedPredicate)
WRAP_BOTH(getFlippedStrictnessPredicate)
WRAP_BOTH(getOrderedPredicate)
WRAP_MEMBER(isCommutative)
static bool classof(const Value *From)
Method for support type inquiry through isa, cast, and dyn_cast:
auto & getLLVMIRBuilder()
const Value * getVectorOperand() const
const Value * getIndexOperand() const
Value * getVectorOperand()
static LLVM_ABI Value * create(Value *Vec, Value *Idx, InsertPosition Pos, Context &Ctx, const Twine &Name="")
LLVM_ABI VectorType * getVectorOperandType() const
Value * getIndexOperand()
static bool classof(const Value *From)
static bool isValidOperands(const Value *Vec, const Value *Idx)
unsigned getNumIndices() const
static LLVM_ABI Value * create(Value *Agg, ArrayRef< unsigned > Idxs, InsertPosition Pos, Context &Ctx, const Twine &Name="")
const Value * getAggregateOperand() const
static unsigned getAggregateOperandIndex()
idx_iterator idx_begin() const
ArrayRef< unsigned > getIndices() const
static LLVM_ABI Type * getIndexedType(Type *Agg, ArrayRef< unsigned > Idxs)
Returns the type of the element that would be extracted with an extractvalue instruction with the spe...
Value * getAggregateOperand()
unsigned hasIndices() const
static bool classof(const Value *From)
iterator_range< idx_iterator > indices() const
idx_iterator idx_end() const
WRAP_MEMBER(isRelational)
WRAP_MEMBER(isCommutative)
LLVM_ABI void swapOperands()
static bool compare(const APFloat &LHS, const APFloat &RHS, FCmpInst::Predicate Pred)
static bool classof(const Value *From)
AtomicOrdering getOrdering() const
Returns the ordering constraint of this fence instruction.
static LLVM_ABI FenceInst * create(AtomicOrdering Ordering, InsertPosition Pos, Context &Ctx, SyncScope::ID SSID=SyncScope::System)
LLVM_ABI void setOrdering(AtomicOrdering Ordering)
Sets the ordering constraint of this fence instruction.
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID of this fence instruction.
static bool classof(const Value *From)
LLVM_ABI void setSyncScopeID(SyncScope::ID SSID)
Sets the synchronization scope ID of this fence instruction.
static LLVM_ABI FreezeInst * create(Value *V, InsertPosition Pos, Context &Ctx, const Twine &Name="")
static bool classof(const Value *From)
static bool classof(const Value *From)
LLVM_ABI Value * getArgOperand(unsigned Idx) const
Return the Idx-th funcletpad argument.
LLVM_ABI Value * getParentPad() const
Return the outer EH-pad this funclet is nested within.
unsigned arg_size() const
Return the number of funcletpad arguments.
LLVM_ABI void setParentPad(Value *ParentPad)
LLVM_ABI void setArgOperand(unsigned Idx, Value *V)
Set the Idx-th funcletpad argument.
friend class CatchPadInst
friend class CleanupPadInst
unsigned getAddressSpace() const
bool hasAllConstantIndices() const
bool hasNoUnsignedWrap() const
iterator_range< op_iterator > indices()
const_op_iterator idx_begin() const
unsigned getPointerAddressSpace() const
GEPNoWrapFlags getNoWrapFlags() const
LLVM_ABI Type * getResultElementType() const
unsigned getNumIndices() const
LLVM_ABI Type * getPointerOperandType() const
static unsigned getPointerOperandIndex()
LLVM_ABI Type * getSourceElementType() const
bool hasNoUnsignedSignedWrap() const
static bool classof(const Value *From)
const_op_iterator idx_end() const
LLVM_ABI Value * getPointerOperand() const
bool accumulateConstantOffset(const DataLayout &DL, APInt &Offset) const
iterator_range< const_op_iterator > indices() const
static LLVM_ABI Value * create(Type *Ty, Value *Ptr, ArrayRef< Value * > IdxList, InsertPosition Pos, Context &Ctx, const Twine &NameStr="")
static std::optional< bool > isImpliedByMatchingCmp(CmpPredicate Pred1, CmpPredicate Pred2)
WRAP_BOTH(getSignedPredicate)
WRAP_STATIC_PREDICATE(isLE)
WRAP_STATIC_PREDICATE(isGE)
static bool compare(const APInt &LHS, const APInt &RHS, ICmpInst::Predicate Pred)
WRAP_STATIC_PREDICATE(isGT)
LLVM_ABI void swapOperands()
WRAP_STATIC_PREDICATE(isLT)
WRAP_BOTH(getUnsignedPredicate)
WRAP_MEMBER(isCommutative)
WRAP_MEMBER(isRelational)
WRAP_BOTH(getFlippedSignednessPredicate)
static bool classof(const Value *From)
static LLVM_ABI Value * create(Value *Vec, Value *NewElt, Value *Idx, InsertPosition Pos, Context &Ctx, const Twine &Name="")
static bool isValidOperands(const Value *Vec, const Value *NewElt, const Value *Idx)
static bool classof(const Value *From)
InsertPosition(BBIterator InsertAt)
InsertPosition(BasicBlock *InsertAtEnd)
const BBIterator & getIterator() const
Instruction & operator*()
BasicBlock * getBasicBlock() const
Value * getAggregateOperand()
Value * getInsertedValueOperand()
idx_iterator idx_end() const
iterator_range< idx_iterator > indices() const
static bool classof(const Value *From)
const Value * getInsertedValueOperand() const
unsigned hasIndices() const
const Value * getAggregateOperand() const
static unsigned getInsertedValueOperandIndex()
unsigned getNumIndices() const
ArrayRef< unsigned > getIndices() const
static LLVM_ABI Value * create(Value *Agg, Value *Val, ArrayRef< unsigned > Idxs, InsertPosition Pos, Context &Ctx, const Twine &Name="")
idx_iterator idx_begin() const
static unsigned getAggregateOperandIndex()
A sandboxir::User with operands, opcode and linked with previous/next instructions in an instruction ...
bool hasAtomicLoad() const
bool hasNoUnsignedWrap() const
Determine whether the no signed wrap flag is set.
static IRBuilder & setInsertPos(InsertPosition Pos)
Helper function for create().
bool isAssociative() const
LLVM_ABI void setFastMathFlags(FastMathFlags FMF)
Convenience function for setting multiple fast-math flags on this instruction, which must be an opera...
friend class UnreachableInst
bool isSpecialTerminator() const
const DataLayout & getDataLayout() const
bool hasAllowReassoc() const
Determine whether the allow-reassociation flag is set.
LLVM_ABI void setHasAllowReassoc(bool B)
Set or clear the reassociation flag on this instruction, which must be an operator which supports thi...
bool mayWriteToMemory() const
virtual unsigned getNumOfIRInstrs() const =0
This is used by BasicBlock::iterator.
bool hasNoSignedZeros() const
Determine whether the no-signed-zeros flag is set.
const char * getOpcodeName() const
bool isLogicalShift() const
LLVM_ABI void setHasNoSignedWrap(bool B=true)
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag.
LLVM_ABI void insertAfter(Instruction *AfterI)
Insert this detached instruction after AfterI.
bool hasMetadata(unsigned KindID) const
Return true if this instruction has the given type of metadata attached.
bool hasMetadataOtherThanDebugLoc() const
Return true if this instruction has metadata attached to it other than a debug location.
void moveAfter(Instruction *After)
Move this instruction after After.
LLVM_ABI void moveBefore(BasicBlock &BB, const BBIterator &WhereIt)
Move this instruction to WhereIt.
bool hasAllowContract() const
Determine whether the allow-contract flag is set.
LLVM_ABI void setIsExact(bool B=true)
Set or clear the exact flag on this instruction, which must be an operator which supports this flag.
bool hasApproxFunc() const
Determine whether the approximate-math-functions flag is set.
bool hasNoSignedWrap() const
Determine whether the no signed wrap flag is set.
LLVM_ABI void setHasNoUnsignedWrap(bool B=true)
Set or clear the nuw flag on this instruction, which must be an operator which supports this flag.
Opcode getOpcode() const
\Returns this Instruction's opcode.
void dumpOS(raw_ostream &OS) const override
bool isFast() const
Determine whether all fast-math-flags are set.
LLVM_ABI BBIterator getIterator() const
\Returns a BasicBlock::iterator for this Instruction.
LLVM_ABI void setFast(bool B)
Set or clear all fast-math-flags on this instruction, which must be an operator which supports this f...
LLVM_ABI void setHasApproxFunc(bool B)
Set or clear the approximate-math-functions flag on this instruction, which must be an operator which...
LLVM_ABI void setHasNoNaNs(bool B)
Set or clear the no-nans flag on this instruction, which must be an operator which supports this flag...
LLVM_ABI void copyFastMathFlags(FastMathFlags FMF)
Convenience function for transferring all fast-math flag values to this instruction,...
bool isFuncletPad() const
bool hasAtomicStore() const
LLVM_ABI void setHasNoSignedZeros(bool B)
Set or clear the no-signed-zeros flag on this instruction, which must be an operator which supports t...
LLVM_ABI void insertInto(BasicBlock *BB, const BBIterator &WhereIt)
Insert this detached instruction into BB at WhereIt.
bool mayThrow(bool IncludePhaseOneUnwind=false) const
LLVM_ABI llvm::Instruction * getTopmostLLVMInstruction() const
A SandboxIR Instruction may map to multiple LLVM IR Instruction.
bool isIdempotent() const
bool hasMetadata() const
Return true if the instruction has any metadata attached to it.
LLVM_ABI void setHasAllowContract(bool B)
Set or clear the allow-contract flag on this instruction, which must be an operator which supports th...
bool isOnlyUserOfAnyOperand() const
virtual SmallVector< llvm::Instruction *, 1 > getLLVMInstrs() const =0
\Returns the LLVM IR Instructions that this SandboxIR maps to in program order.
void moveBefore(Instruction *Before)
Move this instruction before Before.
bool mayHaveSideEffects() const
LLVM_ABI Type * getAccessType() const
bool mayReadOrWriteMemory() const
bool isExact() const
Determine whether the exact flag is set.
bool mayReadFromMemory() const
Instruction(ClassID ID, Opcode Opc, llvm::Instruction *I, sandboxir::Context &SBCtx)
FastMathFlags getFastMathFlags() const
Convenience function for getting all the fast-math flags, which must be an operator which supports th...
bool isCommutative() const
bool comesBefore(const Instruction *Other) const
Given an instruction Other in the same basic block as this instruction, return true if this instructi...
LLVM_ABI Instruction * getNextNode() const
\Returns the next sandboxir::Instruction in the block, or nullptr if at the end of the block.
bool hasNoInfs() const
Determine whether the no-infs flag is set.
LLVM_ABI void removeFromParent()
Detach this from its parent BasicBlock without deleting it.
LLVM_ABI Instruction * getPrevNode() const
\Returns the previous sandboxir::Instruction in the block, or nullptr if at the beginning of the bloc...
bool hasNoNaNs() const
Determine whether the no-NaNs flag is set.
bool hasAllowReciprocal() const
Determine whether the allow-reciprocal flag is set.
LLVM_ABI void insertBefore(Instruction *BeforeI)
Insert this detached instruction before BeforeI.
LLVM_ABI void eraseFromParent()
Detach this Value from its parent and delete it.
LLVM_ABI void setHasAllowReciprocal(bool B)
Set or clear the allow-reciprocal flag on this instruction, which must be an operator which supports ...
LLVM_ABI void setHasNoInfs(bool B)
Set or clear the no-infs flag on this instruction, which must be an operator which supports this flag...
LLVM_ABI BasicBlock * getParent() const
\Returns the BasicBlock containing this Instruction, or null if it is detached.
static LLVM_ABI bool classof(const sandboxir::Value *From)
For isa/dyn_cast.
bool isTerminator() const
LLVM_ABI BasicBlock * getUnwindDest() const
static LLVM_ABI InvokeInst * create(FunctionType *FTy, Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, InsertPosition Pos, Context &Ctx, const Twine &NameStr="")
LLVM_ABI void setNormalDest(BasicBlock *BB)
unsigned getNumSuccessors() const
LLVM_ABI void setUnwindDest(BasicBlock *BB)
LLVM_ABI BasicBlock * getSuccessor(unsigned SuccIdx) const
static bool classof(const Value *From)
LLVM_ABI BasicBlock * getNormalDest() const
void setSuccessor(unsigned SuccIdx, BasicBlock *NewSucc)
LLVM_ABI LandingPadInst * getLandingPadInst() const
bool isFilter(unsigned Idx) const
Return 'true' if the clause and index Idx is a filter clause.
bool isCleanup() const
Return 'true' if this landingpad instruction is a cleanup.
LLVM_ABI void setCleanup(bool V)
Indicate that this landingpad instruction is a cleanup.
unsigned getNumClauses() const
Get the number of clauses for this landing pad.
bool isCatch(unsigned Idx) const
Return 'true' if the clause and index Idx is a catch clause.
LLVM_ABI Constant * getClause(unsigned Idx) const
Get the value of the clause at index Idx.
static bool classof(const Value *From)
static LLVM_ABI LandingPadInst * create(Type *RetTy, unsigned NumReservedClauses, InsertPosition Pos, Context &Ctx, const Twine &Name="")
static LLVM_ABI LoadInst * create(Type *Ty, Value *Ptr, MaybeAlign Align, InsertPosition Pos, bool IsVolatile, Context &Ctx, const Twine &Name="")
static LoadInst * create(Type *Ty, Value *Ptr, MaybeAlign Align, InsertPosition Pos, Context &Ctx, const Twine &Name="")
LLVM_ABI void setVolatile(bool V)
Specify whether this is a volatile load or not.
LLVM_ABI Value * getPointerOperand() const
bool isVolatile() const
Return true if this is a load from a volatile memory location.
static LLVM_ABI bool classof(const Value *From)
For isa/dyn_cast.
An LLLVM Instruction that has no SandboxIR equivalent class gets mapped to an OpaqueInstr.
static bool classof(const sandboxir::Value *From)
Iterator for the Use edges of a User's operands.
LLVM_ABI Value * hasConstantValue() const
iterator_range< const_block_iterator > blocks() const
LLVM_ABI int getBasicBlockIndex(const BasicBlock *BB) const
const_block_iterator block_end() const
const_op_range incoming_values() const
bool hasConstantOrUndefValue() const
unsigned getNumIncomingValues() const
LLVM_ABI Value * getIncomingValue(unsigned Idx) const
LLVM_ABI void setIncomingBlock(unsigned Idx, BasicBlock *BB)
LLVM_ABI void removeIncomingValueIf(function_ref< bool(unsigned)> Predicate)
static LLVM_ABI bool classof(const Value *From)
For isa/dyn_cast.
const_block_iterator block_begin() const
static LLVM_ABI PHINode * create(Type *Ty, unsigned NumReservedValues, InsertPosition Pos, Context &Ctx, const Twine &Name="")
LLVM_ABI Value * removeIncomingValue(unsigned Idx)
mapped_iterator< llvm::PHINode::const_block_iterator, LLVMBBToBB > const_block_iterator
LLVM_ABI void setIncomingValue(unsigned Idx, Value *V)
LLVM_ABI BasicBlock * getIncomingBlock(unsigned Idx) const
op_range incoming_values()
static unsigned getIncomingValueNumForOperand(unsigned Idx)
LLVM_ABI void replaceIncomingBlockWith(const BasicBlock *Old, BasicBlock *New)
LLVM_ABI Value * getIncomingValueForBlock(const BasicBlock *BB) const
LLVM_ABI void addIncoming(Value *V, BasicBlock *BB)
static unsigned getOperandNumForIncomingValue(unsigned Idx)
An or instruction, which can be marked as "disjoint", indicating that the inputs don't have a 1 in th...
static bool classof(const Value *From)
For isa/dyn_cast.
LLVM_ABI void setIsDisjoint(bool B)
Instruction that can have a nneg flag (zext/uitofp).
LLVM_ABI void setNonNeg(bool B)
static bool classof(const Value *From)
For isa/dyn_cast.
static LLVM_ABI ResumeInst * create(Value *Exn, InsertPosition Pos, Context &Ctx)
unsigned getNumSuccessors() const
static bool classof(const Value *From)
LLVM_ABI Value * getValue() const
static LLVM_ABI ReturnInst * create(Value *RetVal, InsertPosition Pos, Context &Ctx)
static bool classof(const Value *From)
LLVM_ABI Value * getReturnValue() const
\Returns null if there is no return value.
static const char * areInvalidOperands(Value *Cond, Value *True, Value *False)
Return a string if the specified operands are invalid for a select operation, otherwise return null.
static LLVM_ABI bool classof(const Value *From)
For isa/dyn_cast.
const Value * getFalseValue() const
const Value * getTrueValue() const
LLVM_ABI void swapValues()
void setTrueValue(Value *New)
static LLVM_ABI Value * create(Value *Cond, Value *True, Value *False, InsertPosition Pos, Context &Ctx, const Twine &Name="")
void setCondition(Value *New)
const Value * getCondition() const
void setFalseValue(Value *New)
void getShuffleMask(SmallVectorImpl< int > &Result) const
Return the mask for this instruction as a vector of integers.
static bool isZeroEltSplatMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask chooses all elements with the same value as the first element of exa...
bool isExtractSubvectorMask(int &Index) const
Return true if this shuffle mask is an extract subvector mask.
bool changesLength() const
Return true if this shuffle returns a vector with a different number of elements than its source vect...
bool isReverse() const
Return true if this shuffle swaps the order of elements from exactly one source vector.
LLVM_ABI VectorType * getType() const
Overload to return most specific vector type.
bool isIdentityWithPadding() const
Return true if this shuffle lengthens exactly one source vector with undefs in the high elements.
static bool isSingleSourceMask(const Constant *Mask, int NumSrcElts)
bool isIdentityWithExtract() const
Return true if this shuffle extracts the first N elements of exactly one source vector.
static bool isIdentityMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask chooses elements from exactly one source vector without lane crossin...
ArrayRef< int > getShuffleMask() const
static bool isReverseMask(const Constant *Mask, int NumSrcElts)
LLVM_ABI Constant * getShuffleMaskForBitcode() const
Return the mask for this instruction, for use in bitcode.
static bool isExtractSubvectorMask(const Constant *Mask, int NumSrcElts, int &Index)
bool isInterleave(unsigned Factor) const
Return if this shuffle interleaves its two input vectors together.
static bool isInterleaveMask(ArrayRef< int > Mask, unsigned Factor, unsigned NumInputElts, SmallVectorImpl< unsigned > &StartIndexes)
Return true if the mask interleaves one or more input vectors together.
static bool isOneUseSingleSourceMask(ArrayRef< int > Mask, int VF)
Return true if this shuffle mask represents "clustered" mask of size VF, i.e.
static bool isTransposeMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask is a transpose mask.
static bool isTransposeMask(const Constant *Mask, int NumSrcElts)
static bool isInterleaveMask(ArrayRef< int > Mask, unsigned Factor, unsigned NumInputElts)
LLVM_ABI void commute()
Swap the operands and adjust the mask to preserve the semantics of the instruction.
static bool isReplicationMask(ArrayRef< int > Mask, int &ReplicationFactor, int &VF)
Return true if this shuffle mask replicates each of the VF elements in a vector ReplicationFactor tim...
static LLVM_ABI Value * create(Value *V1, Value *V2, Value *Mask, InsertPosition Pos, Context &Ctx, const Twine &Name="")
bool isIdentity() const
Return true if this shuffle chooses elements from exactly one source vector without lane crossings an...
static bool isReplicationMask(const Constant *Mask, int &ReplicationFactor, int &VF)
static bool isIdentityMask(const Constant *Mask, int NumSrcElts)
static bool isDeInterleaveMaskOfFactor(ArrayRef< int > Mask, unsigned Factor)
static LLVM_ABI Constant * convertShuffleMaskForBitcode(ArrayRef< int > Mask, Type *ResultTy)
bool isSingleSource() const
Return true if this shuffle chooses elements from exactly one source vector without changing the leng...
static bool isExtractSubvectorMask(ArrayRef< int > Mask, int NumSrcElts, int &Index)
Return true if this shuffle mask is an extract subvector mask.
bool isSplice(int &Index) const
Return true if this shuffle splices two inputs without changing the length of the vectors.
static bool isValidOperands(const Value *V1, const Value *V2, const Value *Mask)
Return true if a shufflevector instruction can be formed with the specified operands.
static bool isSelectMask(const Constant *Mask, int NumSrcElts)
static bool isSpliceMask(const Constant *Mask, int NumSrcElts, int &Index)
static bool isBitRotateMask(ArrayRef< int > Mask, unsigned EltSizeInBits, unsigned MinSubElts, unsigned MaxSubElts, unsigned &NumSubElts, unsigned &RotateAmt)
Checks if the shuffle is a bit rotation of the first operand across multiple subelements,...
bool isReplicationMask(int &ReplicationFactor, int &VF) const
Return true if this shuffle mask is a replication mask.
bool isConcat() const
Return true if this shuffle concatenates its 2 source vectors.
static bool isValidOperands(const Value *V1, const Value *V2, ArrayRef< int > Mask)
static bool isInsertSubvectorMask(const Constant *Mask, int NumSrcElts, int &NumSubElts, int &Index)
static bool isSpliceMask(ArrayRef< int > Mask, int NumSrcElts, int &Index)
Return true if this shuffle mask is a splice mask, concatenating the two inputs together and then ext...
static bool isSelectMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask chooses elements from its source vectors without lane crossings.
static void commuteShuffleMask(MutableArrayRef< int > Mask, unsigned InVecNumElts)
Change values in a shuffle permute mask assuming the two vector operands of length InVecNumElts have ...
bool increasesLength() const
Return true if this shuffle returns a vector with a greater number of elements than its source vector...
bool isZeroEltSplat() const
Return true if all elements of this shuffle are the same value as the first element of exactly one so...
static bool isInsertSubvectorMask(ArrayRef< int > Mask, int NumSrcElts, int &NumSubElts, int &Index)
Return true if this shuffle mask is an insert subvector mask.
static void getShuffleMask(const Constant *Mask, SmallVectorImpl< int > &Result)
Convert the input shuffle mask operand to a vector of integers.
static bool isZeroEltSplatMask(const Constant *Mask, int NumSrcElts)
LLVM_ABI void setShuffleMask(ArrayRef< int > Mask)
static bool isReverseMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask swaps the order of elements from exactly one source vector.
static bool isSingleSourceMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask chooses elements from exactly one source vector.
bool isOneUseSingleSourceMask(int VF) const
Return true if this shuffle mask is a one-use-single-source("clustered") mask.
static bool isDeInterleaveMaskOfFactor(ArrayRef< int > Mask, unsigned Factor, unsigned &Index)
Check if the mask is a DE-interleave mask of the given factor Factor like: <Index,...
int getMaskValue(unsigned Elt) const
Return the shuffle mask value of this instruction for the given element index.
bool isInsertSubvectorMask(int &NumSubElts, int &Index) const
Return true if this shuffle mask is an insert subvector mask.
bool isSelect() const
Return true if this shuffle chooses elements from its source vectors without lane crossings and all o...
bool isTranspose() const
Return true if this shuffle transposes the elements of its inputs without changing the length of the ...
static bool classof(const Value *From)
Instructions that contain a single LLVM Instruction can inherit from this.
void dumpOS(raw_ostream &OS) const override
void verify() const final
Should crash if there is something wrong with the instruction.
friend class FuncletPadInst
unsigned getUseOperandNo(const Use &Use) const final
\Returns the operand index of Use.
unsigned getNumOfIRInstrs() const final
This is used by BasicBlock::iterator.
LLVM_ABI void setVolatile(bool V)
Specify whether this is a volatile store or not.
static LLVM_ABI bool classof(const Value *From)
For isa/dyn_cast.
static StoreInst * create(Value *V, Value *Ptr, MaybeAlign Align, InsertPosition Pos, Context &Ctx)
static LLVM_ABI StoreInst * create(Value *V, Value *Ptr, MaybeAlign Align, InsertPosition Pos, bool IsVolatile, Context &Ctx)
LLVM_ABI Value * getPointerOperand() const
bool isVolatile() const
Return true if this is a store from a volatile memory location.
LLVM_ABI Value * getValueOperand() const
CaseIt findCaseValue(const ConstantInt *C)
iterator_range< ConstCaseIt > cases() const
static LLVM_ABI SwitchInst * create(Value *V, BasicBlock *Dest, unsigned NumCases, InsertPosition Pos, Context &Ctx, const Twine &Name="")
LLVM_ABI void addCase(ConstantInt *OnVal, BasicBlock *Dest)
LLVM_ABI BasicBlock * getSuccessor(unsigned Idx) const
CaseIt case_begin()
Returns a read/write iterator that points to the first case in the SwitchInst.
LLVM_ABI void setDefaultDest(BasicBlock *DefaultCase)
iterator_range< CaseIt > cases()
Iteration adapter for range-for loops.
llvm::SwitchInst::CaseIteratorImpl< CaseHandle > CaseIt
ConstCaseIt case_begin() const
bool defaultDestUnreachable() const
LLVM_ABI BasicBlock * getDefaultDest() const
ConstCaseIt case_end() const
llvm::SwitchInst::CaseIteratorImpl< ConstCaseHandle > ConstCaseIt
ConstCaseIt case_default() const
static bool classof(const Value *From)
LLVM_ABI Value * getCondition() const
LLVM_ABI void setSuccessor(unsigned Idx, BasicBlock *NewSucc)
unsigned getNumCases() const
unsigned getNumSuccessors() const
CaseIt case_end()
Returns a read/write iterator that points one past the last in the SwitchInst.
LLVM_ABI void setCondition(Value *V)
ConstCaseIt findCaseValue(const ConstantInt *C) const
LLVM_ABI ConstantInt * findCaseDest(BasicBlock *BB)
static constexpr const unsigned DefaultPseudoIndex
LLVM_ABI CaseIt removeCase(CaseIt It)
This method removes the specified case and its successor from the switch instruction.
Just like llvm::Type these are immutable, unique, never get freed and can only be created via static ...
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
An abstract class, parent of unary instructions.
static bool classof(const Instruction *I)
UnaryInstruction(ClassID ID, Opcode Opc, llvm::Instruction *LLVMI, Context &Ctx)
static bool classof(const Value *V)
static bool classof(const Value *From)
For isa/dyn_cast.
static LLVM_ABI Value * createWithCopiedFlags(Instruction::Opcode Op, Value *OpV, Value *CopyFrom, InsertPosition Pos, Context &Ctx, const Twine &Name="")
static LLVM_ABI Value * create(Instruction::Opcode Op, Value *OpV, InsertPosition Pos, Context &Ctx, const Twine &Name="")
static LLVM_ABI UnreachableInst * create(InsertPosition Pos, Context &Ctx)
unsigned getNumOfIRInstrs() const final
This is used by BasicBlock::iterator.
unsigned getUseOperandNo(const Use &Use) const final
\Returns the operand index of Use.
unsigned getNumSuccessors() const
static LLVM_ABI bool classof(const Value *From)
Represents a Def-use/Use-def edge in SandboxIR.
LLVM_ABI void set(Value *V)
A sandboxir::User has operands.
virtual op_iterator op_begin()
unsigned getUseOperandNoDefault(const Use &Use) const
The default implementation works only for single-LLVMIR-instruction Users and only if they match exac...
virtual void setOperand(unsigned OperandIdx, Value *Operand)
Use getOperandUseDefault(unsigned OpIdx, bool Verify) const
\Returns the Use edge that corresponds to OpIdx.
void swapOperandsInternal(unsigned OpIdxA, unsigned OpIdxB)
virtual unsigned getNumOperands() const
Use getOperandUse(unsigned OpIdx) const
\Returns the operand edge for OpIdx.
virtual op_iterator op_end()
LLVM_ABI Value * getPointerOperand()
static LLVM_ABI VAArgInst * create(Value *List, Type *Ty, InsertPosition Pos, Context &Ctx, const Twine &Name="")
const Value * getPointerOperand() const
static bool classof(const Value *From)
static unsigned getPointerOperandIndex()
A SandboxIR Value has users. This is the base class.
llvm::Value * Val
The LLVM Value that corresponds to this SandboxIR Value.
void dumpCommonSuffix(raw_ostream &OS) const
Context & Ctx
All values point to the context.
ClassID SubclassID
For isa/dyn_cast.
LLVM_ABI Type * getType() const
void dumpCommonPrefix(raw_ostream &OS) const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
@ BasicBlock
Various leaf nodes.
@ System
Synchronized with respect to all concurrently executing threads.
static bool isOrdered(Instruction *I)
static SmallVector< Value *, 4 > getOperand(ArrayRef< Value * > Bndl, unsigned OpIdx)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
mapped_iterator< ItTy, FuncTy > map_iterator(ItTy I, FuncTy F)
AtomicOrdering
Atomic ordering for LLVM's memory model.
DWARFExpression::Operation Op
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
This struct is a compact representation of a valid (non-zero power of two) alignment.
The const version of succ_op_iterator.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.