@@ -20,9 +20,13 @@ 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 **.
26+
27+ The compiler instrumentation also has an impact on code size and compilation overhead. There is an
28+ experimental :ref: `instrumentation outlining option<outlining_flag> ` which can greatly reduce this
29+ but this may decrease runtime performance.
2630
2731The TypeSanitizer Algorithm
2832===========================
@@ -128,6 +132,23 @@ references to LLVM IR specific terms.
128132Sanitizer features
129133==================
130134
135+ .. _outlining_flag :
136+
137+ Instrumentation code outlining
138+ ------------------------------
139+
140+ By default TypeSanitizer inlines the instrumentation code. This leads to increased
141+ binary size and compilation time. Using the clang flag
142+ ``-fsanitize-type-outline-instrumentation `` (default: ``false ``)
143+ forces all code instrumentation to be outlined. This reduces the size of the
144+ generated code and reduces compile-time overhead, but it also reduces runtime
145+ performance.
146+
147+ This outlined instrumentation is new. If you wish to verify that the outlined instrumentation
148+ is behaving in the same way as the inline instrumentation, you can force TypeSanitizer
149+ to use both types of instrumentation. You can use the clang flag
150+ ``-fsanitize-type-verify-outlined-instrumentation `` (default: ``false ``) to do this.
151+
131152``__has_feature(type_sanitizer) ``
132153------------------------------------
133154
0 commit comments