[PATCH] D76925: [Alignment][NFC] MachineMemOperand::getAlign/getBaseAlign

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 07:37:09 PDT 2020


courbet requested changes to this revision.
courbet added inline comments.
This revision now requires changes to proceed.
Herald added a subscriber: wuzish.


================
Comment at: llvm/lib/CodeGen/MachineOperand.cpp:1059
+Align MachineMemOperand::getAlign() const {
+  return Align(commonAlignment(getBaseAlign(), getOffset()));
 }
----------------
The outer `Align` looks unnecessary.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:13653
   // aligned and the type is a vector with elements up to 4 bytes
-  if (Subtarget.needsSwapsForVSXMemOps() && !(MMO->getAlignment()%16)
-      && VecTy.getScalarSizeInBits() <= 32 ) {
+  if (Subtarget.needsSwapsForVSXMemOps() && MMO->getAlign() >= Align(16) &&
+      VecTy.getScalarSizeInBits() <= 32) {
----------------
This is not an NFC. Should this be `isAligned()` ?


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:13724
   // aligned and the type is a vector with elements up to 4 bytes
-  if (Subtarget.needsSwapsForVSXMemOps() && !(MMO->getAlignment()%16)
-      && VecTy.getScalarSizeInBits() <= 32 ) {
+  if (Subtarget.needsSwapsForVSXMemOps() && MMO->getAlign() >= Align(16) &&
+      VecTy.getScalarSizeInBits() <= 32) {
----------------
ditto


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76925/new/

https://reviews.llvm.org/D76925





More information about the llvm-commits mailing list