This is an archive of the discontinued LLVM Phabricator instance.

[Alignment][NFC] Transition and simplify calls to DL::getABITypeAlignment
ClosedPublic

Authored by gchatelet on Jul 1 2020, 9:10 AM.

Details

Summary

This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Diff Detail

Event Timeline

gchatelet created this revision.Jul 1 2020, 9:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2020, 9:10 AM
gchatelet marked 5 inline comments as done.Jul 1 2020, 9:15 AM
gchatelet added inline comments.
llvm/lib/Target/X86/X86FastISel.cpp
1326

LI->getAlign() is always >0, removing the need for getABITypeAlignment altogether.

llvm/lib/Transforms/IPO/Inliner.cpp
223

Align1 and Align2 are always >0 so this whole block can be stripped away.
This translates to:

if (Align1 != Align2) {
  if (Align1 > Align2)
    AvailableAlloca->setAlignment(AI->getAlign());
}

Which is equivalent to:

if (Align1 > Align2)
  AvailableAlloca->setAlignment(AI->getAlign());
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
1375

Again Align cannot to 0

llvm/lib/Transforms/Scalar/LICM.cpp
1946

ditto

1977

ditto

courbet accepted this revision.Jul 2 2020, 2:43 AM
This revision is now accepted and ready to land.Jul 2 2020, 2:43 AM
This revision was automatically updated to reflect the committed changes.