Skip to content

Commit

Permalink
llvm-slicer-crit: do not write out all matched criteria
Browse files Browse the repository at this point in the history
It may take a lot of time, give just a summary information
(the user can generate the debug .ll file to see all the criteria).
  • Loading branch information
mchalupa committed Dec 13, 2022
1 parent 8fe16d3 commit c0224b5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tools/llvm-slicer-crit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,16 @@ static std::vector<SlicingCriteriaSet> getSlicingCriteriaInstructions(

if (!SC.primary.empty()) {
llvm::errs() << "SC: Matched '" << primsec[0] << "' to: \n";
size_t n = 0;
for (const auto *val : SC.primary) {
if (++n > 10)
break;
llvm::errs() << " " << *val << "\n";
}
if (SC.primary.size() >= n) {
llvm::errs() << " ... and " << SC.primary.size() - n + 1
<< " more\n";
}

if (criteria_are_next_instr) {
// the given (primary) criteria are just markers for the
Expand All @@ -541,9 +548,16 @@ static std::vector<SlicingCriteriaSet> getSlicingCriteriaInstructions(
auto newset = mapToNextInstr(SC.primary);
SC.primary.swap(newset);

n = 0;
for (const auto *val : SC.primary) {
if (++n > 10)
break;
llvm::errs() << " SC (next): " << *val << "\n";
}
if (SC.primary.size() >= n) {
llvm::errs() << " ... and " << SC.primary.size() - n + 1
<< " more\n";
}
}
}

Expand All @@ -552,11 +566,18 @@ static std::vector<SlicingCriteriaSet> getSlicingCriteriaInstructions(
constructed_only);

if (!SC.secondary.empty()) {
size_t n = 0;
llvm::errs() << "SC: Matched '" << primsec[1]
<< "' (secondary) to: \n";
for (const auto *val : SC.secondary) {
if (++n > 10)
break;
llvm::errs() << " " << *val << "\n";
}
if (SC.secondary.size() >= n) {
llvm::errs() << " ... and " << SC.primary.size() - n + 1
<< " more\n";
}
}

if (ssctoall) {
Expand Down

0 comments on commit c0224b5

Please sign in to comment.