16using namespace fuzzerop;
71 std::vector<fuzzerop::OpDescriptor> &Ops) {
76 std::vector<fuzzerop::OpDescriptor> &Ops) {
89 std::vector<fuzzerop::OpDescriptor> &Ops) {
122 case Instruction::Add:
123 case Instruction::Sub:
124 case Instruction::Mul:
125 case Instruction::SDiv:
126 case Instruction::UDiv:
127 case Instruction::SRem:
128 case Instruction::URem:
129 case Instruction::Shl:
130 case Instruction::LShr:
131 case Instruction::AShr:
132 case Instruction::And:
133 case Instruction::Or:
134 case Instruction::Xor:
136 case Instruction::FAdd:
137 case Instruction::FSub:
138 case Instruction::FMul:
139 case Instruction::FDiv:
140 case Instruction::FRem:
142 case Instruction::BinaryOpsEnd:
156 case Instruction::ICmp:
158 case Instruction::FCmp:
171 if (
Block->isEHPad())
176 if (
Block != &
Block->getParent()->getEntryBlock()) {
178 Block->getTerminator()->eraseFromParent();
189 return V->getType()->isIntegerTy(1);
192 return {Weight, {isInt1Ty}, buildSplitBlock};
199 Type *Ty = Srcs[1]->getType();
213 assert(
T->isAggregateType() &&
"Not a struct or array");
214 if (isa<StructType>(
T))
215 return T->getStructNumElements();
216 return T->getArrayNumElements();
221 if (
auto *CI = dyn_cast<ConstantInt>(V))
227 std::vector<Constant *> Result;
244 unsigned Idx = cast<ConstantInt>(Srcs[1])->getZExtValue();
253 if (
auto *ArrayT = dyn_cast<ArrayType>(Cur[0]->
getType()))
254 return V->getType() == ArrayT->getElementType();
256 auto *STy = cast<StructType>(Cur[0]->
getType());
257 for (
int I = 0,
E = STy->getNumElements();
I <
E; ++
I)
258 if (STy->getTypeAtIndex(
I) == V->getType())
263 if (
auto *ArrayT = dyn_cast<ArrayType>(Cur[0]->
getType()))
266 std::vector<Constant *> Result;
267 auto *STy = cast<StructType>(Cur[0]->
getType());
268 for (
int I = 0,
E = STy->getNumElements();
I <
E; ++
I)
277 if (
auto *CI = dyn_cast<ConstantInt>(V))
278 if (CI->getBitWidth() == 32) {
281 return Indexed == Cur[1]->getType();
286 std::vector<Constant *> Result;
288 auto *
BaseTy = Cur[0]->getType();
303 unsigned Idx = cast<ConstantInt>(Srcs[2])->getZExtValue();
335 auto *FirstTy = cast<VectorType>(Cur[0]->
getType());
339 return std::vector<Constant *>{
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
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 SourcePred validShuffleVectorIndex()
static uint64_t getAggregateNumElements(Type *T)
static SourcePred validExtractValueIndex()
static SourcePred matchScalarInAggregate()
static SourcePred validInsertValueIndex()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static SymbolRef::Type getType(const Symbol *Sym)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
LLVM Basic Block Representation.
static BinaryOperator * Create(BinaryOps Op, Value *S1, Value *S2, const Twine &Name=Twine(), Instruction *InsertBefore=nullptr)
Construct a binary instruction, given the opcode and the two operands.
static BranchInst * Create(BasicBlock *IfTrue, Instruction *InsertBefore=nullptr)
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
@ FCMP_OEQ
0 0 0 1 True if ordered and equal
@ FCMP_TRUE
1 1 1 1 Always true (always folded)
@ ICMP_SLT
signed less than
@ ICMP_SLE
signed less or equal
@ FCMP_OLT
0 1 0 0 True if ordered and less than
@ FCMP_ULE
1 1 0 1 True if unordered, less than, or equal
@ FCMP_OGT
0 0 1 0 True if ordered and greater than
@ FCMP_OGE
0 0 1 1 True if ordered and greater than or equal
@ ICMP_UGE
unsigned greater or equal
@ ICMP_UGT
unsigned greater than
@ ICMP_SGT
signed greater than
@ FCMP_ULT
1 1 0 0 True if unordered or less than
@ FCMP_ONE
0 1 1 0 True if ordered and operands are unequal
@ FCMP_UEQ
1 0 0 1 True if unordered or equal
@ ICMP_ULT
unsigned less than
@ FCMP_UGT
1 0 1 0 True if unordered or greater than
@ FCMP_OLE
0 1 0 1 True if ordered and less than or equal
@ FCMP_ORD
0 1 1 1 True if ordered (no nans)
@ ICMP_SGE
signed greater or equal
@ FCMP_UNE
1 1 1 0 True if unordered or not equal
@ ICMP_ULE
unsigned less or equal
@ FCMP_UGE
1 0 1 1 True if unordered, greater than, or equal
@ FCMP_FALSE
0 0 0 0 Always false (always folded)
@ FCMP_UNO
1 0 0 0 True if unordered: isnan(X) | isnan(Y)
static CmpInst * Create(OtherOps Op, Predicate predicate, Value *S1, Value *S2, const Twine &Name="", Instruction *InsertBefore=nullptr)
Construct a compare instruction, given the opcode, the predicate and the two operands.
static Constant * get(Type *Ty, uint64_t V, bool IsSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
This class represents an Operation in the Expression.
static GetElementPtrInst * Create(Type *PointeeType, Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
static InsertElementInst * Create(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
static InsertValueInst * Create(Value *Agg, Value *Val, ArrayRef< unsigned > Idxs, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
static SelectInst * Create(Value *C, Value *S1, Value *S2, const Twine &NameStr="", Instruction *InsertBefore=nullptr, Instruction *MDFrom=nullptr)
This instruction constructs a fixed permutation of two input 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.
The instances of the Type class are immutable: once they are created, they are never changed.
static IntegerType * getInt32Ty(LLVMContext &C)
static UnaryOperator * Create(UnaryOps Op, Value *S, const Twine &Name=Twine(), Instruction *InsertBefore=nullptr)
Construct a unary instruction, given the opcode and an operand.
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
LLVM Value Representation.
A matcher/generator for finding suitable values for the next source in an operation's partially compl...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static SourcePred matchFirstLengthWAnyType()
OpDescriptor extractValueDescriptor(unsigned Weight)
OpDescriptor splitBlockDescriptor(unsigned Weight)
static SourcePred anyFloatOrVecFloatType()
static SourcePred sizedPtrType()
OpDescriptor fnegDescriptor(unsigned Weight)
void makeConstantsWithType(Type *T, std::vector< Constant * > &Cs)
OpDescriptor cmpOpDescriptor(unsigned Weight, Instruction::OtherOps CmpOp, CmpInst::Predicate Pred)
static SourcePred anyAggregateType()
OpDescriptor extractElementDescriptor(unsigned Weight)
OpDescriptor insertValueDescriptor(unsigned Weight)
OpDescriptor shuffleVectorDescriptor(unsigned Weight)
static SourcePred anyIntType()
static SourcePred matchScalarOfFirstType()
Match values that have the first source's scalar type.
OpDescriptor selectDescriptor(unsigned Weight)
Descriptors for individual operations.
static SourcePred anyIntOrVecIntType()
static SourcePred anyVectorType()
static SourcePred boolOrVecBoolType()
OpDescriptor insertElementDescriptor(unsigned Weight)
static SourcePred matchFirstType()
Match values that have the same type as the first source.
OpDescriptor binOpDescriptor(unsigned Weight, Instruction::BinaryOps Op)
OpDescriptor gepDescriptor(unsigned Weight)
static SourcePred matchSecondType()
Match values that have the same type as the first source.
This is an optimization pass for GlobalISel generic memory operations.
void describeFuzzerIntOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Getters for the default sets of operations, per general category.
void describeFuzzerOtherOps(std::vector< fuzzerop::OpDescriptor > &Ops)
void describeFuzzerAggregateOps(std::vector< fuzzerop::OpDescriptor > &Ops)
void describeFuzzerUnaryOperations(std::vector< fuzzerop::OpDescriptor > &Ops)
void describeFuzzerVectorOps(std::vector< fuzzerop::OpDescriptor > &Ops)
DWARFExpression::Operation Op
void describeFuzzerFloatOps(std::vector< fuzzerop::OpDescriptor > &Ops)
void describeFuzzerControlFlowOps(std::vector< fuzzerop::OpDescriptor > &Ops)
void describeFuzzerPointerOps(std::vector< fuzzerop::OpDescriptor > &Ops)
A description of some operation we can build while fuzzing IR.