Fill in the TODO in CodeGenPrepare::OptimizeCallInst so that global variables that are passed to memory intrinsics are aligned in the same way that allocas are.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/CodeGenPrepare.cpp | ||
---|---|---|
1249 | That's what we want: this is the 'offset must be a multiple of the alignment' check, and if it's not true we don't want to align for both allocas and global variables. | |
1257 | http://llvm.org/docs/LangRef.html#global-variables says: | |
1260 | I think that hasUniqueInitializer is what we want. We want to make sure that increasing the alignment of this GlobalVariable will definitely increase the alignment in the final executable, i.e. we won't get a definition of this variable from another object that doesn't have this increased alignment. |
lib/CodeGen/CodeGenPrepare.cpp | ||
---|---|---|
1261 | As I said to Hal previously, http://llvm.org/docs/LangRef.html#global-variables says: |
LGTM. But please, let Hal reply to your questions before commit.
lib/CodeGen/CodeGenPrepare.cpp | ||
---|---|---|
1261 | Sorry, I missed the "section" part when I read that. :) |
If you add a continue here, then you might end up skipping some logic further down that would otherwise apply, no?