[all-commits] [llvm/llvm-project] 62ced8: [Sanitizer] Make sanitizer passes idempotent (#99439)

Chaitanya via All-commits all-commits at lists.llvm.org
Sun Aug 11 22:47:06 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 62ced8116ba5274991af0e94cfdf873593c7764d
      https://github.com/llvm/llvm-project/commit/62ced8116ba5274991af0e94cfdf873593c7764d
  Author: Chaitanya <Krishna.Sankisa at amd.com>
  Date:   2024-08-12 (Mon, 12 Aug 2024)

  Changed paths:
    M clang/test/CodeGenObjC/no-sanitize.m
    M llvm/include/llvm/Transforms/Instrumentation.h
    M llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
    M llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
    M llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
    M llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
    M llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
    M llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
    A llvm/test/Instrumentation/AddressSanitizer/asan-pass-second-run.ll
    M llvm/test/Instrumentation/AddressSanitizer/missing_dbg.ll
    A llvm/test/Instrumentation/DataFlowSanitizer/dfsan-pass-second-run.ll
    A llvm/test/Instrumentation/HWAddressSanitizer/hwasan-pass-second-run.ll
    A llvm/test/Instrumentation/MemorySanitizer/msan-pass-second-run.ll
    A llvm/test/Instrumentation/ThreadSanitizer/tsan-pass-second-run.ll

  Log Message:
  -----------
  [Sanitizer] Make sanitizer passes idempotent (#99439)

This PR changes the sanitizer passes to be idempotent. 
When any sanitizer pass is run after it has already been run before,
double instrumentation is seen in the resulting IR. This happens because
there is no check in the pass, to verify if IR has been instrumented
before.

This PR checks if "nosanitize_*" module flag is already present and if
true, return early without running the pass again.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list