This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Replace some deprecated getAlignment() calls with getAlign()
ClosedPublic

Authored by aeubanks on Dec 8 2021, 11:49 AM.

Diff Detail

Event Timeline

aeubanks created this revision.Dec 8 2021, 11:49 AM
aeubanks requested review of this revision.Dec 8 2021, 11:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 8 2021, 11:49 AM
arsenm added inline comments.Dec 8 2021, 1:23 PM
llvm/lib/Analysis/MemoryBuiltins.cpp
595

Don't see why this wouldn't just be Alignment (really I don't know why we have MaybeAlign at all)

llvm/lib/IR/AsmWriter.cpp
4239

probably should add a direct raw_ostream overload?

aeubanks added inline comments.Dec 8 2021, 1:46 PM
llvm/lib/Analysis/MemoryBuiltins.cpp
595

background: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
an alignment of 0 (unknown) is different from 1 (no alignment), but actually https://reviews.llvm.org/D64790 seems to specify that perhaps we can treat 0 as 1

but anyway, for now there's a check that Alignment is not 0, so I'll keep that for now

llvm/lib/IR/AsmWriter.cpp
4239

I wouldn't expect a raw_ostream overload for MaybeAlign to print a comma, just align #, but if we want to conditionally emit the comma then we already have to check if MaybeAlign is not null, so I don't see much point in it. and it matches nearby code anyway

gchatelet accepted this revision.Dec 9 2021, 2:22 AM

Thx a lot for the cleanup. I really appreciate it @aeubanks .

@arsenm I wish we could remove MaybeAlign completely. It is certainly possible to confine its usage to a smaller part of the codebase but I don't think we can remove it completely.

This revision is now accepted and ready to land.Dec 9 2021, 2:22 AM