[all-commits] [llvm/llvm-project] 8a0406: [llvm-profgen] Filter out invalid LBR ranges.

Hongtao Yu via All-commits all-commits at lists.llvm.org
Thu Apr 7 21:42:16 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a0406dcc8ec601e5612638a9d5ca049637c9366
      https://github.com/llvm/llvm-project/commit/8a0406dcc8ec601e5612638a9d5ca049637c9366
  Author: Hongtao Yu <hoy at fb.com>
  Date:   2022-04-07 (Thu, 07 Apr 2022)

  Changed paths:
    A llvm/test/tools/llvm-profgen/Inputs/invalid-range.perfscript
    A llvm/test/tools/llvm-profgen/invalid-range.test
    M llvm/tools/llvm-profgen/PerfReader.cpp
    M llvm/tools/llvm-profgen/PerfReader.h

  Log Message:
  -----------
  [llvm-profgen] Filter out invalid LBR ranges.

The profiler can sometimes give us a LBR trace that implicates bogus code ranges. For example,

    0xc5acb56/0xc66c6c0 0xc628195/0xf31fbb0 0xc611261/0xc628130 0xc5c1a21/0xc6111c0 0x1f7edfd3/0xc5c3a50 0xc5c154f/0x1f7edec0 0xe8eed07/0xc5c11e0

, note that the first two pairs are supposed to form a linear execution range, in this case, it is [0xf31fbb0, 0xc5acb56] , which doesn't make sense.

Such bogus ranges should be ruled out to avoid generating a bad profile. I'm fixing this for both CS and non-CS cases.

Reviewed By: wenlei

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




More information about the All-commits mailing list