[PATCH] D134203: [PGO] Avoid assertion on degenerate profile

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 19 11:40:15 PDT 2022


wolfgangp created this revision.
wolfgangp added a reviewer: davidxl.
Herald added subscribers: Enna1, wenlei, hiraditya.
Herald added a project: All.
wolfgangp requested review of this revision.
Herald added a project: LLVM.

A degenerate profile can cause an assertion at code gen time. Specifically, we have a non-zero basic block count with 0 counts in all of the successor blocks.

This has occurred in practice at least once, and while the circumstances under which the profile was created were not immediately reproducible, the crash can be avoided by guarding the offending call.


https://reviews.llvm.org/D134203

Files:
  llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp
  llvm/test/Transforms/PGOProfile/Inputs/maxcountzero.proftext
  llvm/test/Transforms/PGOProfile/maxcountzero.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134203.461268.patch
Type: text/x-patch
Size: 3629 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220919/22f4703d/attachment.bin>


More information about the llvm-commits mailing list