[PATCH] D43794: [InstrProfiling] Emit the runtime hook when no counters are lowered

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 16:12:07 PST 2018


vsk created this revision.
vsk added reviewers: ributzka, bogner, davidxl.

The API verification tool tapi has difficulty processing frameworks
which enable code coverage, but which have no code. The profile lowering
pass does not emit its usual set of symbols in this case because no
counters are lowered.

While the symbols are not needed for program correctness, they are
needed to allow tapi to validate the exported symbol set of instrumented
binaries.

It was not possible to add a workaround in tapi for empty binaries due
to an architectural issue: tapi generates its expected symbol set before
it inspects a binary. Changing that model has a higher cost than simply
forcing llvm to emit the usual set of profiling-related symbols even
when there no counters are present.

rdar://36076904


https://reviews.llvm.org/D43794

Files:
  include/llvm/Transforms/InstrProfiling.h
  lib/Transforms/Instrumentation/InstrProfiling.cpp
  test/Instrumentation/InstrProfiling/early-exit.ll
  test/Instrumentation/InstrProfiling/no-counters.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43794.136005.patch
Type: text/x-patch
Size: 8137 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180227/fec5935b/attachment.bin>


More information about the llvm-commits mailing list