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

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 28 14:54:15 PDT 2018


dmgreen added a comment.

Thanks for this.



================
Comment at: lib/IR/DataLayout.cpp:834
+  // FIXME: Why 16, specifically?
   if (GV->hasInitializer() && GVAlignment == 0) {
     if (Alignment < 16) {
----------------
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 :-/ )


Repository:
  rL LLVM

https://reviews.llvm.org/D51377





More information about the llvm-commits mailing list