[PATCH] [ARM] Align global variables passed to memory intrinsics

Renato Golin renato.golin at linaro.org
Fri Mar 27 03:36:54 PDT 2015


LGTM. But please, let Hal reply to your questions before commit.


REPOSITORY
  rL LLVM

================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:1261
@@ +1260,3 @@
+          GV->hasInitializer() &&
+          !GV->hasSection() &&
+          GV->getAlignment() < PrefAlign &&
----------------
john.brawn wrote:
> rengolin wrote:
> > Why is this necessary?
> As I said to Hal previously, http://llvm.org/docs/LangRef.html#global-variables says:
> Targets and optimizers are not allowed to over-align the global if the global has an assigned section. In this case, the extra alignment could be observable: for example, code could assume that the globals are densely packed in their section and try to iterate over them as an array, alignment padding would break this iteration.
Sorry, I missed the "section" part when I read that. :)

http://reviews.llvm.org/D8421

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list