LLVM  14.0.0git
Operations.h
Go to the documentation of this file.
1 //===-- Operations.h - ----------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Implementations of common fuzzer operation descriptors for building an IR
10 // mutator.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_FUZZMUTATE_OPERATIONS_H
15 #define LLVM_FUZZMUTATE_OPERATIONS_H
16 
18 #include "llvm/IR/InstrTypes.h"
19 #include "llvm/IR/Instruction.h"
20 
21 namespace llvm {
22 
23 /// Getters for the default sets of operations, per general category.
24 /// @{
25 void describeFuzzerIntOps(std::vector<fuzzerop::OpDescriptor> &Ops);
26 void describeFuzzerFloatOps(std::vector<fuzzerop::OpDescriptor> &Ops);
27 void describeFuzzerControlFlowOps(std::vector<fuzzerop::OpDescriptor> &Ops);
28 void describeFuzzerPointerOps(std::vector<fuzzerop::OpDescriptor> &Ops);
29 void describeFuzzerAggregateOps(std::vector<fuzzerop::OpDescriptor> &Ops);
30 void describeFuzzerVectorOps(std::vector<fuzzerop::OpDescriptor> &Ops);
31 /// @}
32 
33 namespace fuzzerop {
34 
35 /// Descriptors for individual operations.
36 /// @{
37 OpDescriptor binOpDescriptor(unsigned Weight, Instruction::BinaryOps Op);
38 OpDescriptor cmpOpDescriptor(unsigned Weight, Instruction::OtherOps CmpOp,
39  CmpInst::Predicate Pred);
40 OpDescriptor splitBlockDescriptor(unsigned Weight);
41 OpDescriptor gepDescriptor(unsigned Weight);
42 OpDescriptor extractValueDescriptor(unsigned Weight);
43 OpDescriptor insertValueDescriptor(unsigned Weight);
44 OpDescriptor extractElementDescriptor(unsigned Weight);
45 OpDescriptor insertElementDescriptor(unsigned Weight);
46 OpDescriptor shuffleVectorDescriptor(unsigned Weight);
47 /// @}
48 
49 } // end fuzzerop namespace
50 
51 } // end llvm namespace
52 
53 #endif // LLVM_FUZZMUTATE_OPERATIONS_H
OpDescriptor.h
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::CmpInst::Predicate
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition: InstrTypes.h:720
llvm::fuzzerop::gepDescriptor
OpDescriptor gepDescriptor(unsigned Weight)
Definition: Operations.cpp:170
llvm::fuzzerop::splitBlockDescriptor
OpDescriptor splitBlockDescriptor(unsigned Weight)
Definition: Operations.cpp:140
llvm::fuzzerop::binOpDescriptor
OpDescriptor binOpDescriptor(unsigned Weight, Instruction::BinaryOps Op)
Descriptors for individual operations.
Definition: Operations.cpp:91
Instruction.h
llvm::describeFuzzerPointerOps
void describeFuzzerPointerOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:75
InstrTypes.h
llvm::Instruction::OtherOps
OtherOps
Definition: Instruction.h:813
llvm::describeFuzzerIntOps
void describeFuzzerIntOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Getters for the default sets of operations, per general category.
Definition: Operations.cpp:18
llvm::fuzzerop::extractValueDescriptor
OpDescriptor extractValueDescriptor(unsigned Weight)
Definition: Operations.cpp:211
llvm::fuzzerop::cmpOpDescriptor
OpDescriptor cmpOpDescriptor(unsigned Weight, Instruction::OtherOps CmpOp, CmpInst::Predicate Pred)
Definition: Operations.cpp:123
llvm::fuzzerop::insertElementDescriptor
OpDescriptor insertElementDescriptor(unsigned Weight)
Definition: Operations.cpp:290
llvm::describeFuzzerControlFlowOps
void describeFuzzerControlFlowOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:70
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:324
llvm::Instruction::BinaryOps
BinaryOps
Definition: Instruction.h:785
llvm::describeFuzzerVectorOps
void describeFuzzerVectorOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:85
llvm::fuzzerop::shuffleVectorDescriptor
OpDescriptor shuffleVectorDescriptor(unsigned Weight)
Definition: Operations.cpp:315
llvm::describeFuzzerFloatOps
void describeFuzzerFloatOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:45
llvm::fuzzerop::extractElementDescriptor
OpDescriptor extractElementDescriptor(unsigned Weight)
Definition: Operations.cpp:282
llvm::describeFuzzerAggregateOps
void describeFuzzerAggregateOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:79
llvm::fuzzerop::insertValueDescriptor
OpDescriptor insertValueDescriptor(unsigned Weight)
Definition: Operations.cpp:270