[PATCH] D51377: [NFC] Make getPreferredAlignment honor section markings.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 28 15:27:32 PDT 2018


efriedma added inline comments.


================
Comment at: lib/IR/DataLayout.cpp:834
+  // FIXME: Why 16, specifically?
   if (GV->hasInitializer() && GVAlignment == 0) {
     if (Alignment < 16) {
----------------
dmgreen wrote:
> About this, it keeps adding very visible codesize (technially datasize) to our images, which because our linker reports all the padding is very visible to customers, and unnecissarily bloats the images.
> 
> I ran some benchmarks and couldn't find any places it was improving performance, at least on ARM/AArch64. Remove this actually improved things in a few places.
> 
> The over-aligning globals dates back to a long time ago, I'm just not sure it's worth doing on many architectures. From what I remember, removing it does fail some X86 tests though, with worse looking code.
> 
> We may need be smarter than that and come up with some way to remove it for targets (or a way to mark globals as optsize :-/ )
Are you sure it's this code, specifically, causing the bloat?  As far as I know, clang explicitly marks the alignment of all globals it creates, which makes this code irrelevant.


Repository:
  rL LLVM

https://reviews.llvm.org/D51377





More information about the llvm-commits mailing list