38 const unsigned *Indices,
39 const unsigned *IndicesEnd,
42 if (Indices && Indices == IndicesEnd)
46 if (
StructType *STy = dyn_cast<StructType>(Ty)) {
49 EE = STy->element_end();
51 if (Indices && *Indices ==
unsigned(EI - EB))
55 assert(!Indices &&
"Unexpected out of bound");
59 else if (
ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
60 Type *EltTy = ATy->getElementType();
61 unsigned NumElts = ATy->getNumElements();
65 assert(*Indices < NumElts &&
"Unexpected out of bound");
68 CurIndex += EltLinearOffset* *Indices;
71 CurIndex += EltLinearOffset*NumElts;
88 uint64_t StartingOffset) {
90 if (
StructType *STy = dyn_cast<StructType>(Ty)) {
94 EE = STy->element_end();
101 if (
ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
102 Type *EltTy = ATy->getElementType();
104 for (
unsigned i = 0, e = ATy->getNumElements(); i != e; ++i)
106 StartingOffset + i * EltSize);
124 if (Var && Var->getName() ==
"llvm.eh.catch.all.value") {
125 assert(Var->hasInitializer() &&
126 "The EH catch-all value must have an initializer");
129 if (!GV) V = cast<ConstantPointerNull>(Init);
132 assert((GV || isa<ConstantPointerNull>(V)) &&
133 "TypeInfo must be a global variable or NULL");
142 for (
unsigned i = 0, e = CInfos.size(); i != e; ++i) {
144 for (
unsigned j = 0, ee = CI.
Codes.size(); j != ee; ++j) {
219 (isa<VectorType>(T1) && isa<VectorType>(T2) &&
244 const Value *NoopInput =
nullptr;
247 if (isa<BitCastInst>(I)) {
251 }
else if (isa<GetElementPtrInst>(I)) {
253 if (cast<GetElementPtrInst>(I)->hasAllZeroIndices())
255 }
else if (isa<IntToPtrInst>(I)) {
259 if (!isa<VectorType>(I->
getType()) &&
263 }
else if (isa<PtrToIntInst>(I)) {
267 if (!isa<VectorType>(I->
getType()) &&
271 }
else if (isa<TruncInst>(I) &&
276 const Value *ReturnedOp = CS.getReturnedArgOperand();
278 NoopInput = ReturnedOp;
279 }
else if (
const InsertValueInst *IVI = dyn_cast<InsertValueInst>(V)) {
282 if (ValLoc.
size() >= InsertLoc.
size() &&
288 NoopInput = IVI->getInsertedValueOperand();
317 bool AllowDifferingSizes,
325 unsigned BitsRequired = UINT_MAX;
326 RetVal =
getNoopInput(RetVal, RetIndices, BitsRequired, TLI, DL);
330 if (isa<UndefValue>(RetVal))
337 unsigned BitsProvided = UINT_MAX;
338 CallVal =
getNoopInput(CallVal, CallIndices, BitsProvided, TLI, DL);
342 if (CallVal != RetVal || CallIndices != RetIndices)
349 if (BitsProvided < BitsRequired ||
350 (!AllowDifferingSizes && BitsProvided != BitsRequired))
359 if (
ArrayType *AT = dyn_cast<ArrayType>(T))
360 return Idx < AT->getNumElements();
362 return Idx < cast<StructType>(
T)->getNumElements();
431 SubTypes.
push_back(cast<CompositeType>(Next));
433 Next = cast<CompositeType>(Next)->getTypeAtIndex(0U);
459 assert(!Path.
empty() &&
"found a leaf but didn't set the path?");
498 if (isa<DbgInfoIntrinsic>(BBI))
500 if (BBI->mayHaveSideEffects() || BBI->mayReadFromMemory() ||
513 bool *AllowDifferingSizes) {
516 bool &ADS = AllowDifferingSizes ? *AllowDifferingSizes : DummyADS;
528 if (CallerAttrs.contains(Attribute::ZExt)) {
529 if (!CalleeAttrs.contains(Attribute::ZExt))
533 CallerAttrs.removeAttribute(Attribute::ZExt);
534 CalleeAttrs.removeAttribute(Attribute::ZExt);
535 }
else if (CallerAttrs.contains(Attribute::SExt)) {
536 if (!CalleeAttrs.contains(Attribute::SExt))
540 CallerAttrs.removeAttribute(Attribute::SExt);
541 CalleeAttrs.removeAttribute(Attribute::SExt);
547 return CallerAttrs == CalleeAttrs;
560 if (isa<UndefValue>(Ret->
getOperand(0)))
return true;
563 bool AllowDifferingSizes;
605 AllowDifferingSizes, TLI,
619 while (!Worklist.
empty()) {
622 if (Visiting->
isEHPad() && Visiting != MBB)
626 auto P = FuncletMembership.
insert(std::make_pair(Visiting, Funclet));
630 assert(
P.first->second == Funclet &&
"MBB is part of two funclets!");
650 return FuncletMembership;
662 if (MBB.isEHFuncletEntry()) {
664 }
else if (IsSEH && MBB.isEHPad()) {
666 }
else if (MBB.pred_empty()) {
686 if (FuncletBlocks.
empty())
687 return FuncletMembership;
701 for (std::pair<const MachineBasicBlock *, int> CatchRetPair :
705 return FuncletMembership;
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
Return a value (possibly void), from a function.
void push_back(const T &Elt)
bool isEHPad() const
Returns true if the block is a landing pad.
A parsed version of the target data layout string in and methods for querying it. ...
ISD::CondCode getICmpCondCode(ICmpInst::Predicate Pred)
getICmpCondCode - Return the ISD condition code corresponding to the given LLVM IR integer condition ...
static void collectFuncletMembers(DenseMap< const MachineBasicBlock *, int > &FuncletMembership, int Funclet, const MachineBasicBlock *MBB)
virtual ConstraintType getConstraintType(StringRef Constraint) const
Given a constraint, return the type of constraint it is for this target.
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs, and aliases.
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
unsigned getNumOperands() const
static const Value * getNoopInput(const Value *V, SmallVectorImpl< unsigned > &ValLoc, unsigned &DataBits, const TargetLoweringBase &TLI, const DataLayout &DL)
Look through operations that will be free to find the earliest source of this value.
bool mayHaveSideEffects() const
Return true if the instruction may have side effects.
0 1 0 0 True if ordered and less than
1 1 1 0 True if unordered or not equal
const Function * getParent() const
Return the enclosing method, or null if none.
The two locations do not alias at all.
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
unsigned getCatchReturnOpcode() const
GlobalValue * ExtractTypeInfo(Value *V)
ExtractTypeInfo - Returns the type info, possibly bitcast, encoded in V.
bool returnTypeIsEligibleForTailCall(const Function *F, const Instruction *I, const ReturnInst *Ret, const TargetLoweringBase &TLI)
Test if given that the input instruction is in the tail call position if the return type or any attri...
ConstraintCodeVector Codes
Code - The constraint code, either the register name (in braces) or the constraint letter/number...
iterator_range< succ_iterator > successors()
AttributeList getAttributes() const
Return the attribute list for this Function.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
1 0 0 1 True if unordered or equal
Used to lazily calculate structure layout information for a target machine, based on the DataLayout s...
1 0 0 0 True if unordered: isnan(X) | isnan(Y)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const HexagonInstrInfo * TII
const StructLayout * getStructLayout(StructType *Ty) const
Returns a StructLayout object, indicating the alignment of the struct, its size, and the offsets of i...
Class to represent struct types.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Constant * getPersonalityFn() const
Get the personality function associated with this function.
0 1 0 1 True if ordered and less than or equal
virtual bool allowTruncateForTailCall(Type *FromTy, Type *ToTy) const
Return true if a truncation from FromTy to ToTy is permitted when deciding whether a call is in tail ...
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
LLVM_NODISCARD bool empty() const
AttributeList getAttributes(LLVMContext &C, ID id)
Return the attributes for an intrinsic.
const MachineBasicBlock & front() const
bool mayReadFromMemory() const
Return true if this instruction may read memory.
reverse_iterator rbegin() const
Class to represent array types.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
EVT getValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
Return the EVT corresponding to this LLVM type.
static bool nextRealType(SmallVectorImpl< CompositeType * > &SubTypes, SmallVectorImpl< unsigned > &Path)
Set the iterator data-structures to the next non-empty, non-aggregate subtype.
ISD::CondCode getFCmpCondCode(FCmpInst::Predicate Pred)
getFCmpCondCode - Return the ISD condition code corresponding to the given LLVM IR floating-point con...
Type::subtype_iterator element_iterator
size_t size() const
size - Get the array size.
void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty, SmallVectorImpl< EVT > &ValueVTs, SmallVectorImpl< uint64_t > *Offsets=nullptr, uint64_t StartingOffset=0)
ComputeValueVTs - Given an LLVM IR type, compute a sequence of EVTs that represent all the individual...
bool hasInlineAsmMemConstraint(InlineAsm::ConstraintInfoVector &CInfos, const TargetLowering &TLI)
hasInlineAsmMemConstraint - Return true if the inline asm instruction being processed uses a memory '...
TargetInstrInfo - Interface to description of machine instruction set.
uint64_t getElementOffset(unsigned Idx) const
static bool indexReallyValid(CompositeType *T, unsigned Idx)
For an aggregate type, determine whether a given index is within bounds or not.
reverse_iterator rend() const
bool isTypeLegal(EVT VT) const
Return true if the target has native support for the specified value type.
Subclasses of this class are all able to terminate a basic block.
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
bool isIndirect
isIndirect - True if this operand is an indirect operand.
EHPersonality classifyEHPersonality(const Value *Pers)
See if the given exception handling personality function is one that we understand.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
unsigned GuaranteedTailCallOpt
GuaranteedTailCallOpt - This flag is enabled when -tailcallopt is specified on the commandline...
Value * getOperand(unsigned i) const
0 1 1 1 True if ordered (no nans)
1 1 1 1 Always true (always folded)
bool isPointerTy() const
True if this is an instance of PointerType.
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
static bool slotOnlyDiscardsData(const Value *RetVal, const Value *CallVal, SmallVectorImpl< unsigned > &RetIndices, SmallVectorImpl< unsigned > &CallIndices, bool AllowDifferingSizes, const TargetLoweringBase &TLI, const DataLayout &DL)
Return true if this scalar return value only has bits discarded on its path from the "tail call" to t...
1 1 0 1 True if unordered, less than, or equal
bool isInTailCallPosition(ImmutableCallSite CS, const TargetMachine &TM)
Test if the given instruction is in a position to be optimized with a tail-call.
bool isReturnBlock() const
Convenience function that returns true if the block ends in a return instruction. ...
std::vector< ConstraintInfo > ConstraintInfoVector
This base class for TargetLowering contains the SelectionDAG-independent parts that can be used from ...
virtual const TargetSubtargetInfo * getSubtargetImpl(const Function &) const
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
0 0 1 0 True if ordered and greater than
Iterator for intrusive lists based on ilist_node.
InstrTy * getInstruction() const
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
static bool isNoopBitcast(Type *T1, Type *T2, const TargetLoweringBase &TLI)
1 1 0 0 True if unordered or less than
Module.h This file contains the declarations for the Module class.
Type * getType() const
All values are typed, get the type of this value.
virtual const TargetLowering * getTargetLowering() const
DenseMap< const MachineBasicBlock *, int > getFuncletMembership(const MachineFunction &MF)
LLVM_NODISCARD T pop_back_val()
ISD::CondCode getFCmpCodeWithoutNaN(ISD::CondCode CC)
getFCmpCodeWithoutNaN - Given an ISD condition code comparing floats, return the equivalent code if w...
bool hasEHFunclets() const
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
Common super class of ArrayType, StructType and VectorType.
llvm_unreachable("Unknown RegBank!")
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
bool isAggregateType() const
Return true if the type is an aggregate type.
unsigned greater or equal
Establish a view to a call site for examination.
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
unsigned getPointerSizeInBits(unsigned AS=0) const
Layout pointer size, in bits FIXME: The defaults need to be removed once all of the backends/clients ...
0 1 1 0 True if ordered and operands are unequal
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
1 0 1 0 True if unordered or greater than
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
reverse_iterator rbegin()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isAsynchronousEHPersonality(EHPersonality Pers)
Returns true if this personality function catches asynchronous exceptions.
bool isSafeToSpeculativelyExecute(const Value *V, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr)
Return true if the instruction does not have any effects besides calculating the result and does not ...
unsigned getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
virtual const TargetInstrInfo * getInstrInfo() const
0 0 0 1 True if ordered and equal
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
1 0 1 1 True if unordered, greater than, or equal
Primary interface to the complete machine description for the target machine.
static bool advanceToNextLeafType(SmallVectorImpl< CompositeType * > &SubTypes, SmallVectorImpl< unsigned > &Path)
Move the given iterators to the next leaf type in depth first traversal.
const TerminatorInst * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
bool attributesPermitTailCall(const Function *F, const Instruction *I, const ReturnInst *Ret, const TargetLoweringBase &TLI, bool *AllowDifferingSizes=nullptr)
Test if given that the input instruction is in the tail call position, if there is an attribute misma...
0 0 1 1 True if ordered and greater than or equal
unsigned ComputeLinearIndex(Type *Ty, const unsigned *Indices, const unsigned *IndicesEnd, unsigned CurIndex=0)
Compute the linearized index of a member in a nested aggregate/struct/array.
const BasicBlock * getParent() const
0 0 0 0 Always false (always folded)
Type * getTypeAtIndex(const Value *V) const
Given an index value into the type, return the type of the element.
This file describes how to lower LLVM code to machine code.
bool isVoidTy() const
Return true if this is 'void'.
This instruction inserts a struct field of array element value into an aggregate value.
static bool firstRealType(Type *Next, SmallVectorImpl< CompositeType * > &SubTypes, SmallVectorImpl< unsigned > &Path)
Find the first non-empty, scalar-like type in Next and setup the iterator components.