[PATCH] D82779: [Alignment][NFC] Migrate PPC, X86 and XCore backends to Align

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 09:10:33 PDT 2020


gchatelet created this revision.
gchatelet added a reviewer: courbet.
Herald added subscribers: llvm-commits, kbarton, hiraditya, nemanjai.
Herald added a project: LLVM.
gchatelet marked 4 inline comments as done.
gchatelet added inline comments.
Herald added a subscriber: wuzish.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1403
   } else if (ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
-    unsigned EltAlign = 0;
+    Align EltAlign;
     getMaxByValAlign(ATy->getElementType(), EltAlign, MaxMaxAlign);
----------------
This may seem like not NFC but it is.
This is because `MaxAlign>=1` by definition and so it doesn't matter if `EltAlign` is `0` or `1` originally for the statement below:
```
    if (EltAlign > MaxAlign)
      MaxAlign = EltAlign;
```


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1409
     for (auto *EltTy : STy->elements()) {
-      unsigned EltAlign = 0;
+      Align EltAlign;
       getMaxByValAlign(EltTy, EltAlign, MaxMaxAlign);
----------------
ditto


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:2197
   } else if (ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
-    unsigned EltAlign = 0;
+    Align EltAlign;
     getMaxByValAlign(ATy->getElementType(), EltAlign);
----------------
ditto


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:2203
     for (auto *EltTy : STy->elements()) {
-      unsigned EltAlign = 0;
+      Align EltAlign;
       getMaxByValAlign(EltTy, EltAlign);
----------------
ditto


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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82779

Files:
  llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/XCore/XCoreFrameLowering.cpp
  llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82779.274146.patch
Type: text/x-patch
Size: 10079 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200629/5c5f97f3/attachment-0001.bin>


More information about the llvm-commits mailing list