This is an archive of the discontinued LLVM Phabricator instance.

[Alignment] Use Align in MCStreamer::emitZerofill
AbandonedPublic

Authored by gchatelet on Nov 25 2022, 8:02 AM.

Details

Reviewers
courbet
andreadb
Summary

This is not NFC as MCAsmStreamer will now output alignment unconditionnally.
All tests are passing so it seems like this is acceptable.

Diff Detail

Event Timeline

gchatelet created this revision.Nov 25 2022, 8:02 AM
Herald added a project: Restricted Project. · View Herald Transcript
gchatelet requested review of this revision.Nov 25 2022, 8:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 25 2022, 8:02 AM
gchatelet added a comment.EditedNov 25 2022, 8:12 AM

Looking deeper, it used to be that alignment should be output only if greater than one.

Relevant commit : https://github.com/llvm/llvm-project/commit/6a715dccdf596d39d2b480beac48385f1fa73219#diff-d6520fbf2b954c8679d0835ca53c6ae423b4354e5e517dcfb043446042249f98

It used to be "output alignment if Log2(alignment) != 0" but got turned into "output alignment if alignment != 0" by mistake.

The change modified both EmitZerofill and EmitCommonSymbol.

So this can be made NFC if we revert the behavior to what it was 13 years ago 😁

Would a test help that changes between before and after your patch?

Would a test help that changes between before and after your patch?

I'm fixing this in D138778. Once it's landed, this patch should be NFC.