[all-commits] [llvm/llvm-project] 683f2d: [SampleProfile] Fix bug where remapper returns emp...

William Junda Huang via All-commits all-commits at lists.llvm.org
Fri Nov 10 13:38:26 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 683f2df6e5efc72b1b61d9863e3eec86ca92824b
      https://github.com/llvm/llvm-project/commit/683f2df6e5efc72b1b61d9863e3eec86ca92824b
  Author: William Junda Huang <williamjhuang at google.com>
  Date:   2023-11-10 (Fri, 10 Nov 2023)

  Changed paths:
    M llvm/lib/ProfileData/SampleProfReader.cpp
    M llvm/lib/Transforms/IPO/SampleProfile.cpp
    A llvm/test/Transforms/SampleProfile/remap-unmatched.ll

  Log Message:
  -----------
  [SampleProfile] Fix bug where remapper returns empty string and crashing Sample Profile loader (#71479)

Normally SampleContext does not allow using an empty StirngRef to
construct an object, this is to prevent bugs reading the profile.
However empty names may be emitted by a function which its name is
intentionally set to empty, or a bug in the remapper that returns an
empty string. Regardless, converting it to FunctionId first will prevent
the assert, and that assert check is unnecessary, which will be
addressed in another patch




More information about the All-commits mailing list