This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][RFC] Use default value for PrivateLabelPrefix
AbandonedPublic

Authored by Flakebi on Mar 19 2020, 5:10 AM.

Details

Summary

Setting this to an empty string has the effect that all local symbols
BB0_0, BB0_1, etc. are emitted into object files. Leaving it at the
default value .L has the effect that they are removed when creating the
object file.

The symbol section of the object file stays unmodified in llpc, so all
the basic block symbols currently end up in our pipeline elfs.

(all the tests need to be updated to use the prefix, these changes are
not included to not clutter up the diff, so tests are failing)

Matt: You know this code, does this break things somewhere else?

Diff Detail

Event Timeline

Flakebi created this revision.Mar 19 2020, 5:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2020, 5:10 AM

It seems like we have been emitting these since at least 2014, but I haven't been able to identify exactly why, or who is using them. The only use I see of these in LLVM currently is in llvm-objdump, where we use a symbolizer to get symbolic operands for local branches (e.g. "s_branch BB1_4" instead of "s_branch 51" or "s_branch 51 <BB1_4>"). Other targets do not generally rely on a symbolizer here, and I think we should follow suite, but as some people rely on disassembly being "re-assembleable" on a best-effort basis this will likely break a number of things.

In summary I have wanted to land this patch for a while, but haven't prioritized fixing all the places it will break. One thing we discussed was extending llvm-objdump and other tools to do a 2-pass disassembly, where the first pass essentially materializes temporary labels for all the branch targets it identifies, and the second pass can use these to generate nice labels and use them for the branches.

Flakebi abandoned this revision.Nov 22 2021, 1:24 AM

The change of PrivateLabelPrefix was pushed in D114273.