LLVM 19.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
21namespace llvm {
22
23/// Getters for the default sets of operations, per general category.
24/// @{
25void describeFuzzerIntOps(std::vector<fuzzerop::OpDescriptor> &Ops);
26void describeFuzzerFloatOps(std::vector<fuzzerop::OpDescriptor> &Ops);
27void describeFuzzerControlFlowOps(std::vector<fuzzerop::OpDescriptor> &Ops);
28void describeFuzzerPointerOps(std::vector<fuzzerop::OpDescriptor> &Ops);
29void describeFuzzerAggregateOps(std::vector<fuzzerop::OpDescriptor> &Ops);
30void describeFuzzerVectorOps(std::vector<fuzzerop::OpDescriptor> &Ops);
31void describeFuzzerUnaryOperations(std::vector<fuzzerop::OpDescriptor> &Ops);
32void describeFuzzerOtherOps(std::vector<fuzzerop::OpDescriptor> &Ops);
33/// @}
34
35namespace fuzzerop {
36
37/// Descriptors for individual operations.
38/// @{
39OpDescriptor selectDescriptor(unsigned Weight);
40OpDescriptor fnegDescriptor(unsigned Weight);
41OpDescriptor binOpDescriptor(unsigned Weight, Instruction::BinaryOps Op);
42OpDescriptor cmpOpDescriptor(unsigned Weight, Instruction::OtherOps CmpOp,
44OpDescriptor splitBlockDescriptor(unsigned Weight);
45OpDescriptor gepDescriptor(unsigned Weight);
46OpDescriptor extractValueDescriptor(unsigned Weight);
47OpDescriptor insertValueDescriptor(unsigned Weight);
48OpDescriptor extractElementDescriptor(unsigned Weight);
49OpDescriptor insertElementDescriptor(unsigned Weight);
50OpDescriptor shuffleVectorDescriptor(unsigned Weight);
51
52/// @}
53
54} // namespace fuzzerop
55
56} // namespace llvm
57
58#endif // LLVM_FUZZMUTATE_OPERATIONS_H
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition: InstrTypes.h:780
OpDescriptor extractValueDescriptor(unsigned Weight)
Definition: Operations.cpp:241
OpDescriptor splitBlockDescriptor(unsigned Weight)
Definition: Operations.cpp:165
OpDescriptor fnegDescriptor(unsigned Weight)
Definition: Operations.cpp:109
OpDescriptor cmpOpDescriptor(unsigned Weight, Instruction::OtherOps CmpOp, CmpInst::Predicate Pred)
Definition: Operations.cpp:148
OpDescriptor extractElementDescriptor(unsigned Weight)
Definition: Operations.cpp:312
OpDescriptor insertValueDescriptor(unsigned Weight)
Definition: Operations.cpp:300
OpDescriptor shuffleVectorDescriptor(unsigned Weight)
Definition: Operations.cpp:345
OpDescriptor selectDescriptor(unsigned Weight)
Descriptors for individual operations.
Definition: Operations.cpp:100
OpDescriptor insertElementDescriptor(unsigned Weight)
Definition: Operations.cpp:320
OpDescriptor binOpDescriptor(unsigned Weight, Instruction::BinaryOps Op)
Definition: Operations.cpp:116
OpDescriptor gepDescriptor(unsigned Weight)
Definition: Operations.cpp:195
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
void describeFuzzerIntOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Getters for the default sets of operations, per general category.
Definition: Operations.cpp:18
void describeFuzzerOtherOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:80
void describeFuzzerAggregateOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:88
void describeFuzzerUnaryOperations(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:70
void describeFuzzerVectorOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:94
DWARFExpression::Operation Op
void describeFuzzerFloatOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:45
void describeFuzzerControlFlowOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:75
void describeFuzzerPointerOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:84