diff options
author | Qin Zhao <zhaoqin@google.com> | 2016-06-10 00:48:53 +0000 |
---|---|---|
committer | Qin Zhao <zhaoqin@google.com> | 2016-06-10 00:48:53 +0000 |
commit | d677d888677bccd0dfc12527c8f40b2c9903c70c (patch) | |
tree | a2be5cf5dde6ae0475e75ed3bc0d73406f73a8d8 /llvm/lib/Transforms | |
parent | c481c7eeb432c3e5e17e0d1834cd75ae12909887 (diff) | |
download | bcm5719-llvm-d677d888677bccd0dfc12527c8f40b2c9903c70c.tar.gz bcm5719-llvm-d677d888677bccd0dfc12527c8f40b2c9903c70c.zip |
[esan|cfrag] Disable load/store instrumentation for cfrag
Summary:
Adds ClInstrumentFastpath option to control fastpath instrumentation.
Avoids the load/store instrumentation for the cache fragmentation tool.
Renames cache_frag_basic.ll to working_set_slow.ll for slowpath
instrumentation test.
Adds the __esan_init check in struct_field_count_basic.ll.
Reviewers: aizatsky
Subscribers: llvm-commits, bruening, eugenis, kcc, zhaoqin, vitalybuka
Differential Revision: http://reviews.llvm.org/D21079
llvm-svn: 272355
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp index 48a9396a956..63391b373c5 100644 --- a/llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp @@ -56,6 +56,9 @@ static cl::opt<bool> ClInstrumentLoadsAndStores( static cl::opt<bool> ClInstrumentMemIntrinsics( "esan-instrument-memintrinsics", cl::init(true), cl::desc("Instrument memintrinsics (memset/memcpy/memmove)"), cl::Hidden); +static cl::opt<bool> ClInstrumentFastpath( + "esan-instrument-fastpath", cl::init(true), + cl::desc("Instrument fastpath"), cl::Hidden); // Experiments show that the performance difference can be 2x or more, // and accuracy loss is typically negligible, so we turn this on by default. @@ -591,7 +594,8 @@ bool EfficiencySanitizer::instrumentLoadOrStore(Instruction *I, {IRB.CreatePointerCast(Addr, IRB.getInt8PtrTy()), ConstantInt::get(IntptrTy, TypeSizeBytes)}); } else { - if (instrumentFastpath(I, DL, IsStore, Addr, Alignment)) { + if (ClInstrumentFastpath && + instrumentFastpath(I, DL, IsStore, Addr, Alignment)) { NumFastpaths++; return true; } @@ -708,8 +712,8 @@ bool EfficiencySanitizer::instrumentFastpathCacheFrag(Instruction *I, const DataLayout &DL, Value *Addr, unsigned Alignment) { - // TODO(bruening): implement a fastpath for aligned accesses - return false; + // Do nothing. + return true; // Return true to avoid slowpath instrumentation. } bool EfficiencySanitizer::instrumentFastpathWorkingSet( |