[PATCH] D69278: [Alignment][NFC] Attributes use Align/MaybeAlign

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 00:21:26 PDT 2019


courbet added inline comments.


================
Comment at: llvm/include/llvm/IR/Attributes.h:799
 
   /// This turns an int alignment (which must be a power of 2) into the
   /// form used internally in Attribute.
----------------
Please update the comment.


================
Comment at: llvm/include/llvm/IR/Attributes.h:801
   /// form used internally in Attribute.
-  AttrBuilder &addAlignmentAttr(unsigned Align);
+  /// This call has no effect if Align is not.
+  AttrBuilder &addAlignmentAttr(MaybeAlign Align);
----------------
is not what ? :)


================
Comment at: llvm/include/llvm/IR/Attributes.h:812
 
   /// This turns an int stack alignment (which must be a power of 2) into
   /// the form used internally in Attribute.
----------------
ditto


================
Comment at: llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp:1574
       // Hopefully ptxas bug is fixed by then.
       if (!isKernelFunc && align < 4)
+        align = Align(4);
----------------
`align < 4`: do we want this to compile ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69278





More information about the llvm-commits mailing list