[PATCH] D49710: [GlobalMerge] Allow merging globals with arbitrary alignment.

David Greene via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 24 09:51:46 PDT 2018


greened added inline comments.


================
Comment at: lib/CodeGen/GlobalMerge.cpp:464
       Type *Ty = Globals[j]->getValueType();
+      unsigned Align = Globals[j]->getPointerAlignment(DL);
+      unsigned Padding = alignTo(MergedSize, Align) - MergedSize;
----------------
The eliminated check below used DL.getPreferredAlignment.  Is this equivalent?  If I understand getPointerAlignment correctly, it is more conservative than DL.getPreferredAlignment.  So it seems the eliminated check was too conservative.  It eliminated things that might not have had a problematic alignment.

Just making sure I'm understanding this correctly.


Repository:
  rL LLVM

https://reviews.llvm.org/D49710





More information about the llvm-commits mailing list