[all-commits] [llvm/llvm-project] 47c1f2: Properly add out-of-module functions to the import...

Hongtao Yu via All-commits all-commits at lists.llvm.org
Mon May 11 10:01:01 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 47c1f2741fe7d24e02c3f54bcb723994292c54c3
      https://github.com/llvm/llvm-project/commit/47c1f2741fe7d24e02c3f54bcb723994292c54c3
  Author: Hongtao Yu <hoy at fb.com>
  Date:   2020-05-11 (Mon, 11 May 2020)

  Changed paths:
    M llvm/include/llvm/ProfileData/SampleProf.h
    M llvm/test/Transforms/SampleProfile/Inputs/function_metadata.compact.afdo
    M llvm/test/Transforms/SampleProfile/Inputs/function_metadata.prof
    M llvm/test/Transforms/SampleProfile/function_metadata.ll

  Log Message:
  -----------
  Properly add out-of-module functions to the import list

This patch addresses two issues related to adding inline functions to the import list while recursively going through the profiling data.
1. For callsite samples, only add an inlined function to the import list if it's from outside of the module (i.e. only has a declaration inside the module).
2. For body samples, add each target function to the import list if it's from outside of the module (i.e. only has a declaration inside the module). Previously we were using getSubProgram() to check whether it has dbg info, which is inaccurate. This fix properly add imports and could improve the quality of the pass.

Added a few changes to the test to catch these cases.

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




More information about the All-commits mailing list