[all-commits] [llvm/llvm-project] 4cd8e9: [SampleFDO] Stop letting findCalleeFunctionSamples...

wmi-11 via All-commits all-commits at lists.llvm.org
Mon Aug 10 12:42:32 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4cd8e9b169f4dc5dde19807585c86f6d6113d3ff
      https://github.com/llvm/llvm-project/commit/4cd8e9b169f4dc5dde19807585c86f6d6113d3ff
  Author: Wei Mi <wmi at google.com>
  Date:   2020-08-10 (Mon, 10 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/IPO/SampleProfile.cpp
    A llvm/test/Transforms/SampleProfile/nodebug-error.ll

  Log Message:
  -----------
  [SampleFDO] Stop letting findCalleeFunctionSamples return unrelated profiles
for invoke instructions.

We see a warning of "No debug information found in function foo: Function
profile not used" in a case. The function foo is called by an invoke
instruction. It has no debug information because it has attribute((nodebug))
in the definition. It shouldn't have profile instance in the sample profile
but compiler thinks it does, that turns out to be a compiler bug in
findCalleeFunctionSamples. The bug is exposed when sample-profile-merge-inlinee
is enabled recently.

Currently in findCalleeFunctionSamples, CalleeName is unset and is empty for
invoke instruction. For empty CalleeName, findFunctionSamplesAt will treat
the call as an indirect call and will return any inline instance profile at
the same location as the instruction. That leads to a wrong profile being
returned to function foo.

The patch set CalleeName when the instruction is an invoke.

Differential Revision: https://reviews.llvm.org/D85664




More information about the All-commits mailing list