This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho][nfc] Use alignToPowerOf2 instead of alignTo when possible
ClosedPublic

Authored by int3 on Jan 10 2023, 11:47 PM.

Details

Summary

Skips the divide operation which is generally expensive. Not that it
matters in this diff, the code changed is not particularly hot, but just
for principle & consistency...

Diff Detail

Event Timeline

int3 created this revision.Jan 10 2023, 11:47 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 10 2023, 11:47 PM
int3 requested review of this revision.Jan 10 2023, 11:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2023, 11:47 PM
oontvoo accepted this revision.Jan 11 2023, 5:51 AM
oontvoo added a subscriber: oontvoo.

LG

This revision is now accepted and ready to land.Jan 11 2023, 5:51 AM
MaskRay accepted this revision.Jan 11 2023, 11:53 AM

I did the same for lld/ELF. Not that it mattered much, but generated code sequence was slightly better.