diff options
| author | Kostya Serebryany <kcc@google.com> | 2019-06-08 00:22:23 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2019-06-08 00:22:23 +0000 |
| commit | 300c0c79de66b2d9f0d4caa7ba416566dacced86 (patch) | |
| tree | 1babbbc7347bd5987e300fe4fa7592ccb0d60b5a /compiler-rt/lib | |
| parent | 829037a9141d2457c5e6dc98f907955d219a635f (diff) | |
| download | bcm5719-llvm-300c0c79de66b2d9f0d4caa7ba416566dacced86.tar.gz bcm5719-llvm-300c0c79de66b2d9f0d4caa7ba416566dacced86.zip | |
Experimantal dfsan mode "fast16labels=1"
Summary:
dfsan mode "fast16labels=1".
In this mode the labels are treated as 16-bit bit masks.
Reviewers: pcc
Reviewed By: pcc
Subscribers: delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D62870
llvm-svn: 362859
Diffstat (limited to 'compiler-rt/lib')
| -rw-r--r-- | compiler-rt/lib/dfsan/dfsan.cc | 2 | ||||
| -rw-r--r-- | compiler-rt/lib/dfsan/dfsan_flags.inc | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/lib/dfsan/dfsan.cc b/compiler-rt/lib/dfsan/dfsan.cc index 7f585a8b170..b206908a514 100644 --- a/compiler-rt/lib/dfsan/dfsan.cc +++ b/compiler-rt/lib/dfsan/dfsan.cc @@ -162,6 +162,8 @@ static void dfsan_check_label(dfsan_label label) { // this function (the instrumentation pass inlines the equality test). extern "C" SANITIZER_INTERFACE_ATTRIBUTE dfsan_label __dfsan_union(dfsan_label l1, dfsan_label l2) { + if (flags().fast16labels) + return l1 | l2; DCHECK_NE(l1, l2); if (l1 == 0) diff --git a/compiler-rt/lib/dfsan/dfsan_flags.inc b/compiler-rt/lib/dfsan/dfsan_flags.inc index cdd0035c9b2..29db73b9827 100644 --- a/compiler-rt/lib/dfsan/dfsan_flags.inc +++ b/compiler-rt/lib/dfsan/dfsan_flags.inc @@ -29,3 +29,7 @@ DFSAN_FLAG( DFSAN_FLAG(const char *, dump_labels_at_exit, "", "The path of the file where " "to dump the labels when the " "program terminates.") +DFSAN_FLAG(bool, fast16labels, false, + "Enables experimental mode where DFSan supports only 16 power-of-2 labels " + "(1, 2, 4, 8, ... 32768) and the label union is computed as a bit-wise OR." +) |

