[PATCH] D146770: [Propeller] Match debug info filenames from profiles to distinguish internal linkage functions with the same names.

Rahman Lavaee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 15:07:53 PDT 2023


rahmanl created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
rahmanl updated this revision to Diff 507916.
rahmanl added a comment.
Herald added a subscriber: pengfei.
rahmanl updated this revision to Diff 509827.
rahmanl updated this revision to Diff 512691.
rahmanl updated this revision to Diff 512701.
rahmanl updated this revision to Diff 512706.
rahmanl retitled this revision from "Read module names from Propeller profile." to "[Propeller] Read debug info filenames from the basic block sections profile to distinguish internal linkage functions with the same names.".
rahmanl edited the summary of this revision.
rahmanl added reviewers: tmsriram, shenhan, xur, tejohnson, amharc.
rahmanl retitled this revision from "[Propeller] Read debug info filenames from the basic block sections profile to distinguish internal linkage functions with the same names." to "[Propeller] Match debug info filenames from profiles to distinguish internal linkage functions with the same names.".
rahmanl published this revision for review.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Add test.


rahmanl added a comment.

Add test cases.


rahmanl added a comment.

- Implement selective profile reading. Profile for each function is only retrieved if it corresponds to a function in the current module.


rahmanl added a comment.

- Implement selective profile reading. Profile for each function is only retrieved if it corresponds to a function in the current module.


rahmanl added a comment.

- Cleanup.


Basic block sections profiles are ingested based on the function name. However, conflicts may occur when internal linkage functions with the same symbol name are linked into the binary (for instance static functions defined in different modules). Currently, these functions cannot be optimized unless we use `-funique-internal-linkage-names` to enforce unique symbol names.

However, we have found that `-funique-internal-linkage-names` does not play well with inline assembly code which refers to the symbol via its symbol name. For example, the Linux kernel does not build with this option.

This patch implements a new feature which allows differentiating profiles based on the debug info filenames associated with each function. When specified, the given path is compared against the debug info filename of the matching function and profile is ingested only when the debug info filenames match. Backward-compatibility is guaranteed as omitting the specifiers from the profile would allow them to be matched by function name only. Also specifiers can be included for a subset of functions only.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146770

Files:
  llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h
  llvm/lib/CodeGen/BasicBlockSections.cpp
  llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp
  llvm/test/CodeGen/X86/basic-block-sections-clusters-error.ll
  llvm/test/CodeGen/X86/basic-block-sections-module1.ll
  llvm/test/CodeGen/X86/basic-block-sections-module2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146770.512706.patch
Type: text/x-patch
Size: 17368 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230412/09632fc4/attachment.bin>


More information about the llvm-commits mailing list