[PATCH] D73874: [Alignment][NFC] Use Align for code creating MemOp

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 05:13:27 PST 2020


gchatelet added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/TargetLowering.h:113
   uint64_t Size;
-  unsigned DstAlign; // Specified alignment of the memory operation or zero if
+  uint64_t DstAlign; // Specified alignment of the memory operation or zero if
                      // destination alignment can satisfy any constraint.
----------------
courbet wrote:
> Why not use an `Align` as storage ?
I will in a follow up patch but doing so here will also pull all the downstream changes (parts of the code that uses the `MemOp` members )


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:996
     Type *IRTy = getTypeForLLT(MemOps[0], C);
-    unsigned NewAlign = (unsigned)DL.getABITypeAlignment(IRTy);
-    if (NewAlign > Align) {
-      Align = NewAlign;
+    Align NewAlign(DL.getABITypeAlignment(IRTy));
+    if (NewAlign > Alignment) {
----------------
courbet wrote:
> `Align NewAlign = DL.getABITypeAlign()` ?
Of course!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73874





More information about the llvm-commits mailing list