[PATCH] D128863: Add switch to use "source_file_name" instead of Module ID for globally promoted local

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 13:36:01 PDT 2022


void added a comment.

In D128863#3694115 <https://reviews.llvm.org/D128863#3694115>, @tejohnson wrote:

> In D128863#3692386 <https://reviews.llvm.org/D128863#3692386>, @void wrote:
>
>> In D128863#3665929 <https://reviews.llvm.org/D128863#3665929>, @tejohnson wrote:
>>
>>> I'm ok with approving this patch though if it helps you make forward progress. Can you add a test? One other suggestion in the code below too.
>>
>> I'm not sure how to create a testcase for this option. There doesn't seem to be anyway to trigger this code via the tools...
>
> You should be able to use llvm-lto or llvm-lto2. For example, see this test case that uses llvm-lto to test promotion: llvm/test/ThinLTO/X86/local_name_conflict.ll. There are some other examples in that directory with llvm-lto2 that look for promotions (they usually don't check the hash, but rather for the ".llvm." name to confirm promotion happened). The 2 tools use different LTO apis but the code you modified is exercised with both, so either tool will work for your purposes. You should probably create a simple example that results in importing of a local symbol reference and compare the hashes with and without your new option.

Ah! Thank you. Done.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128863/new/

https://reviews.llvm.org/D128863



More information about the llvm-commits mailing list