@@ -20,9 +20,9 @@ code is build with ``-fno-strict-aliasing``, sacrificing performance.
2020TypeSanitizer is built to catch when these strict aliasing rules have been violated, helping
2121users find where such bugs originate in their code despite the code looking valid at first glance.
2222
23- As TypeSanitizer is still experimental, it can currently have a large impact on runtime speed,
24- memory use, and code size. It also has a large compile-time overhead. Work is being done to
25- reduce these impacts .
23+ Typical memory overhead introduced by TypeSanitizer is about ** 8x **. Runtime slowdown varies greatly
24+ depending on how often the instrumented code relies on type aliasing. In the best case slowdown is
25+ ** 2x-3x ** .
2626
2727The TypeSanitizer Algorithm
2828===========================
@@ -128,6 +128,14 @@ references to LLVM IR specific terms.
128128Sanitizer features
129129==================
130130
131+ Instrumentation code inlining
132+ ------------------------------
133+
134+ By default TypeSanitizer inserts instrumentation through function calls. This may lead to a reduction in
135+ runtime performance. ``-fno-sanitize-type-outline-instrumentation `` (default: ``false ``) forces all
136+ code instrumentation to be inlined. This will increase the size of the generated code and compiler
137+ overhead, but may improve the runtime performance of the resulting code.
138+
131139``__has_feature(type_sanitizer) ``
132140------------------------------------
133141
@@ -179,10 +187,6 @@ Limitations
179187 shadow memory for each byte of user memory.
180188* There are transformation passes which run before TypeSanitizer. If these
181189 passes optimize out an aliasing violation, TypeSanitizer cannot catch it.
182- * Currently, all instrumentation is inlined. This can result in a **15x **
183- (on average) increase in generated file size, and **3x ** to **7x ** increase
184- in compile time. In some documented cases this can cause the compiler to hang.
185- There are plans to improve this in the future.
186190* Codebases that use unions and struct-initialized variables can see incorrect
187191 results, as TypeSanitizer doesn't yet instrument these reliably.
188192* Since Clang & LLVM's TBAA system is used to generate the checks used by the
0 commit comments