[PATCH] D40702: [PGO] More fix to infinite loop profiling

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 23:00:05 PST 2017


davidxl created this revision.
Herald added a subscriber: sanjoy.

The IR instrumentation uses MST to decide instrumentation points. It relies adding a fake edge from the function exit block (with no successors) to the fake node. Otherwise edges needed to be instrumented may end up in MST (and therefore not instrumented).

With infinite loop, the exit block may not exist thus the instrumentation will be wrong.  Without the fix, the runtime test case added in r319463 will have zero entry count for main (or any parent function of an infinite loop).

After this is fix, there will be more fixes needed in BFI to avoid the body count from being dropped.


https://reviews.llvm.org/D40702

Files:
  lib/Transforms/Instrumentation/CFGMST.h
  lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  test/Transforms/PGOProfile/infinite_loop_gen.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40702.125079.patch
Type: text/x-patch
Size: 8772 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171201/6d2ff2ec/attachment.bin>


More information about the llvm-commits mailing list