[PATCH] D96977: [dfsan] Instrument origin variable and function definitions

stephan.yichao.zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 15:08:42 PST 2021


stephan.yichao.zhao added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:335
+    ShadowWidthBytes = ShadowWidthBits / 8,
+    OriginWidthBits = 32,
+    OriginWidthBytes = OriginWidthBits / 8
----------------
gbalats wrote:
> Is this tied to ShadowWidthBits? With fast8, how would this change? 
Origin tracking always uses 4-byte.
Every 4 user byte shares one 4-byte origin. So its memory overhead is always 1x.

Origin is like a hash value, 32bit gives us enough hash space.
It would not be changed in 8-bit mode.


================
Comment at: llvm/test/Instrumentation/DataFlowSanitizer/basic.ll:1-2
+; RUN: opt < %s -dfsan -S | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK_NO_ORIGIN
+; RUN: opt < %s -dfsan -dfsan-track-origins=1 -dfsan-fast-16-labels=true -S | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK_ORIGIN
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
----------------
morehouse wrote:
> gbalats wrote:
> > You could use --check-prefixes to merge these.
> 
Done. Thank you.


================
Comment at: llvm/test/Instrumentation/DataFlowSanitizer/basic.ll:1-2
+; RUN: opt < %s -dfsan -S | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK_NO_ORIGIN
+; RUN: opt < %s -dfsan -dfsan-track-origins=1 -dfsan-fast-16-labels=true -S | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK_ORIGIN
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
----------------
stephan.yichao.zhao wrote:
> morehouse wrote:
> > gbalats wrote:
> > > You could use --check-prefixes to merge these.
> > 
> Done. Thank you.
Thank you. The two comments match exactly. :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96977/new/

https://reviews.llvm.org/D96977



More information about the llvm-commits mailing list