[PATCH] D84997: [AutoFDO] Avoid merging inlinee samples multiple times

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 20:35:44 PDT 2020


wenlei added a comment.

In D84997#2186518 <https://reviews.llvm.org/D84997#2186518>, @wmi wrote:

> The multiple inline instance copies generated from loop unrolling or jump threading should have their own FunctionSamples objects. Why merging multiple inline instance to the outline profile will trigger assertion? Could you have a testcase for it?

It's a slightly difference case. In the training build, we didn't unroll, so there's a single inline site in the loop, but in the PGO optimizing build, the loop got unrolled with call site duplicated. And the duplicated call sites all point to the same `FunctionSamples`, in which case we should merge them only once. Agree that we should add a test case.

> For the second problem, we got a bug report for the same problem. I create a testcase and a fix in https://reviews.llvm.org/D84994. I think your fix is more concise while mine is a straightforward fix. If you think your fix is better, free to use the testcase in D84994 <https://reviews.llvm.org/D84994>. Otherwise, I can commit that one.




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84997/new/

https://reviews.llvm.org/D84997



More information about the llvm-commits mailing list