[PATCH] D19855: [PGO] Don't value-instrument llvm.global_ctors and llvm.global_dtors functions

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 22:54:18 PDT 2016


xur created this revision.
xur added a reviewer: davidxl.
xur added subscribers: llvm-commits, xur.

The runtime of value profiling (__llvm_profile_instrument_target) has dynamic memory allocation (i.e. malloc). Malloc call can be overwritten by other memory allocator through llvm.global_ctors functions. Value-instrumenting these functions can result in a deadlock.

This patch disables the value-instrumentation (for indirect-call) of functions referenced in llvm.global.ctors and llvm.global_dtors.

http://reviews.llvm.org/D19855

Files:
  lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  test/Transforms/PGOProfile/global_ctor.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19855.55948.patch
Type: text/x-patch
Size: 6500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160503/123f370b/attachment.bin>


More information about the llvm-commits mailing list