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

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 04:19:56 PST 2020


courbet accepted this revision.
courbet added inline comments.
This revision is now accepted and ready to land.


================
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.
----------------
Why not use an `Align` as storage ?


================
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) {
----------------
`Align NewAlign = DL.getABITypeAlign()` ?


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:1113
     Type *IRTy = getTypeForLLT(MemOps[0], C);
-    unsigned NewAlign = (unsigned)DL.getABITypeAlignment(IRTy);
+    Align NewAlign(DL.getABITypeAlignment(IRTy));
 
----------------
ditto


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:1218
     Type *IRTy = getTypeForLLT(MemOps[0], C);
-    unsigned NewAlign = (unsigned)DL.getABITypeAlignment(IRTy);
+    Align NewAlign(DL.getABITypeAlignment(IRTy));
 
----------------
ditto


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5924
     Type *Ty = MemOps[0].getTypeForEVT(C);
-    unsigned NewAlign = (unsigned)DL.getABITypeAlignment(Ty);
+    Align NewAlign(DL.getABITypeAlignment(Ty));
 
----------------
ditto


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:6104
     Type *Ty = MemOps[0].getTypeForEVT(C);
-    unsigned NewAlign = (unsigned)DL.getABITypeAlignment(Ty);
-    if (NewAlign > Align) {
+    Align NewAlign(DL.getABITypeAlignment(Ty));
+    if (NewAlign > Alignment) {
----------------
ditto


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:6203
     Type *Ty = MemOps[0].getTypeForEVT(*DAG.getContext());
-    unsigned NewAlign = (unsigned)DAG.getDataLayout().getABITypeAlignment(Ty);
-    if (NewAlign > Align) {
+    Align NewAlign(DAG.getDataLayout().getABITypeAlignment(Ty));
+    if (NewAlign > Alignment) {
----------------
ditto


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