Skip to content

Commit d398f47

Browse files
authored
[msan] Rename '-msan-dump-strict-intrinsics' to '-msan-dump-heuristic-instructions' (#143186)
This updates the flag from #123381 Also expands the description of msan-dump-strict-*instructions*
1 parent a75fc76 commit d398f47

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,22 @@ static cl::opt<bool> ClEagerChecks(
316316

317317
static cl::opt<bool> ClDumpStrictInstructions(
318318
"msan-dump-strict-instructions",
319-
cl::desc("print out instructions with default strict semantics"),
319+
cl::desc("print out instructions with default strict semantics i.e.,"
320+
"check that all the inputs are fully initialized, and mark "
321+
"the output as fully initialized. These semantics are applied "
322+
"to instructions that could not be handled explicitly nor "
323+
"heuristically."),
320324
cl::Hidden, cl::init(false));
321325

322-
static cl::opt<bool> ClDumpStrictIntrinsics(
323-
"msan-dump-strict-intrinsics",
324-
cl::desc("Prints 'unknown' intrinsics that were handled heuristically. "
325-
"Use -msan-dump-strict-instructions to print intrinsics that "
326-
"could not be handled exactly nor heuristically."),
326+
// Currently, all the heuristically handled instructions are specifically
327+
// IntrinsicInst. However, we use the broader "HeuristicInstructions" name
328+
// to parallel 'msan-dump-strict-instructions', and to keep the door open to
329+
// handling non-intrinsic instructions heuristically.
330+
static cl::opt<bool> ClDumpHeuristicInstructions(
331+
"msan-dump-heuristic-instructions",
332+
cl::desc("Prints 'unknown' instructions that were handled heuristically. "
333+
"Use -msan-dump-strict-instructions to print instructions that "
334+
"could not be handled explicitly nor heuristically."),
327335
cl::Hidden, cl::init(false));
328336

329337
static cl::opt<int> ClInstrumentationWithCallThreshold(
@@ -3197,10 +3205,10 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
31973205

31983206
bool handleUnknownIntrinsic(IntrinsicInst &I) {
31993207
if (handleUnknownIntrinsicUnlogged(I)) {
3200-
if (ClDumpStrictIntrinsics)
3208+
if (ClDumpHeuristicInstructions)
32013209
dumpInst(I);
32023210

3203-
LLVM_DEBUG(dbgs() << "UNKNOWN INTRINSIC HANDLED HEURISTICALLY: " << I
3211+
LLVM_DEBUG(dbgs() << "UNKNOWN INSTRUCTION HANDLED HEURISTICALLY: " << I
32043212
<< "\n");
32053213
return true;
32063214
} else

0 commit comments

Comments
 (0)