[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 18 18:49:17 PDT 2024


================
@@ -995,6 +996,13 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
             FPM.addPass(BoundsCheckingPass());
           });
 
+    if (LangOpts.Sanitize.has(SanitizerKind::Realtime))
+      PB.registerScalarOptimizerLateEPCallback(
----------------
vitalybuka wrote:

This location looks OK to me.
For other sanitizers, the earlier pass is inserted, the more precise is bug detection, but binary will be slower.

If we insert late, like this one, optimization passes may optimize out a bug.

It would be nice to detect those bugs present in source code, but the cost is too high.

For RTSan, I think, users even will not even care about non-rt-friendly source code, if compiler is able to optimize it out.

So late, like here, is appropriate.

https://github.com/llvm/llvm-project/pull/102622


More information about the cfe-commits mailing list