[PATCH] D73005: [Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's Alignment Attribute on call-site function return value

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 23 09:25:10 PST 2020


erichkeane added inline comments.


================
Comment at: clang/lib/CodeGen/CGCall.cpp:3836
+
+  llvm::Value *Alignment;                // May or may not be a constant.
+  llvm::ConstantInt *OffsetCI = nullptr; // Constant, hopefully zero.
----------------
Does this need an initial value?  


================
Comment at: clang/lib/CodeGen/CGCall.cpp:3841
+      : CGF(CGF_) {
+    if (!FuncDecl)
+      return;
----------------
Does it make sense to call this on not a functiondecl?  Should this just be an assert?


================
Comment at: clang/lib/CodeGen/CGCall.cpp:3852
+      return Attrs;
+    const auto *AlignmentCI = dyn_cast<llvm::ConstantInt>(Alignment);
+    if (!AlignmentCI)
----------------
dyn_cast_or_null?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73005





More information about the cfe-commits mailing list