This is an archive of the discontinued LLVM Phabricator instance.

MCStreamer: Use "cfi" for CFI related temp labels.
ClosedPublic

Authored by MatzeB on Nov 29 2016, 6:39 PM.

Details

Summary

Choosing a "cfi" instead of the default "tmp" makes the intend clearer in an assembly dump.
More importantly: The dumps are more stable. The temp label numbers don't move around anymore when unrelated code calls
createTempSymbol() more or less often.

Temp labels names do not influence the generated object code (just the assembly output).

This is part of an effort to productize machine module passes. The goal here is to have llvm codegen produce the same output with/without a dummy machine module pass inserted into the pipeline.

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 79687.Nov 29 2016, 6:39 PM
MatzeB retitled this revision from to MCStreamer: Use "cfi" for CFI related temp labels..
MatzeB updated this object.
MatzeB added reviewers: cdavis5x, grosbach.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: llvm-commits.

Add some more reviewers knowing debug/exception/call frame info.

aprantl edited edge metadata.Nov 30 2016, 3:27 PM

Seems reasonable. Does the label name have any effect outside of textual assembler?

Seems reasonable. Does the label name have any effect outside of textual assembler?

Nope, the generated object files are the same.

rnk edited edge metadata.Nov 30 2016, 3:30 PM

Why do we need to print labels for CFI at all? The labels generally aren't referenced anywhere, and they only pollute the assembly output. The assembler creates internal labels when processing .cfi_* and .seh_* directives.

In D27244#609914, @rnk wrote:

Why do we need to print labels for CFI at all? The labels generally aren't referenced anywhere, and they only pollute the assembly output. The assembler creates internal labels when processing .cfi_* and .seh_* directives.

The labels do get stored in some CurFrame/WinFrameInfo object thingies. So I assume they get used at least in some circumstances. But it would indeed be really nice to not output them if they are unused. If the assembler does something for you even better, but is that also true in the case where we stream to an object file immediately instead of the assembler?

Anyway I don't know much about these parts of the code and go with the easy renaming to "cfi" for now. I'd love to see someone removing the unnecessary labels of course ;-)

aprantl accepted this revision.Nov 30 2016, 3:56 PM
aprantl edited edge metadata.

If nobody else objects :-)

This revision is now accepted and ready to land.Nov 30 2016, 3:56 PM
This revision was automatically updated to reflect the committed changes.