21llvm::cl::OptionCategory
MergeCat(
"Path merging options",
22 "These options control path merging.");
25 "use-merge", llvm::cl::init(
false),
26 llvm::cl::desc(
"Enable support for path merging via klee_open_merge() and "
27 "klee_close_merge() (default=false)"),
31 "debug-log-merge", llvm::cl::init(
false),
32 llvm::cl::desc(
"Debug information for path merging (default=false)"),
36 "use-incomplete-merge", llvm::cl::init(
false),
37 llvm::cl::desc(
"Heuristic-based path merging (default=false)"),
41 "debug-log-incomplete-merge", llvm::cl::init(
false),
42 llvm::cl::desc(
"Debug information for incomplete path merging (default=false)"),
82 llvm::Instruction *mp) {
104 auto &cpv = closePoint->second;
105 bool mergedSuccessful =
false;
107 for (
auto& mState: cpv) {
108 if (mState->merge(*es)) {
111 mergedSuccessful =
true;
115 if (!mergedSuccessful) {
124 for (
auto curState: curMergeGroup.second) {
137 : executor(_executor), openInstruction(es->steppedInstructions),
138 closedMean(0), closedStateCount(0) {
147 "All MergeHandlers should be registered in mergeGroups");
Implementation of the region based merging.
ExecutionState representing a path under exploration.
std::uint64_t steppedInstructions
The numbers of times this state has run through Executor::stepInstruction.
void terminateStateEarly(ExecutionState &state, const llvm::Twine &message, StateTerminationType terminationType)
MergingSearcher * mergingSearcher
void releaseStates()
Immediately release the merged states that have run into a 'klee_merge_close()'.
void addClosedState(ExecutionState *es, llvm::Instruction *mp)
Called when a state runs into a 'klee_close_merge()' call.
bool hasMergedStates()
True, if any states have run into 'klee_close_merge()' and have not been released yet.
double closedMean
The average number of instructions between the open and close merge of each state that has finished s...
std::map< llvm::Instruction *, std::vector< ExecutionState * > > reachedCloseMerge
Mapping the different 'klee_close_merge' calls to the states that ran into them.
unsigned closedStateCount
Number of states that are tracked by this MergeHandler, that ran into a relevant klee_close_merge.
void addOpenState(ExecutionState *es)
Add state to the 'openStates' vector.
unsigned getInstructionDistance(ExecutionState *es)
Get distance of state from the openInstruction.
uint64_t openInstruction
The instruction count when the state ran into the klee_open_merge.
ExecutionState * getPrioritizeState()
Return state that should be prioritized to complete this merge.
std::vector< ExecutionState * > openStates
States that ran through the klee_open_merge, but not yet into a corresponding klee_close_merge.
MergeHandler(Executor *_executor, ExecutionState *es)
void removeOpenState(ExecutionState *es)
Remove state from the 'openStates' vector.
std::set< ExecutionState * > inCloseMerge
std::vector< MergeHandler * > mergeGroups
void continueState(ExecutionState &state)
Continue a paused state.
void pauseState(ExecutionState &state)
llvm::cl::OptionCategory MergeCat
llvm::cl::opt< bool > DebugLogIncompleteMerge
llvm::cl::opt< bool > UseMerge
llvm::cl::opt< bool > DebugLogMerge
llvm::cl::opt< bool > UseIncompleteMerge