[PATCH] D73222: [PGO] Early detection regarding whether pgo counter promotion is possible

Christopher Chrulski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 13:00:45 PST 2020


chris.chrulski created this revision.
chris.chrulski added reviewers: llvm-commits, davidxl.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

This fixes a problem with the current behavior when assertions are enabled.
A loop that exits to a catchswitch instruction is skipped for the counter
promotion, however this check was being done after the PGOCounterPromoter
tried to collect an insertion point for the exit block. A call to
getFirstInsertionPt() on a block that begins with a catchswitch instruction
triggers an assertion. This change performs a check whether the counter
promotion is possible prior to collecting the ExitBlocks and InsertPts.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73222

Files:
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/test/Transforms/PGOProfile/counter_promo_exit_catchswitch.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73222.239675.patch
Type: text/x-patch
Size: 5668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200122/310f1c19/attachment.bin>


More information about the llvm-commits mailing list