[PATCH] D120096: PGOInstrumentation, GCOVProfiling: Split indirectbr critical edges regardless of PHIs

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 17 15:51:19 PST 2022


MatzeB created this revision.
MatzeB added reviewers: ellis, xur, MaskRay, phosek, aeubanks, modimo, wenlei.
Herald added subscribers: hiraditya, mcrosier.
MatzeB requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The `SplitIndirectBrCriticalEdges` function was originally designed for `CodeGenPrepare` and skipped splitting of edges when the destination block didn't contain any `PHI` instructions. This however is only sensible for `CodeGenPrepare` in the case of `PGOInstrumentation` or `GCOVProfiling` this would result in missed counters and wrong result in functions with computed goto.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120096

Files:
  llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
  llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
  llvm/test/Transforms/GCOVProfiling/split-indirectbr-critical-edges.ll
  llvm/test/Transforms/PGOProfile/Inputs/irreducible.proftext
  llvm/test/Transforms/PGOProfile/Inputs/irreducible_entry.proftext
  llvm/test/Transforms/PGOProfile/irreducible.ll
  llvm/test/Transforms/PGOProfile/split-indirectbr-critical-edges.ll
  llvm/unittests/Transforms/Utils/BasicBlockUtilsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120096.409809.patch
Type: text/x-patch
Size: 12103 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220217/584ce2e3/attachment.bin>


More information about the llvm-commits mailing list