[all-commits] [llvm/llvm-project] 1dd39b: [PGO] Fix incorrect function entry count

xur-llvm via All-commits all-commits at lists.llvm.org
Fri Jul 24 17:40:54 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1dd39b1133136c58847d9f2d3c73d2ad8e76e25d
      https://github.com/llvm/llvm-project/commit/1dd39b1133136c58847d9f2d3c73d2ad8e76e25d
  Author: Rong Xu <xur at google.com>
  Date:   2020-07-24 (Fri, 24 Jul 2020)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
    A llvm/test/Transforms/PGOProfile/Inputs/fix_entry_count.proftext
    A llvm/test/Transforms/PGOProfile/fix_entry_count.ll

  Log Message:
  -----------
  [PGO] Fix incorrect function entry count

Function entry count might be zero after the profile counts reset and
before reentry to the function.

Zero profile entry count is very bad as the profile count from BFI will
be wrong.

A simple fix is to set the profile entry count to 1 if there are
non-zero profile counts in this function.

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




More information about the All-commits mailing list