[PATCH] D73274: [Alignment][NFC] Use Align with CreateAlignedStore

Clement Courbet via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 23 07:52:12 PST 2020


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


================
Comment at: llvm/include/llvm/IR/DataLayout.h:504
   /// Returns the minimum ABI-required alignment for the specified type.
+  /// TODO: Deprecate this function once migration to Align is over.
   unsigned getABITypeAlignment(Type *Ty) const;
----------------
FIXME


================
Comment at: llvm/include/llvm/IR/DataLayout.h:525
   /// This is always at least as good as the ABI alignment.
+  /// TODO: Deprecate this function once migration to Align is over.
   unsigned getPrefTypeAlignment(Type *Ty) const;
----------------
FIXME


================
Comment at: llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp:534
 
   unsigned AlignVal = cast<ConstantInt>(Alignment)->getZExtValue();
   unsigned VectorWidth = Src->getType()->getVectorNumElements();
----------------
You can use a typed variable here.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:1225
+      llvm::Instruction *NS =
+          IC.Builder.CreateAlignedStore(Val, Ptr, MaybeAlign(EltAlign));
       AAMDNodes AAMD;
----------------
I don;t think you need the `MaybeAlign` here


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:1276
+      Instruction *NS =
+          IC.Builder.CreateAlignedStore(Val, Ptr, MaybeAlign(EltAlign));
       AAMDNodes AAMD;
----------------
ditto


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73274





More information about the cfe-commits mailing list