LLVM 20.0.0git
|
Strategy that modifies instruction attributes and operands. More...
#include "llvm/FuzzMutate/IRMutator.h"
Public Member Functions | |
uint64_t | getWeight (size_t CurrentSize, size_t MaxSize, uint64_t CurrentWeight) override |
Provide a weight to bias towards choosing this strategy for a mutation. | |
void | mutate (Instruction &Inst, RandomIRBuilder &IB) override |
virtual void | mutate (Module &M, RandomIRBuilder &IB) |
virtual void | mutate (Function &F, RandomIRBuilder &IB) |
virtual void | mutate (BasicBlock &BB, RandomIRBuilder &IB) |
virtual void | mutate (Instruction &I, RandomIRBuilder &IB) |
Public Member Functions inherited from llvm::IRMutationStrategy | |
virtual | ~IRMutationStrategy ()=default |
virtual uint64_t | getWeight (size_t CurrentSize, size_t MaxSize, uint64_t CurrentWeight)=0 |
Provide a weight to bias towards choosing this strategy for a mutation. | |
Strategy that modifies instruction attributes and operands.
Definition at line 123 of file IRMutator.h.
|
inlineoverridevirtual |
Provide a weight to bias towards choosing this strategy for a mutation.
The value of the weight is arbitrary, but a good default is "the number of
distinct ways in which this strategy can mutate a unit". This can also be used to prefer strategies that shrink the overall size of the result when we start getting close to MaxSize
.
Implements llvm::IRMutationStrategy.
Definition at line 125 of file IRMutator.h.
|
virtual |
Reimplemented from llvm::IRMutationStrategy.
Definition at line 53 of file IRMutator.cpp.
|
virtual |
Reimplemented from llvm::IRMutationStrategy.
Definition at line 52 of file IRMutator.cpp.
|
inlinevirtual |
Reimplemented from llvm::IRMutationStrategy.
Definition at line 54 of file IRMutator.h.
|
overridevirtual |
Reimplemented from llvm::IRMutationStrategy.
Definition at line 222 of file IRMutator.cpp.
References llvm::FastMathFlags::all(), llvm::CallingConv::C, llvm::CmpInst::FIRST_FCMP_PREDICATE, llvm::CmpInst::FIRST_ICMP_PREDICATE, GEP, llvm::Instruction::getFastMathFlags(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Instruction::hasAllowContract(), llvm::Instruction::hasAllowReassoc(), llvm::Instruction::hasAllowReciprocal(), llvm::Instruction::hasApproxFunc(), llvm::Instruction::hasNoInfs(), llvm::Instruction::hasNoNaNs(), llvm::Instruction::hasNoSignedWrap(), llvm::Instruction::hasNoSignedZeros(), llvm::Instruction::hasNoUnsignedWrap(), llvm::Instruction::isExact(), llvm::CmpInst::LAST_FCMP_PREDICATE, llvm::CmpInst::LAST_ICMP_PREDICATE, llvm::makeSampler(), llvm::FastMathFlags::none(), llvm::Instruction::setFast(), llvm::Instruction::setHasAllowContract(), llvm::Instruction::setHasAllowReassoc(), llvm::Instruction::setHasAllowReciprocal(), llvm::Instruction::setHasApproxFunc(), llvm::Instruction::setHasNoInfs(), llvm::Instruction::setHasNoNaNs(), llvm::Instruction::setHasNoSignedWrap(), llvm::Instruction::setHasNoSignedZeros(), llvm::Instruction::setHasNoUnsignedWrap(), llvm::Instruction::setIsExact(), llvm::User::setOperand(), and llvm::CmpInst::setPredicate().
|
virtual |
Mutators for each IR unit. By default these forward to a contained instance of the next smaller unit.
Reimplemented from llvm::IRMutationStrategy.
Definition at line 51 of file IRMutator.cpp.