This is an archive of the discontinued LLVM Phabricator instance.

[Alignment][NFC] Remove usage of MemSDNode::getAlignment
ClosedPublic

Authored by gchatelet on Jun 2 2022, 1:03 PM.

Details

Summary

I can't remove the function just yet as it is used in the generated .inc files.
I would also like to provide a way to compare alignment with TypeSize since it came up a few times.

Diff Detail

Event Timeline

gchatelet created this revision.Jun 2 2022, 1:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2022, 1:03 PM
gchatelet requested review of this revision.Jun 2 2022, 1:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2022, 1:03 PM
courbet added inline comments.Jun 3 2022, 1:01 AM
llvm/lib/Target/ARM/ARMISelLowering.cpp
5583

Even though this works, I think this is conceptually misleading: 4 here is an offset, not an alignment. So I think this should be:

commonAlignment(Ld->getAlign(), 4)

14797

ditto

llvm/lib/Target/Mips/MipsSEISelLowering.cpp
1186

ditto

1221

ditto

llvm/lib/Target/PowerPC/PPCISelLowering.cpp
15317

ditto

gchatelet updated this revision to Diff 433984.Jun 3 2022, 1:36 AM
  • Address comments
gchatelet marked 5 inline comments as done.Jun 7 2022, 6:08 AM
gchatelet added inline comments.
llvm/lib/Target/ARM/ARMISelLowering.cpp
5583

Good catch, thx!

courbet accepted this revision.Jun 7 2022, 6:11 AM
This revision is now accepted and ready to land.Jun 7 2022, 6:11 AM
This revision was landed with ongoing or failed builds.Jun 7 2022, 6:53 AM
This revision was automatically updated to reflect the committed changes.
gchatelet marked an inline comment as done.