[all-commits] [llvm/llvm-project] 7ed812: [HeapProf] Clang and LLVM support for heap profili...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Thu Aug 27 08:51:21 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7ed8124d46f94601d5f1364becee9cee8538265e
      https://github.com/llvm/llvm-project/commit/7ed8124d46f94601d5f1364becee9cee8538265e
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M clang/include/clang/Basic/CodeGenOptions.def
    M clang/include/clang/Driver/Options.td
    M clang/include/clang/Driver/SanitizerArgs.h
    M clang/lib/CodeGen/BackendUtil.cpp
    M clang/lib/Driver/SanitizerArgs.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    A clang/test/Driver/fmemprof.cpp
    M llvm/include/llvm/InitializePasses.h
    A llvm/include/llvm/Transforms/Instrumentation/HeapProfiler.h
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Passes/PassRegistry.def
    M llvm/lib/Transforms/Instrumentation/CMakeLists.txt
    A llvm/lib/Transforms/Instrumentation/HeapProfiler.cpp
    M llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
    A llvm/test/Instrumentation/HeapProfiler/basic.ll
    A llvm/test/Instrumentation/HeapProfiler/instrumentation-use-callbacks.ll
    A llvm/test/Instrumentation/HeapProfiler/masked-load-store.ll
    A llvm/test/Instrumentation/HeapProfiler/scale-granularity.ll
    A llvm/test/Instrumentation/HeapProfiler/version-mismatch-check.ll

  Log Message:
  -----------
  [HeapProf] Clang and LLVM support for heap profiling instrumentation

See RFC for background:
http://lists.llvm.org/pipermail/llvm-dev/2020-June/142744.html

Note that the runtime changes will be sent separately (hopefully this
week, need to add some tests).

This patch includes the LLVM pass to instrument memory accesses with
either inline sequences to increment the access count in the shadow
location, or alternatively to call into the runtime. It also changes
calls to memset/memcpy/memmove to the equivalent runtime version.
The pass is modeled on the address sanitizer pass.

The clang changes add the driver option to invoke the new pass, and to
link with the upcoming heap profiling runtime libraries.

Currently there is no attempt to optimize the instrumentation, e.g. to
aggregate updates to the same memory allocation. That will be
implemented as follow on work.

Differential Revision: https://reviews.llvm.org/D85948




More information about the All-commits mailing list