[PATCH] D80510: Update BFI when handling inlined landing / eh pad

Haibo Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 25 02:38:44 PDT 2020


hhb created this revision.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

When handling inlined landing / eh pad, we may split a block. But we didn't copy BFI to the new block.

This leads to non-deterministic behavior.
In some cases, BlockFrequencyInfoImplBase::getBlockFreq can detect this unknown block and return 0.
In other rare cases, the BasicBlock* happens to be an address used before, an old frequency value will be returned.

This error can be easily detected if -check-bfi-unknown-block-queries is enabled.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80510

Files:
  llvm/lib/Transforms/Utils/InlineFunction.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80510.265982.patch
Type: text/x-patch
Size: 4844 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200525/0b5eca3c/attachment-0001.bin>


More information about the llvm-commits mailing list