File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
llvm/lib/Transforms/Instrumentation Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,9 @@ using namespace llvm;
212
212
DEBUG_COUNTER (DebugInsertCheck, " msan-insert-check" ,
213
213
" Controls which checks to insert" );
214
214
215
+ DEBUG_COUNTER (DebugInstrumentInstruction, " msan-instrument-instruction" ,
216
+ " Controls which instruction to instrument" );
217
+
215
218
static const unsigned kOriginSize = 4 ;
216
219
static const Align kMinOriginAlignment = Align(4 );
217
220
static const Align kShadowTLSAlignment = Align(8 );
@@ -2176,6 +2179,13 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
2176
2179
// Don't want to visit if we're in the prologue
2177
2180
if (isInPrologue (I))
2178
2181
return ;
2182
+ if (!DebugCounter::shouldExecute (DebugInstrumentInstruction)) {
2183
+ LLVM_DEBUG (dbgs () << " Skipping instruction: " << I << " \n " );
2184
+ // We still need to set the shadow and origin to clean values.
2185
+ setShadow (&I, getCleanShadow (&I));
2186
+ setOrigin (&I, getCleanOrigin ());
2187
+ return ;
2188
+ }
2179
2189
InstVisitor<MemorySanitizerVisitor>::visit (I);
2180
2190
}
2181
2191
You can’t perform that action at this time.
0 commit comments