This is an archive of the discontinued LLVM Phabricator instance.

[Local] Update getOrEnforceKnownAlignment/getKnownAlignment to use Align/MaybeAlign.
ClosedPublic

Authored by craig.topper on Apr 18 2020, 9:31 PM.

Diff Detail

Event Timeline

craig.topper created this revision.Apr 18 2020, 9:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2020, 9:31 PM
Herald added a subscriber: hiraditya. · View Herald Transcript

Properly account for the possiblity of MaybeAlign being unset in CodeGenPrepare.

efriedma added inline comments.Apr 18 2020, 10:37 PM
llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
1019

Please use Align(), not MaybeAlign(), for values known to be non-zero.

Address review comment

efriedma accepted this revision.Apr 20 2020, 11:52 AM

LGTM with one minor comment

llvm/lib/Transforms/Utils/InlineFunction.cpp
1377–1378

This can use Align(ByValAlignment)

This revision is now accepted and ready to land.Apr 20 2020, 11:52 AM
This revision was automatically updated to reflect the committed changes.
craig.topper reopened this revision.Apr 20 2020, 1:35 PM

I missed that there was a usage in clang

This revision is now accepted and ready to land.Apr 20 2020, 1:35 PM

Fix for clang usage.

Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2020, 3:52 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
craig.topper requested review of this revision.Apr 20 2020, 3:53 PM
efriedma added inline comments.Apr 20 2020, 4:27 PM
clang/lib/CodeGen/CGCall.cpp
4181

Align.getAsAlign()

Use getAsAlign

This revision is now accepted and ready to land.Apr 20 2020, 6:58 PM
This revision was automatically updated to reflect the committed changes.

Thx @craig.topper ! I'm happy to see this effort percolate :)