[clang] [llvm] [LLVM][rtsan] Add module pass to initialize rtsan (PR #118989)
@@ -1024,12 +1024,14 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
FPM.addPass(BoundsCheckingPass());
});
-if (LangOpts.Sanitize.has(SanitizerKind::Realtime))
+if (LangOpts.Sanitize.has(SanitizerKind::Realtime)) {
vitalybuka wrote:
You need to consider performance vs quality.
For other sanitizers it's essentially:
1. If it's early - better precision - in sense we detect issues in C/C++
program which can be optimized out. (can Realtime related issue be optimized
out, and do you care about them at all)
2. If it's late - better performance, but we may miss bugs
I believe performance is ~2x difference, so we can't afford that e.g. in Asan.
https://github.com/llvm/llvm-project/pull/118989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [LLVM][rtsan] Add module pass to initialize rtsan (PR #118989)
@@ -1024,12 +1024,14 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
FPM.addPass(BoundsCheckingPass());
});
-if (LangOpts.Sanitize.has(SanitizerKind::Realtime))
+if (LangOpts.Sanitize.has(SanitizerKind::Realtime)) {
cjappl wrote:
I'll investigate if moving it is possible! Off the top of my head I don't know
if there is a reason.
I'll report back with PRs on either/both of these soon.
https://github.com/llvm/llvm-project/pull/118989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [LLVM][rtsan] Add module pass to initialize rtsan (PR #118989)
@@ -1024,12 +1024,14 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
FPM.addPass(BoundsCheckingPass());
});
-if (LangOpts.Sanitize.has(SanitizerKind::Realtime))
+if (LangOpts.Sanitize.has(SanitizerKind::Realtime)) {
PB.registerScalarOptimizerLateEPCallback(
[](FunctionPassManager &FPM, OptimizationLevel Level) {
RealtimeSanitizerOptions Opts;
FPM.addPass(RealtimeSanitizerPass(Opts));
});
+ MPM.addPass(ModuleRealtimeSanitizerPass());
cjappl wrote:
Sounds good, I'll work on swapping rtsan over.
https://github.com/llvm/llvm-project/pull/118989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [LLVM][rtsan] Add module pass to initialize rtsan (PR #118989)
@@ -1024,12 +1024,14 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
FPM.addPass(BoundsCheckingPass());
});
-if (LangOpts.Sanitize.has(SanitizerKind::Realtime))
+if (LangOpts.Sanitize.has(SanitizerKind::Realtime)) {
PB.registerScalarOptimizerLateEPCallback(
[](FunctionPassManager &FPM, OptimizationLevel Level) {
RealtimeSanitizerOptions Opts;
FPM.addPass(RealtimeSanitizerPass(Opts));
});
+ MPM.addPass(ModuleRealtimeSanitizerPass());
vitalybuka wrote:
Also we converted all but tsan from function+module to just module pass. Easier
to maintain.
https://github.com/llvm/llvm-project/pull/118989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [LLVM][rtsan] Add module pass to initialize rtsan (PR #118989)
@@ -1024,12 +1024,14 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
FPM.addPass(BoundsCheckingPass());
});
-if (LangOpts.Sanitize.has(SanitizerKind::Realtime))
+if (LangOpts.Sanitize.has(SanitizerKind::Realtime)) {
vitalybuka wrote:
@cjappl
@why do we use this location and not `addSanitizers`? In particular
registerOptimizerLastEPCallback?
https://github.com/llvm/llvm-project/pull/118989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [LLVM][rtsan] Add module pass to initialize rtsan (PR #118989)
https://github.com/cjappl closed https://github.com/llvm/llvm-project/pull/118989 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [LLVM][rtsan] Add module pass to initialize rtsan (PR #118989)
https://github.com/fmayer approved this pull request. https://github.com/llvm/llvm-project/pull/118989 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [LLVM][rtsan] Add module pass to initialize rtsan (PR #118989)
@@ -25,3 +25,7 @@ attributes #0 = { mustprogress noinline sanitize_realtime
optnone ssp uwtable(sy
; RealtimeSanitizer pass should insert __rtsan_realtime_exit right before
function return
; CHECK: call{{.*}}@__rtsan_realtime_exit
; CHECK-NEXT: ret{{.*}}void
+
+; RealtimeSanitizer pass should insert call to initialize the runtime
cjappl wrote:
Good idea!
https://github.com/llvm/llvm-project/pull/118989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [LLVM][rtsan] Add module pass to initialize rtsan (PR #118989)
@@ -25,3 +25,7 @@ attributes #0 = { mustprogress noinline sanitize_realtime
optnone ssp uwtable(sy
; RealtimeSanitizer pass should insert __rtsan_realtime_exit right before
function return
; CHECK: call{{.*}}@__rtsan_realtime_exit
; CHECK-NEXT: ret{{.*}}void
+
+; RealtimeSanitizer pass should insert call to initialize the runtime
fmayer wrote:
maybe the test should specify the context this call is in?
https://github.com/llvm/llvm-project/pull/118989
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
